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    metabolites_namespace,
4    constrained_rxns,
5    estimator,
6    parameters,
7    concentrations
8)

3.2.1. Metabolites namespace

PTA needs to know how to find standardized metabolite identifiers. PTA reads identifiers from the annotations in the SBML, but you need to specify which annotations you want to use. For example, for models downloaded from the BiGG database, it is common to choose the "bigg.metabolite" namespace. By default, the first annotation for each metabolite is used, but it is always recommended to specify a namespace manually to avoid inconsistencies.

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    model,
3    metabolites_namespace
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):

1import enkie
2
3parameters = enkie.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. References