10.1.2.1.5. freeflux.core.reaction

Define the Reaction class.

10.1.2.1.5.1. Attributes

__author__

10.1.2.1.5.2. Classes

Reaction

Define Reaction object which constitute a Model.

10.1.2.1.5.3. Module Contents

freeflux.core.reaction.__author__ = 'Chao Wu'[source]
class freeflux.core.reaction.Reaction(id, reversible=True)[source]

Define Reaction object which constitute a Model.

Duplicate substrates or products could appear in one reaction, but with different atoms.

Parameters:
  • id (str) – Reaction ID.

  • reversible (bool) – Reversibility.

id[source]

Reaction ID.

Type:

str

reversible[source]

Reversibility.

Type:

bool

substrates_info[source]

Index are substrate IDs (there could be duplicate substrates), columns are Metabolite object and its stoichiometric number.

Type:

df

products_info[source]

Index are product IDs (there could be duplicate products), columns are Metabolite object and stoichiometrc number.

Type:

df

substrates[source]

Unique substrate IDs, in order of alphabet.

Type:

list

products[source]

Unique product IDs, in order of alphabet.

Type:

list

substrates_with_atoms[source]

Unique IDs of substrates with atoms, in order of alphabet.

Type:

list

products_with_atoms[source]

Unique IDs of products with atoms, in order of alphabet.

Type:

list

_substrates_atom_mapping[source]

For example, reactants like: A({‘ab’: 0.5, ‘ba’: 0.5}) + B({‘c’: 1}) will be transformed to [{‘a’: [A, 1, 0.5], ‘b’: [A, 2, 0.5], ‘c’: [C, 1, 1]},

{‘a’: [A, 2, 0.5], ‘b’: [A, 1, 0.5], ‘a’: [C, 1, 1]}]

Type:

list of dict or None

_products_atom_mapping[source]

For example, reactants like: A({‘ab’: 0.5, ‘ba’: 0.5}) + B({‘c’: 1}) will be transformed to [{‘a’: [A, 1, 0.5], ‘b’: [A, 2, 0.5], ‘c’: [C, 1, 1]},

{‘a’: [A, 2, 0.5], ‘b’: [A, 1, 0.5], ‘a’: [C, 1, 1]}]

Type:

list of dict or None

flux(fflux and bflux for reversible reaction)

Reaction flux (forward flux and backward flux for reversible reaction).

Type:

Symbol

host_models[source]

Model hosting the reaction.

Type:

set of Model or None

id[source]
reversible = True[source]
substrates_info[source]
products_info[source]
host_models = None[source]
add_substrates(substrates, stoichiometry)[source]
Parameters:
add_products(products, stoichiometry)[source]
Parameters:
  • products (Metabolite or list of Metabolite.)

  • stoichiometry (float or list of float) – stoichiometric number(s) of corresponding product(s).

remove_substrates(substrates)[source]
Parameters:

substrates (Metabolite or list of Metabolite)

remove_products(products)[source]
Parameters:

products (Metabolite or list of Metabolite)

property substrates[source]
property products[source]
property substrates_with_atoms[source]
property products_with_atoms[source]
_atom_mapping(reactant)[source]
Parameters:

reactant (str,) – ‘substrate’ or ‘product’

Notes

Reactants like: A({‘ab’: 0.5, ‘ba’: 0.5}) + B({‘c’: 1}) will be transformed to [{‘a’: [A, 1, 0.5], ‘b’: [A, 2, 0.5], ‘c’: [C, 1, 1]},

{‘a’: [A, 2, 0.5], ‘b’: [A, 1, 0.5], ‘a’: [C, 1, 1]}].

property _substrates_atom_mapping[source]
property _products_atom_mapping[source]
_find_precursor_EMUs(emu, direction='forward')[source]
Parameters:
  • emu (EMU)

  • direction (str) –

    • For reversible reaction,

    ’forward’ if emu is product and precursor emu(s) are substrates; ‘backward’ if emu is substrate and precursor emu(s) are products. * For irreversible reaction, only ‘forward’ is acceptable.

Returns:

preEMUsInfo

Return type:

list

Notes

For reaction like: A({‘ab’: 0.5, ‘ba’: 0.5}) + B({‘c’: 1}) -> C({‘abc’: 0.5, ‘cba’: 0.5}), _find_precursor_EMUs(C12) returns [[[A_12], 0.5],

[[B_1, A_2], 0.25], [[B_1, A_1], 0.25]].

__repr__()[source]