memote.support.consistency

Supporting functions for stoichiometric consistency checks.

Module Contents

Functions

check_stoichiometric_consistency(model) Verify the consistency of the model’s stoichiometry.
find_unconserved_metabolites(model) Detect unconserved metabolites.
find_inconsistent_min_stoichiometry(model, atol=1e-13, max_mets_computed=10) Detect inconsistent minimal net stoichiometries.
find_elementary_leakage_modes(model, atol=1e-13) Detect elementary leakage modes.
detect_energy_generating_cycles(model, metabolite_id) Detect erroneous energy-generating cycles for a a single metabolite.
find_mass_unbalanced_reactions(reactions) Find metabolic reactions that are not mass balanced.
find_charge_unbalanced_reactions(reactions) Find metabolic reactions that are not charge balanced.
find_stoichiometrically_balanced_cycles(model) Find metabolic reactions in stoichiometrically balanced cycles (SBCs).
find_orphans(model) Return metabolites that are only consumed in reactions.
find_deadends(model) Return metabolites that are only produced in reactions.
find_disconnected(model) Return metabolites that are not in any of the reactions.
_init_worker(model, variable_name, coefficient) Initialize a global model object for multiprocessing.
_solve_metabolite_exchange(metabolite_id) Solve for a metabolite’s exchange flux.
find_blocked_metabolites(model, coefficient, processes=None) Return metabolite identifiers that cannot be produced or consumed.
find_metabolites_not_produced_with_open_bounds(model, processes=None) Return metabolite identifiers that cannot be produced with open exchanges.
find_metabolites_not_consumed_with_open_bounds(model, processes=None) Return metabolite identifiers that cannot be consumed with open exchanges.
find_reactions_with_unbounded_flux_default_condition(model) Return list of reactions whose flux is unbounded in the default condition.
memote.support.consistency.LOGGER[source]
memote.support.consistency.ENERGY_COUPLES[source]
memote.support.consistency.TOLERANCE_THRESHOLD = 1e-07[source]
memote.support.consistency.cobra_configuration[source]
memote.support.consistency.check_stoichiometric_consistency(model)[source]

Verify the consistency of the model’s stoichiometry.

Parameters:
model : cobra.Model

The metabolic model under investigation.

Notes

See [1] section 3.1 for a complete description of the algorithm.

[1]Gevorgyan, A., M. G Poolman, and D. A Fell. “Detection of Stoichiometric Inconsistencies in Biomolecular Models.” Bioinformatics 24, no. 19 (2008): 2245.
memote.support.consistency.find_unconserved_metabolites(model)[source]

Detect unconserved metabolites.

Parameters:
model : cobra.Model

The metabolic model under investigation.

Notes

See [1] section 3.2 for a complete description of the algorithm.

[1]Gevorgyan, A., M. G Poolman, and D. A Fell. “Detection of Stoichiometric Inconsistencies in Biomolecular Models.” Bioinformatics 24, no. 19 (2008): 2245.
memote.support.consistency.find_inconsistent_min_stoichiometry(model, atol=1e-13, max_mets_computed=10)[source]

Detect inconsistent minimal net stoichiometries.

Parameters:
model : cobra.Model

The metabolic model under investigation.

atol : float, optional

Values below the absolute tolerance are treated as zero. Expected to be very small but larger than zero.

max_mets_computed: int, optional

To avoid computing for too long, a soft cap is added to the number of computed unconserved metabolites (trivial cases are ignored).

Notes

See [1] section 3.3 for a complete description of the algorithm.

References

[1]Gevorgyan, A., M. G Poolman, and D. A Fell. “Detection of Stoichiometric Inconsistencies in Biomolecular Models.” Bioinformatics 24, no. 19 (2008): 2245.
memote.support.consistency.find_elementary_leakage_modes(model, atol=1e-13)[source]

Detect elementary leakage modes.

Parameters:
model : cobra.Model

The metabolic model under investigation.

atol : float, optional

Values below the absolute tolerance are treated as zero. Expected to be very small but larger than zero.

Notes

See [1] section 3.4 for a complete description of the algorithm.

References

[1]Gevorgyan, A., M. G Poolman, and D. A Fell. “Detection of Stoichiometric Inconsistencies in Biomolecular Models.” Bioinformatics 24, no. 19 (2008): 2245.
memote.support.consistency.detect_energy_generating_cycles(model, metabolite_id)[source]

Detect erroneous energy-generating cycles for a a single metabolite.

The function will first build a dissipation reaction corresponding to the input metabolite. This reaction is then set as the objective for optimization, after closing all exchanges. If the reaction was able to carry flux, an erroneous energy-generating cycle must be present. In this case a list of reactions with a flux greater than zero is returned. Otherwise, the function returns False.

Parameters:
model : cobra.Model

The metabolic model under investigation.

metabolite_id : str

The identifier of an energy metabolite.

Notes

“[…] energy generating cycles (EGC) […] charge energy metabolites without a source of energy. […] To efficiently identify the existence of diverse EGCs, we first add a dissipation reaction to the metabolic network for each metabolite used to transmit cellular energy; e.g., for ATP, the irreversible reaction ATP + H2O → ADP + P + H+ is added. These dissipation reactions close any existing energy-generating cycles, thereby converting them to type-III pathways. Fluxes through any of the dissipation reactions at steady state indicate the generation of energy through the metabolic network. Second, all uptake reactions are constrained to zero. The sum of the fluxes through the energy dissipation reactions is now maximized using FBA. For a model without EGCs, these reactions cannot carry any flux without the uptake of nutrients. [1].”

