Skip to content

Commit

Permalink
FVA frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
exaexa committed Jan 18, 2024
1 parent f5ec073 commit ce224e4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
34 changes: 32 additions & 2 deletions src/frontend/variability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,36 @@
# See the License for the specific language governing permissions and
# limitations under the License.

function flux_variability_analysis(model::A.AbstractFBCModel; optimizer, kwargs...)
#TODO
"""
$(TYPEDSIGNATURES)
TODO
"""
function flux_variability_analysis(
model::A.AbstractFBCModel;
objective_bound,
optimizer,
settings,
workers = D.workers(),
)
constraints = flux_balance_constraints(model)

objective = constraints.objective_value

objective_flux = optimized_constraints(
constraints;
objective = constraints.objective.value,
output = constraints.objective,
optimizer,
settings,
)

constraint_variability(
constraints *
:objective_bound^C.Constraint(objective, objective_bound(objective_flux)),
constraints.fluxes;
optimizer,
settings,
workers,
)
end
4 changes: 2 additions & 2 deletions src/solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ For a "nice" version for simpler finding of metabolic model optima, use
[`flux_balance`](@ref).
"""
function optimized_constraints(
constraints::C.ConstraintTreeElem;
constraints::C.ConstraintTree;
settings = [],
output = constraints,
output::C.ConstraintTreeElem = constraints,
kwargs...,
)
om = optimization_model(constraints; kwargs...)
Expand Down

0 comments on commit ce224e4

Please sign in to comment.