6.1.2.4. equilibrator_api.phased_reaction

inherit from equilibrator_cache.reaction.Reaction an add phases.

6.1.2.4.1. Module Contents

class equilibrator_api.phased_reaction.PhasedReaction(sparse: Dict[equilibrator_cache.Compound, float], arrow: str = '<=>', rid: str = None, sparse_with_phases: Dict[equilibrator_api.phased_compound.PhasedCompound, float] = None)[source]

Bases: equilibrator_cache.Reaction

A daughter class of Reaction that adds phases and abundances.

REACTION_COUNTER = 0[source]
clone(self) PhasedReaction[source]

Clone this reaction object.

reverse(self) PhasedReaction[source]

Return a PhasedReaction with the reverse reaction.

get_element_data_frame(self) pandas.DataFrame[source]

Tabulate the elemental composition of all reactants.

Returns

A data frame where the columns are the compounds and the indexes are atomic elements.

Return type

DataFrame

hash_md5(self, reversible: bool = True) str[source]

Return a MD5 hash of the PhasedReaction.

This hash is useful for finding reactions with the exact same stoichiometry. We create a unique formula string based on the Compound IDs and coefficients.

Parameters

reversible (bool) – a flag indicating whether the directionality of the reaction matters or not. if True, the same value will be returned for both the forward and backward versions.

Returns

hash – a unique hash string representing the Reaction.

Return type

str

set_abundance(self, compound: equilibrator_cache.Compound, abundance: equilibrator_api.ureg.Quantity)[source]

Set the abundance of the compound.

reset_abundances(self)[source]

Reset the abundance to standard levels.

set_phase(self, compound: equilibrator_cache.Compound, phase: str)[source]

Set the phase of the compound.

get_phased_compound(self, compound: equilibrator_cache.Compound) Tuple[equilibrator_api.phased_compound.PhasedCompound, float][source]

Get the PhasedCompound object by the Compound object.

get_phase(self, compound: equilibrator_cache.Compound) str[source]

Get the phase of the compound.

get_abundance(self, compound: equilibrator_cache.Compound) equilibrator_api.ureg.Quantity[source]

Get the abundance of the compound.

property is_physiological(self) bool[source]

Check if all concentrations are physiological.

This function is used by eQuilibrator to know if to present the adjusted dG’ or not (since the physiological dG’ is always displayed and it would be redundant).

Returns

True if all compounds are at physiological abundances.

get_stoichiometry(self, compound: equilibrator_cache.Compound) float[source]

Get the abundance of the compound.

add_stoichiometry(self, compound: equilibrator_cache.Compound, coeff: float) None[source]

Add to the stoichiometric coefficient of a compound.

If this compound is not already in the reaction, add it.

separate_stored_dg_prime(self, p_h: equilibrator_api.ureg.Quantity, ionic_strength: equilibrator_api.ureg.Quantity, temperature: equilibrator_api.ureg.Quantity, p_mg: equilibrator_api.ureg.Quantity) Tuple[equilibrator_cache.Reaction, equilibrator_api.ureg.Quantity][source]

Split the PhasedReaction to aqueous phase and all the rest.

Parameters
  • p_h

  • ionic_strength

  • temperature

  • p_mg

Returns

a tuple (residual_reaction, stored_dg_prime) where

residual_reaction is a Reaction object (excluding the compounds that had stored values), and stored_dg_prime is the total dG’ of the compounds with stored values (in kJ/mol).

separate_stored_dg(self) Tuple[equilibrator_cache.Reaction, equilibrator_api.ureg.Quantity][source]

Split the PhasedReaction to aqueous phase and all the rest.

Returns

a tuple (residual_reaction, stored_dg) where

residual_reaction is a Reaction object (excluding the compounds that had stored values), and stored_dg is the total dG of the compounds with stored values (in kJ/mol).

dg_correction(self) equilibrator_api.ureg.Quantity[source]

Calculate the concentration adjustment in the dG’ of reaction.

Returns

the correction for delta G in units of RT

physiological_dg_correction(self) equilibrator_api.ureg.Quantity[source]

Calculate the concentration adjustment in the dG’ of reaction.

Assuming all reactants are in the default physiological concentrations (i.e. 1 mM)

Returns

the correction for delta G in units of RT

serialize(self) List[dict][source]

Return a serialized version of all the reaction thermo data.