mass.core.mass_metabolite
MassMetabolite is a class for holding information regarding metabolites.
The MassMetabolite class inherits and extends the
Metabolite class in cobra. It contains
additional information required for simulations and other mass
functions and workflows.
Some key differences between the
cobra.Metabolite and the
mass.MassMetabolite are
listed below:
Unlike the
cobra.Metabolitetheidinitialization argument has been replaced withid_or_specieto be clear in that a newMassMetabolitecan be instantiated with the same properties of a previously created metabolite by passing the metabolite object to this argument.The
formulas can have moieties by placing them within square brackets (e.g."[ENZYME]")
Module Contents
Classes
Class for holding information regarding a metabolite. |
- class mass.core.mass_metabolite.MassMetabolite(id_or_specie=None, name='', formula=None, charge=None, compartment=None, fixed=False)[source]
Bases:
cobra.core.metabolite.MetaboliteClass for holding information regarding a metabolite.
- Parameters
id_or_specie (str, Metabolite, MassMetabolite) – A string identifier to associate with the metabolite, or an existing metabolite object. If an existing metabolite object is provided, a new
MassMetaboliteis instantiated with the same properties as the original metabolite.name (str) – A human readable name for the metabolite.
formula (str) – Chemical formula associated with the metabolite (e.g. H2O).
charge (float) – The charge number associated with the metabolite.
compartment (str) – Compartment of the metabolite.
fixed (bool) – Whether the metabolite concentration should remain at a fixed value. Default is
False.
- property elements[source]
Get or set
dictof elements in theformula.- Parameters
elements_dict (dict) – A
dictrepresenting the elements of the chemical formula where keys are elements and values are the amount.
Notes
Enzyme and macromolecule moieties can be recognized by enclosing them in brackets (e.g. [ENZYME]) when defining the chemical formula. They are treated as one entity and therefore are only counted once.
Overrides
elements()of thecobra.Metaboliteto allow for the use of moieties.
- property initial_condition[source]
Get or set the initial condition of the metabolite.
When using a HistoryManager context, this attribute can be set temporarily, reversed when the exiting the context.
Notes
Initial conditions of metabolites cannot be negative.
- Parameters
value (float) – A non-negative number for the concentration of the metabolite.
- Raises
ValueError – Occurs when trying to set a negative value.
- property fixed[source]
Get or set whether the metabolite remains constant.
When using a HistoryManager context, this attribute can be set temporarily, reversed when the exiting the context.
- Parameters
value (bool) – Whether the metabolite should remain constant, meaning that the metabolite ODE is 0.
- property ordinary_differential_equation[source]
Return a
sympyexpression of the metabolite’s associated ODE.Will return
Noneif metabolite is not associated with aMassReaction, or0. if thefixedattribute is set asTrue.
- property formula_weight[source]
Calculate and return the formula weight of the metabolite.
Does not consider any moieties enclosed in brackets.
Notes
Overrides
formula_weight()of thecobra.Metaboliteto allow for the use of moieties.
- property ic[source]
Alias for the
initial_condition.
- property ode[source]
Alias for the
ordinary_differential_equation.
- _remove_compartment_from_id_str()[source]
Remove the compartment from the ID str of the metabolite.
Warning
This method is intended for internal use only.