7.1.2.11. pta.thermodynamic_space
Description of the space of thermodynamics-related quantities of a metabolic network.
7.1.2.11.1. Module Contents
- class pta.thermodynamic_space.ThermodynamicSpace(S_constraints: numpy.ndarray, reaction_ids: List[str], metabolites: List[pta.metabolite.Metabolite], metabolite_ids: List[str] = None, parameters: pta.compartment_parameters.CompartmentParameters = None, concentrations: pta.concentrations_prior.ConcentrationsPrior = None, estimator: pta.gibbs_estimators.GibbsEstimatorInterface = None, dfg0_estimate: Optional[Tuple[pta.constants.Q, pta.constants.Q]] = None)[source]
Construction, description and manipulation of the thermodynamic space of a metabolic network.
- Parameters
S_constraints (np.ndarray) – Stoichiometric matrix of the reactions covered by thermodynamic constraints.
reaction_ids (List[str]) – Identifiers of the reactions covered by thermodynamic constraints.
metabolites (List[Metabolite]) – List describing the metabolites in the network.
parameters (CompartmentParameters, optional) – The physiological parameters (pH, ionic strength, …) of each compartment.
concentrations (ConcentrationsPrior, optional) – Prior distributions for the metabolite concentrations.
estimator (GibbsEstimatorInterface, optional) – Object used to estimate Gibbs free energies.
dfg0_estimate (Optional[Tuple[Q, Q]], optional) – Estimate of formation energies (mean and a square root of the covariance matrix) in case the user wants to specify them manually. This is only used if
estimatorisNone.
- property dfg0_prime_mean(self) pta.constants.Q[source]
Gets the mean of the corrected standard formation energies.
- property dfg0_prime_cov(self) pta.constants.Q[source]
Gets the covariance of the corrected standard formation energies.
- property dfg0_prime_cov_sqrt(self) pta.constants.Q[source]
Gets a square root of the covariance of the corrected standard formation energies.
- property drg0_prime_mean(self) pta.constants.Q[source]
Gets the mean of the corrected standard reaction energies.
- property drg0_prime_cov(self) pta.constants.Q[source]
Gets the covariance of the corrected standard reaction energies.
- property drg0_prime_cov_sqrt(self) pta.constants.Q[source]
Gets a square root of the covariance of the corrected standard reaction energies.
- property parameters(self) pta.compartment_parameters.CompartmentParameters[source]
Gets the compartment parameters of the system.
- property metabolites(self) List[pta.metabolite.Metabolite][source]
Gets the list of metabolites in the thermodynamic space.
- property S_constraints(self) numpy.ndarray[source]
Gets stoichiometric matrix of the reactions with thermodynamic constraints.
- static from_cobrapy_model(model: cobra.Model, metabolite_interpreter: pta.metabolite_interpreter.MetaboliteInterpreter = None, constrained_rxns: Union[List[int], List[str], cobra.DictList] = None, estimator: pta.gibbs_estimators.GibbsEstimatorInterface = None, parameters: pta.compartment_parameters.CompartmentParameters = None, concentrations: pta.concentrations_prior.ConcentrationsPrior = None) ThermodynamicSpace[source]
Constructs a thermodynamic space from a cobrapy model.
- Parameters
model (cobra.Model) – Cobra model describing the metabolic network.
metabolite_interpreter (MetaboliteInterpreter, optional) – Specifies how to parse metabolite IDs to extract the metabolite and compartment identifiers.
constrained_rxns (Union[List[int], List[str], cobra.DictList], optional) – The reactions that should be modeled with thermodynamic constraints. Usually this list should contain all reactions except biomass and boundary reactions. The list can contain either the reactions themselves, their indices or they identifiers.
estimator (GibbsEstimatorInterface, optional) – Object used to estimate Gibbs free energies.
parameters (CompartmentParameters, optional) – The physiological parameters (pH, ionic strength, …) of each compartment.
concentrations (ConcentrationsPrior, optional) – Prior distributions for the metabolite concentrations.
- Returns
The thermodynamic space for the specified model.
- Return type
- class pta.thermodynamic_space.ThermodynamicSpaceBasis(thermodynamic_space: ThermodynamicSpace, explicit_log_conc: bool = True, explicit_drg0: bool = True, explicit_drg: bool = True, min_eigenvalue: float = default_min_eigenvalue_tds_basis)[source]
Full-dimensional basis of the thermodynamic space. It is possible to make only selected variables explicit in the basis, reducing its dimensionality.
- Parameters
thermodynamic_space (ThermodynamicSpace) – The target thermodynamic space.
explicit_log_conc (bool, optional) – True if log-concentrations should be represented explicitely in the basis, false otherwise. By default True.
explicit_drg0 (bool, optional) – True if standard reaction energies should be represented explicitely in the basis, false otherwise. By default True.
explicit_drg (bool, optional) – True if reaction energies should be represented explicitely in the basis, false otherwise. By default True.
min_eigenvalue (float, optional) – Minimum eigenvalue of for a vector to be part of the basis.
- property to_log_conc_transform(self) Optional[Tuple[numpy.ndarray, numpy.ndarray]][source]
Gets the transformation from this space to log-concentrations.
Noneif concentrations are not represented explicitely.
- property to_drg0_transform(self) Optional[Tuple[numpy.ndarray, numpy.ndarray]][source]
Gets the transformation from this space to DrG’°.
Noneif standard reaction energies are not represented explicitely.
- property to_drg_transform(self) Optional[Tuple[numpy.ndarray, numpy.ndarray]][source]
Gets the transformation from this space to DrG’.
Noneif reaction energies are not represented explicitely.
- property to_observables_transform(self) Tuple[numpy.ndarray, numpy.ndarray][source]
Gets the transformation from this space to the selected observables.
- property observables_ranges(self) Dict[str, List[int]][source]
The ranges of the different variables in a vector of observables.
- property sigmas(self) numpy.ndarray[source]
Gets a vector containing the standard deviation of each variable in the minimal basis.
- to_log_conc(self, basis_vars: numpy.ndarray) numpy.ndarray[source]
Transform a vector or matrix in the basis to a vector or matrix of log-concentrations.
- Parameters
basis_vars (np.ndarray) – The input vector or matrix.
- Returns
The transformed vector or matrix.
Noneif concentrations are not represented explicitely.- Return type
np.ndarray
- to_drg0(self, basis_vars: numpy.ndarray) numpy.ndarray[source]
Transform a vector or matrix in the basis to a vector or matrix of standard reaction energies.
- Parameters
basis_vars (np.ndarray) – The input vector or matrix.
- Returns
The transformed vector or matrix.
Noneif standard reaction energies are not represented explicitely.- Return type
np.ndarray
- to_drg(self, basis_vars: numpy.ndarray) numpy.ndarray[source]
Transform a vector or matrix in the basis to a vector or matrix of reaction energies.
- Parameters
basis_vars (np.ndarray) – The input vector or matrix.
- Returns
The transformed vector or matrix.
Noneif reaction energies are not represented explicitely.- Return type
np.ndarray