psamm.metabolicmodel
– Metabolic model representation¶
Representation of metabolic network models.
-
psamm.metabolicmodel.
create_exchange_id
(existing_ids, compound)¶ Create unique ID for exchange of compound.
-
psamm.metabolicmodel.
create_transport_id
(existing_ids, compound_1, compound_2)¶ Create unique ID for transport reaction of compounds.
-
class
psamm.metabolicmodel.
FluxBounds
(model, reaction)¶ Represents lower and upper bounds of flux as a mutable object
This object is used internally in the model representation. Changing the state of the object will change the underlying model parameters. Deleting a value will reset that value to the defaults.
-
lower
¶ Lower bound
-
upper
¶ Upper bound
-
bounds
¶ Bounds as a tuple
-
-
class
psamm.metabolicmodel.
LimitsView
(model)¶ Provides a view of the flux bounds defined in the model
This object is used internally in MetabolicModel to expose a dictonary view of the FluxBounds associated with the model reactions.
-
class
psamm.metabolicmodel.
MetabolicModel
(database, v_max=1000)¶ Represents a metabolic model containing a set of reactions
The model contains a list of reactions referencing the reactions in the associated database.
-
reactions
¶ Iterator of reactions IDs in the database.
-
compartments
¶ Iterator of compartment IDs in the database.
-
has_reaction
(reaction_id)¶ Whether the given reaction exists in the database.
-
get_reaction_values
(reaction_id)¶ Return stoichiometric values of reaction as a dictionary
-
get_compound_reactions
(compound_id)¶ Iterate over all reaction ids the includes the given compound
-
is_reversible
(reaction_id)¶ Whether the given reaction is reversible
-
is_exchange
(reaction_id)¶ Whether the given reaction is an exchange reaction.
-
add_reaction
(reaction_id)¶ Add reaction to model
-
remove_reaction
(reaction)¶ Remove reaction from model
-
copy
()¶ Return copy of model
-
classmethod
load_model
(database, reaction_iter=None, exchange=None, limits=None, v_max=None)¶ Get model from reaction name iterator.
The model will contain all reactions of the iterator.
-
make_irreversible
(gene_dict={}, exclude_list=[], lumped_rxns={}, all_reversible=False)¶ Creates a new metabolic models with only irreversible reactions.
This function will find every reversible reaction in the model and split it into two reactions with the {rxnid}_forward or {rxnid}_reverse as the IDs.
Parameters: - self – A metabolicmodel object
- gene_dict – A dictionary stores reaction ids as keys and corresponding gene association as values, it’s required only in GIMME function
- exclude_list – list of reactions to exclude in TMFA simulation
- all_reversible – if True make all reactions in model reversible.
- Values:
mm_irrev: A new metabolic model with only irreversible reactions gene_dict_reversible: A dictionary mapping irreversible reaction
ids to gene associations, used only in GIMME function- split_rxns: A list of splitted reactions, each element is a tuple
- of ({rxnid}_forward, {rxnid}_reverse)
-
-
class
psamm.metabolicmodel.
FlipableFluxBounds
(view, reaction)¶ FluxBounds object for a FlipableModelView.
This object is used internally in the FlipableModelView to represent the bounds of flux on a reaction that can be flipped.
-
lower
¶ Lower bound
-
upper
¶ Upper bound
-
-
class
psamm.metabolicmodel.
FlipableStoichiometricMatrixView
(view)¶ Provides a matrix view that flips with the flipable model view.
This object is used internally in FlipableModelView to expose a matrix view that negates the stoichiometric values of flipped reactions.
-
class
psamm.metabolicmodel.
FlipableLimitsView
(view)¶ Provides a limits view that flips with the flipable model view.
This object is used internally in FlipableModelView to expose a limits view that flips the bounds of all flipped reactions.
-
class
psamm.metabolicmodel.
FlipableModelView
(model, flipped={})¶ Proxy wrapper of model objects allowing a flipped set of reactions.
The proxy will forward all properties normally except that flipped reactions will appear to have stoichiometric values negated in the matrix property, and have bounds in the limits property flipped. This view is needed for some algorithms.