BFAIR.mfa.sampling.bound_relaxation

BFAIR.mfa.sampling.bound_relaxation(infeasible_model, fittedFluxes, destructive=True, fluxes_to_ignore=[])[source]

Relaxation function for cobra metabolic models. By making use of the Gurobi solver, this functions figures out which bounds have to be relaxed by how much in order to make the model solution feasible. If destructive=True, then these changes are automatically applied.

Parameters
infeasible_modelcobra.Model

A metabolic model with constraints that lead to an infeasible solution.

fittedFluxespandas.DataFrame

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

destructivebool

Preset to True. If True, then the calculated fluxes will be applied to the model.

fluxes_to_ignorelist

A list of fluxes that should not be relaxed. Preset to [].

Returns
cons_tablepandas.DataFrame

A dataframe listing the reactions that have to be relaxed and the changes that need to be applied.

Raises
ModuleNotFoundError

If Gurobi is not the solver of the input model.

Infeasible

If the feasibility relaxation fails.