6.1.1.2.1.2. equilibrator_api.model.model

a basic stoichiometric model with thermodynamics.

6.1.1.2.1.2.1. Module Contents

class equilibrator_api.model.model.StoichiometricModel(reactions: List[equilibrator_api.Reaction], comp_contrib: Optional[equilibrator_api.ComponentContribution] = None, standard_dg_primes: Optional[equilibrator_api.Q_] = None, dg_sigma: Optional[equilibrator_api.Q_] = None, bounds: Optional[equilibrator_api.model.Bounds] = None, config_dict: Optional[Dict[str, str]] = None, compound_id_mapping: Callable[[equilibrator_cache.Compound], str] = None)[source]

Bases: object

A basic stoichiometric model with thermodynamics.

Designed as a base model for ‘Pathway’ which also includes flux directions and magnitudes.

MINIMAL_STDEV = 0.001[source]
configure(self) None[source]

Configure the Component Contribution aqueous conditions.

update_standard_dgs(self) None[source]

Calculate the standard ΔG’ values and uncertainties.

Use the Component Contribution method.

set_compound_ids(self, mapping: Callable[[equilibrator_cache.Compound], str] = None) None[source]

Use alternative compound names for outputs such as plots.

Parameters

mapping (callable, optional) – a function mapping compounds to their names in the model

set_bounds(self, compound_id: str, lb: Optional[equilibrator_api.Q_] = None, ub: Optional[equilibrator_api.Q_] = None) None[source]

Set the lower and upper bound of a compound.

Parameters
  • compound_id (str) – the compound ID

  • lb (Quantity, optional) – the new concentration lower bound (ignored if the value is None)

  • ub (Quantity, optional) – the new concentration upper bound (ignored if the value is None)

get_bounds(self, compound_id: str) Tuple[equilibrator_api.Q_, equilibrator_api.Q_][source]

Get the lower and upper bound of a compound.

Parameters

compound_id (str) – the compound ID

Returns

  • lb (Quantity, optional) – the new concentration lower bound (ignored if the value is None)

  • ub (Quantity, optional) – the new concentration upper bound (ignored if the value is None)

property bounds(self) Tuple[Iterable[equilibrator_api.Q_], Iterable[equilibrator_api.Q_]][source]

Get the concentration bounds.

The order of compounds is according to the stoichiometric matrix index.

Returns

Return type

tuple of (lower bounds, upper bounds)

property ln_conc_lb(self) numpy.array[source]

Get the log lower bounds on the concentrations.

The order of compounds is according to the stoichiometric matrix index.

Returns

Return type

a NumPy array of the log lower bounds

property ln_conc_ub(self) numpy.ndarray[source]

Get the log upper bounds on the concentrations.

The order of compounds is according to the stoichiometric matrix index.

Returns

Return type

a NumPy array of the log upper bounds

property ln_conc_mu(self) numpy.array[source]

Get the mean of the log concentration distribution based on the bounds.

The order of compounds is according to the stoichiometric matrix index.

Returns

Return type

a NumPy array with the mean of the log concentrations

property ln_conc_sigma(self) numpy.array[source]

Get the stdev of the log concentration distribution based on the bounds.

Returns

Return type

a NumPy array with the stdev of the log concentrations

static get_compounds(reactions: Iterable[equilibrator_api.Reaction]) List[equilibrator_cache.Compound][source]

Get a unique list of all compounds in all reactions.

Parameters

reactions – an iterator of reactions

Returns

a list of unique compounds

property reaction_ids(self) Iterable[str][source]

Iterate through all the reaction IDs.

Returns

the reaction IDs

property reaction_formulas(self) Iterable[str][source]

Iterate through all the reaction formulas.

Returns

the reaction formulas

static read_thermodynamics(thermo_sbtab: equilibrator_api.model.SBtabTable, config_dict: Dict[str, str]) Dict[str, equilibrator_api.Q_][source]

Read the ‘thermodynamics’ table from an SBtab.

Parameters
  • thermo_sbtab (SBtabTable) – A SBtabTable containing the thermodynamic data

  • config_dict (dict) – A dictionary containing the configuration arguments

Returns

Return type

A dictionary mapping reaction IDs to standard ΔG’ values.

classmethod from_network_sbtab(cls, filename: Union[str, equilibrator_api.model.SBtabDocument], comp_contrib: Optional[equilibrator_api.ComponentContribution] = None, freetext: bool = True, bounds: Optional[equilibrator_api.model.Bounds] = None) object[source]

Initialize a Pathway object using a ‘network’-only SBtab.

Parameters
  • filename (str, SBtabDocument) – a filename containing an SBtabDocument (or the SBtabDocument object itself) defining the network (topology) only

  • comp_contrib (ComponentContribution, optional) – a ComponentContribution object needed for parsing and searching the reactions. also used to set the aqueous parameters (pH, I, etc.)

  • freetext (bool, optional) – a flag indicating whether the reactions are given as free-text (i.e. common names for compounds) or by standard database accessions (Default value: True)

  • bounds (Bounds, optional) – bounds on metabolite concentrations (by default uses the “data/cofactors.csv” file in equilibrator-api)

Returns

Return type

a Pathway object

classmethod from_sbtab(cls, filename: Union[str, equilibrator_api.model.SBtabDocument], comp_contrib: Optional[equilibrator_api.ComponentContribution] = None) StoichiometricModel[source]

Parse and SBtabDocument and return a StoichiometricModel.

Parameters
  • filename (str or SBtabDocument) – a filename containing an SBtabDocument (or the SBtabDocument object itself) defining the pathway

  • comp_contrib (ComponentContribution, optional) – a ComponentContribution object needed for parsing and searching the reactions. also used to set the aqueous parameters (pH, I, etc.)

Returns

stoich_model – A StoichiometricModel object based on the configuration SBtab

Return type

StoichiometricModel

to_sbtab(self) equilibrator_api.model.SBtabDocument[source]

Export the model to an SBtabDocument.

write_sbtab(self, filename: str) None[source]

Write the pathway to an SBtab file.