diff --git a/src/frontend/variability.jl b/src/frontend/variability.jl index 3fe625f27..a180d5d5c 100644 --- a/src/frontend/variability.jl +++ b/src/frontend/variability.jl @@ -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 diff --git a/src/solver.jl b/src/solver.jl index 2d212668a..5c8b37f74 100644 --- a/src/solver.jl +++ b/src/solver.jl @@ -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...)