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(S: pandas.DataFrame, compound_dict: Dict[str, equilibrator_cache.Compound], reaction_dict: Dict[str, equilibrator_cache.Reaction], comp_contrib: equilibrator_api.ComponentContribution | None = None, standard_dg_primes: equilibrator_api.Q_ | None = None, dg_sigma: equilibrator_api.Q_ | None = None, bounds: equilibrator_api.model.Bounds | None = None, config_dict: Dict[str, str] | None = None)[source]

Bases: object

A basic stoichiometric model with thermodynamics.

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

property compound_ids: Iterable[str][source]

Get the list of compound IDs.

property compounds: Iterable[equilibrator_cache.Compound][source]

Get the list of Compound objects.

property compound_df: pandas.DataFrame[source]

Get a DataFrame with all the compound data.

The columns are:

compound_id lower_bound upper_bound

property reaction_ids: Iterable[str][source]

Get the list of reaction IDs.

property reactions: Iterable[equilibrator_cache.Reaction][source]

Get the list of Reaction objects.

property reaction_formulas: Iterable[str][source]

Iterate through all the reaction formulas.

Returns:

the reaction formulas

property reaction_df: pandas.DataFrame[source]

Get a DataFrame with all the reaction data.

The columns are:

reaction_id reaction_formula standard_dg_prime

property bounds: 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.

Return type:

tuple of (lower bounds, upper bounds)

property bound_df: pandas.DataFrame[source]

Get a DataFrame with all the bounds data.

property ln_conc_lb: numpy.array[source]

Get the log lower bounds on the concentrations.

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

Return type:

a NumPy array of the log lower bounds

property ln_conc_ub: numpy.ndarray[source]

Get the log upper bounds on the concentrations.

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

Return type:

a NumPy array of the log upper bounds

property ln_conc_mu: numpy.array[source]

Get mean of log concentration distribution based on the bounds.

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

Return type:

a NumPy array with the mean of the log concentrations

property ln_conc_sigma: numpy.array[source]

Get stdev of log concentration distribution based on the bounds.

Return type:

a NumPy array with the stdev of the log concentrations

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

Configure the Component Contribution aqueous conditions.

update_standard_dgs() None[source]

Calculate the standard ΔG’ values and uncertainties.

Use the Component Contribution method.

set_bounds(cid: str, lb: equilibrator_api.Q_ | None = None, ub: equilibrator_api.Q_ | None = 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(cid: 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)

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

Return type:

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

classmethod from_network_sbtab(filename: str | equilibrator_api.model.SBtabDocument, comp_contrib: equilibrator_api.ComponentContribution | None = None, freetext: bool = True, bounds: equilibrator_api.model.Bounds | None = None) StoichiometricModel[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)

Return type:

a Pathway object

classmethod from_sbtab(filename: str | equilibrator_api.model.SBtabDocument, comp_contrib: equilibrator_api.ComponentContribution | None = 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() equilibrator_api.model.SBtabDocument[source]

Export the model to an SBtabDocument.

write_sbtab(filename: str) None[source]

Write the pathway to an SBtab file.