7.1.2.7. pta.thermodynamic_space
Description of the space of thermodynamics-related quantities of a metabolic network.
7.1.2.7.1. Module Contents
- class pta.thermodynamic_space.ThermodynamicSpace(S_constraints: numpy.ndarray, reaction_ids: List[str], metabolites: List[enkie.Metabolite], parameters: enkie.CompartmentParameters = None, concentrations: pta.concentrations_prior.ConcentrationsPrior = None, estimator: enkie.estimators.GibbsEstimatorInterface = None, dfg0_estimate: Optional[Tuple[pta.commons.Q, pta.commons.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: pta.commons.Q[source]
Gets the mean of the corrected standard formation energies.
- property dfg0_prime_cov: pta.commons.Q[source]
Gets the covariance of the corrected standard formation energies.
- property dfg0_prime_cov_sqrt: pta.commons.Q[source]
Gets a square root of the covariance of the corrected standard formation energies.
- property drg0_prime_mean: pta.commons.Q[source]
Gets the mean of the corrected standard reaction energies.
- property drg0_prime_cov: pta.commons.Q[source]
Gets the covariance of the corrected standard reaction energies.
- property drg0_prime_cov_sqrt: pta.commons.Q[source]
Gets a square root of the covariance of the corrected standard reaction energies.
- property parameters: enkie.CompartmentParameters[source]
Gets the compartment parameters of the system.
- property metabolites: List[enkie.Metabolite][source]
Gets the list of metabolites in the thermodynamic space.
- property S_constraints: numpy.ndarray[source]
Gets stoichiometric matrix of the reactions with thermodynamic constraints.
- property metabolite_ids: List[str][source]
Gets the IDs of the metabolites in the thermodynamic space.
- property reaction_ids: List[str][source]
Gets the IDs of the reactions with thermodynamic constraints.
- subspace(reaction_ids: Set[str], metabolite_ids: Set[str]) ThermodynamicSpace[source]
- static from_cobrapy_model(model: cobra.Model, metabolites_namespace: str = None, constrained_rxns: Union[List[int], List[str], cobra.DictList] = None, estimator: enkie.estimators.GibbsEstimatorInterface = None, parameters: enkie.CompartmentParameters = None, concentrations: pta.concentrations_prior.ConcentrationsPrior = None, dfg0_estimate: Optional[Tuple[pta.commons.Q, pta.commons.Q]] = None) ThermodynamicSpace[source]
Constructs a thermodynamic space from a cobrapy model.
- Parameters:
model (cobra.Model) – Cobra model describing the metabolic network.
metabolites_namespace (str, optional) – Specifies the name to use when reading metabolite identifiers from the SBML model annotations.
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 explicitly in the basis, false otherwise. By default True.
explicit_drg0 (bool, optional) – True if standard reaction energies should be represented explicitly in the basis, false otherwise. By default True.
explicit_drg (bool, optional) – True if reaction energies should be represented explicitly 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: Optional[Tuple[numpy.ndarray, numpy.ndarray]][source]
Gets the transformation from this space to log-concentrations.
Noneif concentrations are not represented explicitly.
- property to_drg0_transform: Optional[Tuple[numpy.ndarray, numpy.ndarray]][source]
Gets the transformation from this space to DrG’°.
Noneif standard reaction energies are not represented explicitly.
- property to_drg_transform: Optional[Tuple[numpy.ndarray, numpy.ndarray]][source]
Gets the transformation from this space to DrG’.
Noneif reaction energies are not represented explicitly.
- property to_observables_transform: Tuple[numpy.ndarray, numpy.ndarray][source]
Gets the transformation from this space to the selected observables.
- property observables_ranges: Dict[str, List[int]][source]
The ranges of the different variables in a vector of observables.
- property sigmas: numpy.ndarray[source]
Gets a vector containing the standard deviation of each variable in the minimal basis.
- to_log_conc(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 explicitly.- Return type:
np.ndarray
- to_drg0(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 explicitly.- Return type:
np.ndarray
- to_drg(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 explicitly.- Return type:
np.ndarray