memote.support.helpers module

Helper functions that are used all over the memote package.

memote.support.helpers.df2dict(df)[source]

Turn a pandas.DataFrame into a dict of lists.

memote.support.helpers.find_atp_adp_converting_reactions(model)[source]

Find reactions which interact with ATP and ADP.

Parameters:

model : cobra.Model

The metabolic model under investigation.

memote.support.helpers.find_biomass_reaction(model)[source]

Return a list of the biomass reaction(s) of the model.

Parameters:

model : cobra.Model

The metabolic model under investigation.

memote.support.helpers.find_demand_reactions(model)[source]

Return a list of demand reactions.

Parameters:

model : cobra.Model

A cobrapy metabolic model

Notes

[1] defines demand reactions as: – ‘unbalanced network reactions that allow the accumulation of a compound’ – reactions that are chiefly added during the gap-filling process – as a means of dealing with ‘compounds that are known to be produced by the organism [..] (i) for which no information is available about their fractional distribution to the biomass or (ii) which may only be produced in some environmental conditions – reactions with a formula such as: ‘met_c -> ‘

Demand reactions differ from exchange reactions in that the metabolites are not removed from the extracellular environment, but from any of the organism’s compartments.

References

[R1113]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.helpers.find_exchange_rxns(model)[source]

Return a list of exchange reactions.

Parameters:

model : cobra.Model

A cobrapy metabolic model

Notes

[1] defines exchange reactions as: – reactions that ‘define the extracellular environment’ – ‘unbalanced, extra-organism reactions that represent the supply to or removal of metabolites from the extra-organism “space”’ – reactions with a formula such as: ‘met_e -> ‘ or ‘ -> met_e’ or ‘met_e <=> ‘

Exchange reactions differ from demand reactions in that the metabolites are removed from or added to the extracellular environment only. With this the uptake or secretion of a metabolite is modeled, respectively.

References

[R1214]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.helpers.find_functional_units(gpr_str)[source]

Return an iterator of gene IDs grouped by boolean rules from the gpr_str.

The gpr_str is first transformed into an algebraic expression, replacing the boolean operators ‘or’ with ‘+’ and ‘and’ with ‘*’. Treating the gene IDs as sympy.symbols this allows a mathematical expansion of the algebraic expression. The expanded form is then split again producing sets of gene IDs that in the gpr_str had an ‘and’ relationship.

Parameters:

gpr_str : string

A string consisting of gene ids and the boolean expressions ‘and’ and ‘or’

memote.support.helpers.find_sink_reactions(model)[source]

Return a list of sink reactions.

Parameters:

model : cobra.Model

A cobrapy metabolic model

Notes

[1] defines sink reactions as: – ‘similar to demand reactions’ but reversible, thus able to supply the model with metabolites – reactions that are chiefly added during the gap-filling process – as a means of dealing with ‘compounds that are produced by nonmetabolic cellular processes but that need to be metabolized’ – reactions with a formula such as: ‘met_c <-> ‘

Sink reactions differ from exchange reactions in that the metabolites are not removed from the extracellular environment, but from any of the organism’s compartments.

References

[R1315]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.helpers.find_transport_reactions(model)[source]

Return a list of all transport reactions.

Parameters:

model : cobra.Model

The metabolic model under investigation.

Notes

A transport reaction is defined as follows: 1. It contains metabolites from at least 2 compartments and 2. at least 1 metabolite undergoes no chemical reaction, i.e., the formula stays the same on both sides of the equation.

This function will not identify transport via the PTS System.

memote.support.helpers.find_transported_elements(rxn)[source]

Return a dictionary showing the amount of transported elements of a rxn.

Collects the elements for each metabolite participating in a reaction, multiplies the amount by the metabolite’s stoichiometry in the reaction and bins the result according to the compartment that metabolite is in. This produces a dictionary of dictionaries such as this {'p': {'C': -1, 'H': -4}, c: {'C': 1, 'H': 4}} which shows the transported entities. This dictionary is then simplified to only include the non-zero elements of one single compartment i.e. showing the precise elements that are transported.

Parameters:

rxn : cobra.Reaction

Any cobra.Reaction containing metabolites.