memote.support.thermodynamics

Supporting functions for checks requiring the eQuilibrator API.

Module Contents

Functions

get_smallest_compound_id(compounds_identifiers) Return the smallest KEGG compound identifier from a list.
map_metabolite2kegg(metabolite) Return a KEGG compound identifier for the metabolite if it exists.
translate_reaction(reaction, metabolite_mapping) Return a mapping from KEGG compound identifiers to coefficients.
find_thermodynamic_reversibility_index(reactions) Return the reversibility index of the given reactions.
memote.support.thermodynamics.compound_matcher[source]
memote.support.thermodynamics.logger[source]
memote.support.thermodynamics.get_smallest_compound_id(compounds_identifiers)[source]

Return the smallest KEGG compound identifier from a list.

KEGG identifiers may map to compounds, drugs or glycans prefixed respectively with “C”, “D”, and “G” followed by at least 5 digits. We choose the lowest KEGG identifier with the assumption that several identifiers are due to chirality and that the lower one represents the more common form.

Parameters:
compounds_identifiers : list

A list of mixed KEGG identifiers.

Returns:
str

The KEGG compound identifier with the smallest number.

Raises:
ValueError

When compound_identifiers contains no KEGG compound identifiers.

memote.support.thermodynamics.map_metabolite2kegg(metabolite)[source]

Return a KEGG compound identifier for the metabolite if it exists.

First see if there is an unambiguous mapping to a single KEGG compound ID provided with the model. If not, check if there is any KEGG compound ID in a list of mappings. KEGG IDs may map to compounds, drugs and glycans. KEGG compound IDs are sorted so we keep the lowest that is there. If none of this works try mapping to KEGG via the CompoundMatcher by the name of the metabolite. If the metabolite cannot be mapped at all we simply map it back to its own ID.

Parameters:
metabolite : cobra.Metabolite

The metabolite to be mapped to its KEGG compound identifier.

Returns:
None

If the metabolite could not be mapped.

str

The smallest KEGG compound identifier that was found.

memote.support.thermodynamics.translate_reaction(reaction, metabolite_mapping)[source]

Return a mapping from KEGG compound identifiers to coefficients.

Parameters:
reaction : cobra.Reaction

The reaction whose metabolites are to be translated.

metabolite_mapping : dict

An existing mapping from cobra.Metabolite to KEGG compound identifier that may already contain the metabolites in question or will have to be extended.

Returns:
dict

The stoichiometry of the reaction given as a mapping from metabolite KEGG identifier to coefficient.

memote.support.thermodynamics.find_thermodynamic_reversibility_index(reactions)[source]

Return the reversibility index of the given reactions.

To determine the reversibility index, we calculate the reversibility index ln_gamma (see [1] section 3.5) of each reaction using the eQuilibrator API [2].

Parameters:
reactions: list of cobra.Reaction

A list of reactions for which to calculate the reversibility index.

Returns:
tuple
list of cobra.Reaction, index pairs

A list of pairs of reactions and their reversibility indexes.

list of cobra.Reaction

A list of reactions which contain at least one metabolite that could not be mapped to KEGG on the basis of its annotation.

list of cobra.Reaction

A list of reactions for which it is not possible to calculate the standard change in Gibbs free energy potential. Reasons of failure include that participating metabolites cannot be broken down with the group contribution method.

list of cobra.Reaction

A list of reactions that are not chemically or redox balanced.

References

[1]Elad Noor, Arren Bar-Even, Avi Flamholz, Yaniv Lubling, Dan Davidi, Ron Milo; An integrated open framework for thermodynamics of reactions that combines accuracy and coverage, Bioinformatics, Volume 28, Issue 15, 1 August 2012, Pages 2037–2044, https://doi.org/10.1093/bioinformatics/bts317
[2]https://pypi.org/project/equilibrator-api/