:mod:`memote.support.thermodynamics` ==================================== .. py:module:: memote.support.thermodynamics .. autoapi-nested-parse:: Supporting functions for checks requiring the eQuilibrator API. .. !! processed by numpydoc !! Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: memote.support.thermodynamics.get_smallest_compound_id memote.support.thermodynamics.map_metabolite2kegg memote.support.thermodynamics.translate_reaction memote.support.thermodynamics.find_thermodynamic_reversibility_index .. data:: compound_matcher .. data:: logger .. function:: get_smallest_compound_id(compounds_identifiers) 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. .. !! processed by numpydoc !! .. function:: map_metabolite2kegg(metabolite) 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. .. !! processed by numpydoc !! .. function:: translate_reaction(reaction, metabolite_mapping) 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. .. !! processed by numpydoc !! .. function:: find_thermodynamic_reversibility_index(reactions) Return the reversibility index of the given reactions. To determine the reversibility index, we calculate the reversibility index ln_gamma (see [R7b2151b2cd73-1]_ section 3.5) of each reaction using the eQuilibrator API [R7b2151b2cd73-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. .. rubric:: References .. [R7b2151b2cd73-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 .. [R7b2151b2cd73-2] https://pypi.org/project/equilibrator-api/ .. only:: latex [R7b2151b2cd73-1]_, [R7b2151b2cd73-2]_ .. !! processed by numpydoc !!