BFAIR.mfa.sampling.add_feasible_constraints

BFAIR.mfa.sampling.add_feasible_constraints(model_input, fittedFluxes, min_val=0)[source]

Adds contraints to a metabolic model one by one; always checking that is still produces a feasible solution and that the predicted objective does not fall below a predefined value. If that were to happen, the function would restart but skip the reaction that caused the issue in the next iteration.

Parameters
model_inputcobra.Model

Metabolic model.

fittedFluxespandas.DataFrame

Dataframe (reimported output of an INCA simulation) that contains the confidence intervals predicted for the model.

min_valfloat

Minimum allowed value for the optimized solution predicted for the objective. Preset to 0.

Returns
modelcobra.Model

Feasible metabolic model with added constraints.

problemslist

list of the reaction names of the reactions whose added constraints caused the model to fail the tests (feasibilty or minimum value).