3. The thermodynamic space

3.1. The quick way

The thermodynamic space of a network models metabolite and free energies for a selected set of reactions. In absence of additional information, a thermodynamic space can be constructed from a COBRApy model:

1thermodynamic_space = pta.ThermodynamicSpace.from_cobrapy_model(model)

This is a wrapper around the constructor of the :class:.:ThermodynamicSpace class, which can be used when interfacing with other modeling frameworks.

3.2. Advanced initialization

When additional information is available, one can provide a series of additional optional parameters. The parameters are explained in the following sections.

1thermodynamic_space = pta.ThermodynamicSpace.from_cobrapy_model(
2    model,
3    metabolite_interpreter,
4    constrained_rxns,
5    estimator,
6    parameters,
7    concentrations
8)

3.2.1. Metabolite interpreter

An instance of the MetaboliteInterpreter class specifying how PTA should parse metabolite identifiers. This is necessary to find the compound identifier and the compartment of the metabolite. Note that at the moment only BiGG names are supported.

3.2.2. Constrained reactions

The constrained_rxns parameter specifies which reactions in the network should be modeled in the thermodynamic space. Thermodynamic constraints should be applied only to balanced reaction, as pseudo-reactions are not thermodynamically realistic. Thus, by default, boundary reactions and biomass are excluded. Reactions can be specified as lists of indices, lists of identifiers or lists of reactions. As a starting point, we recommend building the list of constrained reactions using:

1pta.utils.get_candidate_thermodynamic_constraints(
2    FluxSpace.from_cobrapy_model(model),
3    metabolite_interpreter
4)

3.2.3. Estimator

An object used for estimating standard reaction energies. At the moment PTA only uses eQuilibrator (EquilibratorGibbsEstimator), but you are free to implement an interface for alternative estimation tools.

3.2.4. Compartment parameters

An object specifying the parameters (pH, pMg, ionic strength, electrostatic potential) of each compartment. Temperature must be constant for the entire system. You can either fill this object yourself or load one of the default ones (currently e_coli and human):

1parameters = pta.CompartmentParameters.load('e_coli')

3.2.5. Concentrations prior

ConcentrationsPrior objects specify measured or assumed distributions for the concentration of each metabolite. Since measurements are usually not available for all metabolites, PTA will use the following information, in order of preference, to determine the distribution of metabolite M in compartment C:

  1. The distribution of the concentration of M itself.

  2. A default distribution for any metabolite in C.

  3. A default distribution for any metabolite.

You can load priors from files or create your own. PTA includes priors for the extracellular concentrations in M9 (M9_aerobic, M9_anaerobic) and for the intracellular concentrations with different carbon sources (ecoli_M9_<s>, where <s> can be ac, fru, gal, glc, glcn, glyc, pyr, succ) based on 1. Different can also be combined. In case of conflict, the added prior overwrites distributions of the original prior.

 1# Load the prior for metabolite concentrations in M9 media.
 2concentrations = pta.ConcentrationsPrior.load('M9_aerobic')
 3
 4# Add the prior for intracellular concentrations when growing on succinate.
 5concentrations.add(pta.ConcentrationsPrior.load('ecoli_M9_succ'))
 6
 7# Manually add a distribution. Note that we must use log-normal distributions.
 8import numpy as np
 9concentrations.metabolite_distributions[('bigg.metabolite:g3p', 'c')] = \
10    pta.LogNormalDistribution(log_mean=np.log(1e-4), log_std=0.2)
11
12# Updating identifiers after a modification is recommended to make sure that we can
13properly recognize identifiers from different namespaces.
14concentrations.update_identifiers()
15
16# Save your newly created prior for later use.
17concentrations.save('my_prior.csv')

3.3. Thermodynamic space basis

Because of correlation existing within and between metabolite concentrations, standard reaction energies and reaction energies, the dimensionality of the thermodynamic space is usually lower than the number of variables. One can easily obtain a full-dimensional representation that can be used for PMO and TFS:

1basis = pta.ThermodynamicSpaceBasis(thermodynamic_space)

This class contains a mapping between a full dimensional basis and the variables of the thermodynamic space. Variables of the basis are referred to as m in 2.

3.4. Performance considerations

Many of the functions above rely on eQuilibrator’s CompoundCache to identify compounds from different namespaces. Initializing this object takes several seconds, thus we recommend creating it once (either using pta.EquilibratorGibbsEstimator.eq_api.ccache or creating it with equilibrator_api.create_compound_cache_from_zenodo()) and passing it to the methods or classes using it (e.g. get_candidate_thermodynamic_constraints, ThermodynamicSpace, ConcentrationsPrior).

3.5. References

1

Luca Gerosa, Bart RB Haverkorn van Rijsewijk, Dimitris Christodoulou, Karl Kochanowski, Thomas SB Schmidt, Elad Noor, and Uwe Sauer. Pseudo-transition analysis identifies the key regulators of dynamic metabolic adaptations from steady-state data. Cell systems, 1(4):270–282, 2015.

2

Mattia G Gollub, Hans-Michael Kaltenbach, and Jörg Stelling. Probabilistic thermodynamic analysis of metabolic networks. Bioinformatics, 37(18):2938–2945, 2021.