References

[1]Fritzemeier, C. J., Hartleb, D., Szappanos, B., Papp, B., & Lercher, M. J. (2017). Erroneous energy-generating cycles in published genome scale metabolic networks: Identification and removal. PLoS Computational Biology, 13(4), 1–14. http://doi.org/10.1371/journal.pcbi.1005494
memote.support.consistency.find_mass_unbalanced_reactions(reactions)[source]

Find metabolic reactions that are not mass balanced.

Parameters:
reactions : iterable

An iterable of cobra.Reaction’s.

memote.support.consistency.find_charge_unbalanced_reactions(reactions)[source]

Find metabolic reactions that are not charge balanced.

Parameters:
reactions : iterable

An iterable of cobra.Reaction’s.

memote.support.consistency.find_stoichiometrically_balanced_cycles(model)[source]

Find metabolic reactions in stoichiometrically balanced cycles (SBCs).

Identify forward and reverse cycles by closing all exchanges and using FVA.

Parameters:
model : cobra.Model

The metabolic model under investigation.

Notes

“SBCs are artifacts of metabolic reconstructions due to insufficient constraints (e.g., thermodynamic constraints and regulatory constraints) [1].” They are defined by internal reactions that carry flux in spite of closed exchange reactions.

References

[1]Thiele, I., & Palsson, B. Ø. (2010, January). A protocol for generating a high-quality genome-scale metabolic reconstruction. Nature protocols. Nature Publishing Group. http://doi.org/10.1038/nprot.2009.203
memote.support.consistency.find_orphans(model)[source]

Return metabolites that are only consumed in reactions.

Metabolites that are involved in an exchange reaction are never considered to be orphaned.

Parameters:
model : cobra.Model

The metabolic model under investigation.

memote.support.consistency.find_deadends(model)[source]

Return metabolites that are only produced in reactions.

Metabolites that are involved in an exchange reaction are never considered to be dead ends.

Parameters:
model : cobra.Model

The metabolic model under investigation.

memote.support.consistency.find_disconnected(model)[source]

Return metabolites that are not in any of the reactions.

Parameters:
model : cobra.Model

The metabolic model under investigation.

memote.support.consistency._init_worker(model, variable_name, coefficient)[source]

Initialize a global model object for multiprocessing.

Parameters:
model : cobra.Model

The metabolic model under investigation.

variable_name: str

The name of the variable representing the metabolite exchange.

coefficient: int

The value of the metabolite’s stoichiometric coefficient: -1 to test if the model can produce the metabolite and 1 to test if it can be consumed.

memote.support.consistency._solve_metabolite_exchange(metabolite_id)[source]

Solve for a metabolite’s exchange flux.

By adding the exchange variable to the metabolite constraint, the solution tests whether the metabolic model produce or consume the metabolite.

Parameters:
metabolite_id: str

The exchange will be added to this metabolite as a linear coefficient.

Returns:
float

The numeric value of the solution of the flux-balance problem; NaN if infeasible.

str

The identifier of the considered metabolite.

Notes

The model, exchange variable, and stoichiometric coefficient are globals.

memote.support.consistency.find_blocked_metabolites(model, coefficient, processes=None)[source]

Return metabolite identifiers that cannot be produced or consumed.

Parameters:
model : cobra.Model

The metabolic model under investigation.

coefficient: int

Test if production is possible with -1 and consumption with 1.

processes: int, optional

Number of processes to be used (the default is taken from cobra.Configuration.processes).

Returns:
list

The identifiers of blocked metabolites.

memote.support.consistency.find_metabolites_not_produced_with_open_bounds(model, processes=None)[source]

Return metabolite identifiers that cannot be produced with open exchanges.

A perfect model should be able to produce each and every metabolite when all medium components are available.

Parameters:
model : cobra.Model

The metabolic model under investigation.

processes: int, optional

Number of processes to be used (the default is taken from cobra.Configuration.processes).

Returns:
list

The metabolite identifiers that could not be produced.

memote.support.consistency.find_metabolites_not_consumed_with_open_bounds(model, processes=None)[source]

Return metabolite identifiers that cannot be consumed with open exchanges.

When all metabolites can be secreted, it should be possible for each and every metabolite to be consumed in some form.

Parameters:
model : cobra.Model

The metabolic model under investigation.

processes: int, optional

Number of processes to be used (the default is taken from cobra.Configuration.processes).

Returns:
list

The metabolite identifiers that could not be consumed.

memote.support.consistency.find_reactions_with_unbounded_flux_default_condition(model)[source]

Return list of reactions whose flux is unbounded in the default condition.

Parameters:
model : cobra.Model

The metabolic model under investigation.

Returns:
tuple
list

A list of reactions that in default modeling conditions are able to carry flux as high/low as the systems maximal and minimal bounds.

float

The fraction of the amount of unbounded reactions to the amount of non-blocked reactions.

list

A list of reactions that in default modeling conditions are not able to carry flux at all.