Helper functions that are used all over the memote package.
memote.support.helpers.
close_boundaries_sensibly
(model)[source]¶Return a cobra model with all boundaries closed and changed constraints.
In the returned model previously fixed reactions are no longer constrained as such. Instead reactions are constrained according to their reversibility. This is to prevent the FBA from becoming infeasible when trying to solve a model with closed exchanges and one fixed reaction.
Parameters: | model : cobra.Model
|
---|---|
Returns: | cobra.Model
|
memote.support.helpers.
find_biomass_reaction
(model)[source]¶Return a list of the biomass reaction(s) of the model.
Parameters: | model : cobra.Model
|
---|
memote.support.helpers.
find_converting_reactions
(model, pair)[source]¶Find reactions which convert a given metabolite pair.
Parameters: | model : cobra.Model
pair: tuple or list
|
---|---|
Returns: | frozenset
|
memote.support.helpers.
find_demand_reactions
(model)[source]¶Return a list of demand reactions.
Parameters: | model : cobra.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
[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_exchange_rxns
(model)[source]¶Return a list of exchange reactions.
Parameters: | model : cobra.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
[R1416] | 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
|
---|
memote.support.helpers.
find_sink_reactions
(model)[source]¶Return a list of sink reactions.
Parameters: | model : cobra.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
[R1517] | 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
|
---|
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
|
---|
memote.support.helpers.
run_fba
(model, rxn_id, direction='max', single_value=True)[source]¶Return the solution of an FBA to a set objective function.
Parameters: | model : cobra.Model
rxn_id : string
direction: string
single_value: boolean
|
---|---|
Returns: | cobra.solution
|