Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
COBREXA.jl
Manage
Activity
Members
Plan
External wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LCSB-BioCore
COBREXA.jl
Commits
b90df728
Commit
b90df728
authored
3 years ago
by
Miroslav Kratochvil
Browse files
Options
Downloads
Patches
Plain Diff
improve parametrization of objective_envelope
parent
1a9348ef
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/analysis/envelopes.jl
+24
-12
24 additions, 12 deletions
src/analysis/envelopes.jl
with
24 additions
and
12 deletions
src/analysis/envelopes.jl
+
24
−
12
View file @
b90df728
...
...
@@ -51,8 +51,10 @@ objective_envelope(model::MetabolicModel, rids::Vector{String}, args...; kwargs.
model::MetabolicModel,
ridxs::Vector{Int},
optimizer;
modifications = [],
lattice_args = (),
lattice = envelope_lattice(model, ridxs; lattice_args...),
analysis = screen_optimize_objective,
kwargs...,
)
...
...
@@ -62,11 +64,11 @@ lower and upper bounds.
This can be used to compute a "
production
envelope
" of a metabolite; but
generalizes to any specifiable objective and to multiple dimensions of the
examined space.
T
o retrieve a production envelope of any
metabolite, set the
objective coefficient vector of the `model` to a vector
that contains a single
`1` for the exchange reaction that "
outputs
" this
metabolite, and run
[`objective_envelope`](@ref) with the exchange reaction of
the "
parameter
"
metabolite specified in `ridxs`.
examined space.
For example, t
o retrieve a production envelope of any
metabolite, set the
objective coefficient vector of the `model` to a vector
that contains a single
`1` for the exchange reaction that "
outputs
" this
metabolite, and run
[`objective_envelope`](@ref) with the exchange reaction of
the "
parameter
"
metabolite specified in `ridxs`.
Returns a named tuple that contains `lattice` with reference values of the
metabolites, and an N-dimensional array `values` with the computed objective
...
...
@@ -78,6 +80,9 @@ the model and reaction indexes. Additional arguments for the call to
[`envelope_lattice`](@ref) can be optionally specified in `lattice_args`.
`kwargs` are internally forwarded to [`screen_optmodel_modifications`](@ref).
`modifications` are appended to the list of modifications after the lattice
bounds are set. By default, this returns the objective values for all points in
the lattice; alternate outputs can be implemented via the `analysis` argument.
# Example
```
...
...
@@ -106,8 +111,10 @@ objective_envelope(
model
::
MetabolicModel
,
ridxs
::
Vector
{
Int
},
optimizer
;
modifications
=
[],
lattice_args
=
(),
lattice
=
envelope_lattice
(
model
,
ridxs
;
lattice_args
...
),
analysis
=
screen_optimize_objective
,
kwargs
...
,
)
=
(
lattice
=
collect
.
(
lattice
),
...
...
@@ -115,14 +122,19 @@ objective_envelope(
model
,
optimizer
;
modifications
=
collect
(
[(
_
,
optmodel
)
->
begin
for
(
i
,
ridx
)
in
enumerate
(
ridxs
)
set_normalized_rhs
(
optmodel
[
:
lbs
][
ridx
],
fluxes
[
i
])
set_normalized_rhs
(
optmodel
[
:
ubs
][
ridx
],
fluxes
[
i
])
end
end
]
for
fluxes
in
Iterators
.
product
(
lattice
...
)
vcat
(
[
(
_
,
optmodel
)
->
begin
for
(
i
,
ridx
)
in
enumerate
(
ridxs
)
set_normalized_rhs
(
optmodel
[
:
lbs
][
ridx
],
fluxes
[
i
])
set_normalized_rhs
(
optmodel
[
:
ubs
][
ridx
],
fluxes
[
i
])
end
end
,
],
modifications
,
)
for
fluxes
in
Iterators
.
product
(
lattice
...
)
),
analysis
=
screen_optimize_objective
,
analysis
=
analysis
,
kwargs
...
,
),
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment