Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LCSB-BioCore
COBREXA.jl
Commits
37dab779
Unverified
Commit
37dab779
authored
Nov 08, 2021
by
Laurent Heirendt
✈
Committed by
GitHub
Nov 08, 2021
Browse files
Merge pull request #509 from LCSB-BioCore/develop
Develop→master 20211108
parents
bea55385
6cab9196
Pipeline
#49323
passed with stages
in 18 minutes and 38 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
37dab779
...
...
@@ -38,6 +38,7 @@ variables:
.global_trigger_compat_tests
:
&global_trigger_compat_tests
rules
:
-
if
:
$CI_COMMIT_BRANCH == "master"
-
if
:
$CI_EXTERNAL_PULL_REQUEST_TARGET_BRANCH_NAME == "master"
#
# Test environment & platform settings
...
...
@@ -58,7 +59,7 @@ variables:
.global_env_win
:
&global_env_win
script
:
-
$global:LASTEXITCODE =
0
# Note the global prefix.
-
Invoke-Expression $Env:ARTENOLIS_SOFT_PATH"\julia\"$Env:JULIA_VER"\bin\julia
"
--inline=yes --check-bounds=yes --color=yes --project=@. -e 'import Pkg; Pkg.test(; coverage =
true
)'
-
Invoke-Expression $Env:ARTENOLIS_SOFT_PATH"\julia\"$Env:JULIA_VER"\bin\julia --inline=yes --check-bounds=yes --color=yes --project=@. -e 'import Pkg; Pkg.test(; coverage =
true
)'
"
-
exit $LASTEXITCODE
.global_env_win8
:
&global_env_win8
...
...
docs/src/notebooks/2_finding_balance.jl
View file @
37dab779
...
...
@@ -155,6 +155,7 @@ dict_soln = parsimonious_flux_balance_analysis_dict(
modifications
=
[
silence
,
# silence the optimizer (OSQP is very verbose by default)
change_constraint
(
"R_EX_glc__D_e"
;
lb
=
-
12
,
ub
=
-
12
),
change_optimizer_attribute
(
"polish"
,
true
),
],
)
...
...
@@ -248,6 +249,7 @@ moment_moma = minimize_metabolic_adjustment_analysis_dict(
modifications
=
[
silence
,
change_optimizer_attribute
(
"polish"
,
true
),
change_optimizer_attribute
(
"max-iter"
,
10_000
),
change_constraint
(
"EX_glc__D_e"
,
lb
=
-
1000
),
change_constraint
(
"CYTBD"
;
lb
=
0
,
ub
=
0
),
add_moment_constraints
(
ksas
,
protein_mass_fraction
;),
...
...
test/analysis/minimize_metabolic_adjustment.jl
View file @
37dab779
@testset
"MOMA"
begin
model
=
load_model
(
StandardModel
,
model_paths
[
"e_coli_core.json"
]
)
model
=
test_toyModel
(
)
sol
=
parsimonious_flux_balance_analysis_dict
(
model
,
OSQP
.
Optimizer
;
modifications
=
[
silence
,
change_optimizer_attribute
(
"polish"
,
true
)],
)
sol
=
[
looks_like_biomass_reaction
(
rid
)
?
0.5
:
0.0
for
rid
in
reactions
(
model
)]
moma
=
minimize_metabolic_adjustment_analysis_dict
(
model
,
sol
,
OSQP
.
Optimizer
;
modifications
=
[
silence
,
change_optimizer_attribute
(
"polish"
,
true
),
change_constraint
(
"CYTBD"
;
lb
=
0.0
,
ub
=
0.0
),
],
modifications
=
[
silence
,
change_optimizer_attribute
(
"polish"
,
true
)],
)
@test
isapprox
(
moma
[
"BIOMASS_Ecoli_core_w_GAM"
],
0.06214149238730545
,
atol
=
QP_TEST_TOLERANCE
,
)
@test
isapprox
(
moma
[
"biomass1"
],
0.07692307692307691
,
atol
=
QP_TEST_TOLERANCE
)
end
test/analysis/parsimonious_flux_balance_analysis.jl
View file @
37dab779
@testset
"Parsimonious flux balance analysis with StandardModel"
begin
model
=
load_model
(
StandardModel
,
model_paths
[
"e_coli_core.json"
])
model
=
test_toyModel
()
d
=
parsimonious_flux_balance_analysis_dict
(
model
,
Tulip
.
Optimizer
;
modifications
=
[
change_constraint
(
"EX_glc__D_e"
;
lb
=
-
12
,
ub
=
-
12
),
change_optimizer_attribute
(
"IPM_IterationsLimit"
,
500
),
],
qp_modifications
=
[
change_optimizer
(
OSQP
.
Optimizer
),
change_optimizer_attribute
(
"polish"
,
true
),
silence
,
],
)
v
=
parsimonious_flux_balance_analysis_vec
(
model
,
Tulip
.
Optimizer
;
modifications
=
[
change_constraint
(
"EX_glc__D_e"
;
lb
=
-
12
,
ub
=
-
12
),
change_constraint
(
"EX_m1(e)"
,
lb
=
-
10.0
),
change_optimizer_attribute
(
"IPM_IterationsLimit"
,
500
),
],
qp_modifications
=
[
...
...
@@ -29,6 +17,5 @@
# The used optimizer doesn't really converge to the same answer everytime
# here, we therefore tolerate a wide range of results.
@test
isapprox
(
d
[
"PGM"
],
-
17.606459419216442
,
atol
=
QP_TEST_TOLERANCE
)
@test
isapprox
(
v
[
8
],
-
17.606459419216442
,
atol
=
QP_TEST_TOLERANCE
)
@test
isapprox
(
d
[
"biomass1"
],
10.0
,
atol
=
QP_TEST_TOLERANCE
)
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment