6.1.1.6.1.6. pytfa.thermo.utils
¶
Some tools around COBRApy models used by pyTFA
6.1.1.6.1.6.1. Module Contents¶
6.1.1.6.1.6.1.1. Functions¶
|
Check the balance of a reaction, and eventually add protons to balance |
|
Get a list of the transported metabolites of the reaction. |
|
Check if a reaction is a transport reaction |
|
|
|
|
|
Get the compartment of a reaction to then prepare it for conversion. |
6.1.1.6.1.6.1.2. Attributes¶
|
- pytfa.Formula_regex¶
- pytfa.check_reaction_balance(reaction, proton=None)¶
Check the balance of a reaction, and eventually add protons to balance it
- Parameters
reaction (cobra.thermo.reaction.Reaction) – The reaction to check the balance of.
proton (cobra.thermo.metabolite.Metabolite) – Optional The proton to add to the reaction to balance it.
- Returns
The balance of the reaction :
- Return type
If
proton
is provided, this function will try to balance the equation with it, and return the result.If no
proton
is provided, this function will not try to balance the equation.Warning
This function does not verify if
proton
is in the correct compartment, so make sure you provide theproton
belonging to the correct compartment !
- pytfa.find_transported_mets(reaction)¶
Get a list of the transported metabolites of the reaction.
- Parameters
reaction (cobra.thermo.reaction.Reaction) – The reaction to get the transported metabolites of
- Returns
A dictionnary of the transported metabolites. The index corresponds to the seed_id of the transported enzyme
The value is a dictionnairy with the following values:
- coeff (
float
): The stoechiomectric coefficient of the enzyme
- coeff (
- reactant (
cobra.thermo.enzyme.Metabolite
): The reactant of the reaction corresponding to the transported enzyme
- reactant (
- product (
cobra.thermo.enzyme.Metabolite
): The product of the reaction corresponding to the transported enzyme
- product (
A transported enzyme is defined as a enzyme which is a product and a reactant of a reaction. We can distinguish them thanks to their seed_ids.
- pytfa.check_transport_reaction(reaction)¶
Check if a reaction is a transport reaction
- Parameters
reaction (cobra.thermo.reaction.Reaction) – The reaction to check
- Returns
Whether the reaction is a transport reaction or not
- Return type
A transport reaction is defined as a reaction that has the same compound as a reactant and a product. We can distinguish them thanks to their seed_ids. If they have one If not, use met_ids and check if they are the same, minus compartment
- pytfa.is_same_stoichiometry(this_reaction, that_reaction)¶
- pytfa.is_exchange(rxn)¶
- pytfa.get_reaction_compartment(reaction)¶
Get the compartment of a reaction to then prepare it for conversion.