psamm.moma
– Minimization of metabolic adjustments¶
Implementation of Minimization of Metabolic Adjustments (MOMA).

class
psamm.moma.
ConstraintGroup
(moma, *args)¶ Constraints that will be imposed on the model when solving.
Parameters:  moma – MOMAProblem object for the proposed constraints.
 *args – The constraints that are imposed on the model.

add
(*args)¶ Add constraints to the model.

delete
()¶ Set up the constraints to get deleted on the next solve.

exception
psamm.moma.
MOMAError
¶ Error indicating an error solving MOMA.

class
psamm.moma.
MOMAProblem
(model, solver)¶ Model as a flux optimization problem with minimal flux redistribution.
Create a representation of the model as an LP optimization problem with steady state assumption and a minimal redistribution of metabolic fluxes with respect to the wild type configuration.
The problem can be solved using any of the four MOMA variants described in [Segre02] and [Mo09]. MOMA is formulated to avoid the FBA assumption that that growth efficiency has evolved to an optimal point directly following model perturbation. MOMA finds the optimal solution for a model with minimal flux redistribution with respect to the wild type flux configuration.
MOMA is implemented with two variations of a linear optimization problem (
lin_moma()
andlin_moma2()
) and two variations of a quadratic optimization problem (moma()
andmoma2()
). Further information on these methods can be found within their respective documentation.The problem can be modified and solved as many times as needed. The flux of a reaction can be obtained after solving using
get_flux()
.Parameters:  model –
MetabolicModel
to solve.  solver – LP solver instance to use.

constraints
(*args)¶ Return a constraint object.

get_fba_flux
(objective)¶ Return a dictionary of all the fluxes solved by FBA.
Dictionary of fluxes is used in
lin_moma()
andmoma()
to minimize changes in the flux distributions following model perturbation.Parameters: objective – The objective reaction that is maximized. Returns: Dictionary of fluxes for each reaction in the model.

get_fba_obj_flux
(objective)¶ Return the maximum objective flux solved by FBA.

get_flux
(reaction)¶ Return the knockout flux for a specific reaction.

get_flux_var
(reaction)¶ Return the LP variable for a specific reaction.

get_minimal_fba_flux
(objective)¶ Find the FBA solution that minimizes all the flux values.
Maximize the objective flux then minimize all other fluxes while keeping the objective flux at the maximum.
Parameters: objective – The objective reaction that is maximized. Returns: A dictionary of all the reactions and their minimized fluxes.

lin_moma
(wt_fluxes)¶ Minimize the redistribution of fluxes using a linear objective.
The change in flux distribution is mimimized by minimizing the sum of the absolute values of the differences of wild type FBA solution and the knockout strain flux solution.
This formulation bases the solution on the wild type fluxes that are specified by the user. If these wild type fluxes were calculated using FBA, then an arbitrary flux vector that optimizes the objective function is used. See [Segre`_02] for more information.
Parameters: wt_fluxes – Dictionary of all the wild type fluxes. Use get_fba_flux(objective)()
to return a dictionary of fluxes found by FBA.

lin_moma2
(objective, wt_obj)¶ Find the smallest redistribution vector using a linear objective.
The change in flux distribution is mimimized by minimizing the sum of the absolute values of the differences of wild type FBA solution and the knockout strain flux solution.
Creates the constraint that the we select the optimal flux vector that is closest to the wildtype. This might still return an arbitrary flux vector the maximizes the objective function.
Parameters:  objective – Objective reaction for the model.
 wt_obj – The flux value for your wild type objective reactions.
Can either use an expiremental value or on determined by FBA
by using
get_fba_obj_flux(objective)()
.

moma
(wt_fluxes)¶ Minimize the redistribution of fluxes using Euclidean distance.
Minimizing the redistribution of fluxes using a quadratic objective function. The distance is minimized by minimizing the sum of (wild type  knockout)^2.
Parameters: wt_fluxes – Dictionary of all the wild type fluxes that will be used to find a close MOMA solution. Fluxes can be expiremental or calculated using :meth: get_fba_flux(objective).

moma2
(objective, wt_obj)¶ Find the smallest redistribution vector using Euclidean distance.
Minimizing the redistribution of fluxes using a quadratic objective function. The distance is minimized by minimizing the sum of (wild type  knockout)^2.
Creates the constraint that the we select the optimal flux vector that is closest to the wildtype. This might still return an arbitrary flux vector the maximizes the objective function.
Parameters:  objective – Objective reaction for the model.
 wt_obj – The flux value for your wild type objective reactions.
Can either use an expiremental value or on determined by FBA
by using
get_fba_obj_flux(objective)()
.

prob
¶ Return the underlying LP problem.

solve_fba
(objective)¶ Solve the wild type problem using FBA.
Parameters: objective – The objective reaction to be maximized. Returns: The LP Result object for the solved FBA problem.
 model –