Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LCSB-BioCore
COBREXA.jl
Commits
dba54c58
Unverified
Commit
dba54c58
authored
May 06, 2021
by
St. Elmo
Browse files
fixed all functions
parent
98186aad
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/analysis/flux_balance_analysis.jl
View file @
dba54c58
...
...
@@ -8,9 +8,7 @@ Arguments are passed to [`flux_balance_analysis`](@ref).
"""
function
flux_balance_analysis_vec
(
args
...
;
kwargs
...
)
::
Union
{
Vector
{
Float64
},
Nothing
}
optmodel
=
flux_balance_analysis
(
args
...
;
kwargs
...
)
COBREXA
.
JuMP
.
termination_status
(
optmodel
)
in
[
MOI
.
OPTIMAL
,
MOI
.
LOCALLY_SOLVED
]
||
return
nothing
is_solved
(
optmodel
)
||
return
nothing
value
.
(
optmodel
[
:
x
])
end
...
...
src/analysis/flux_variability_analysis.jl
View file @
dba54c58
...
...
@@ -141,13 +141,13 @@ Internal helper for creating the optimized model on a remote worker, for
avoiding namespace problems.
"""
function
_FVA_optimize_reaction
(
model
,
rid
,
ret
)
sense
=
rid
>
0
?
M
OI
.
MAX_SENSE
:
MOI
.
MIN_SENSE
sense
=
rid
>
0
?
M
AX
:
MIN
var
=
all_variables
(
model
)[
abs
(
rid
)]
@objective
(
model
,
sense
,
var
)
optimize!
(
model
)
if
termination_status
(
model
)
in
[
MOI
.
OPTIMAL
,
MOI
.
LOCALLY_SOLVED
]
if
is_solved
(
model
)
return
ret
(
model
)
else
return
nothing
...
...
src/analysis/parsimonious_flux_balance_analysis.jl
View file @
dba54c58
...
...
@@ -41,8 +41,7 @@ function parsimonious_flux_balance_analysis(
)
# Run FBA
opt_model
=
flux_balance_analysis
(
model
,
optimizer
;
modifications
=
modifications
)
COBREXA
.
JuMP
.
termination_status
(
opt_model
)
in
[
MOI
.
OPTIMAL
,
MOI
.
LOCALLY_SOLVED
]
||
return
nothing
# FBA failed
is_solved
(
opt_model
)
||
return
nothing
# FBA failed
# get the objective
Z
=
objective_value
(
opt_model
)
...
...
@@ -63,15 +62,13 @@ function parsimonious_flux_balance_analysis(
@constraint
(
opt_model
,
pfba_constraint
,
lb
<=
original_objective
<=
ub
)
optimize!
(
opt_model
)
COBREXA
.
JuMP
.
termination_status
(
opt_model
)
in
[
MOI
.
OPTIMAL
,
MOI
.
LOCALLY_SOLVED
]
&&
break
is_solved
(
opt_model
)
&&
break
COBREXA
.
JuMP
.
delete
(
opt_model
,
pfba_constraint
)
COBREXA
.
JuMP
.
unregister
(
opt_model
,
:
pfba_constraint
)
end
COBREXA
.
JuMP
.
termination_status
(
opt_model
)
in
[
MOI
.
OPTIMAL
,
MOI
.
LOCALLY_SOLVED
]
||
return
nothing
# pFBA failed
is_solved
(
opt_model
)
||
return
nothing
# pFBA failed
return
opt_model
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