equilibrate
calculates the chemical activities of species in metastable equilibrium, for constant temperature, pressure and chemical activities of basis species, using specified balancing constraints on reactions between species.
It takes as input aout
, the output from affinity
, which may be calculated from a multidimensional grid of conditions.
The equilibrium chemical activities of species are calculated using either the equil.reaction
or equil.boltzmann
functions, the latter only if the balance is on one mole of species.
aout
contains the chemical affinities of formation reactions of each species of interest.
equilibrate
needs to be provided constraints on how to balance the reactions representing transformations between the species.
balance
indicates the balancing constraints, according to the following scheme:
NULL: autoselect
name of basis species: balance on this basis species
length: balance on length of proteins
1: balance on one mole of species
numeric vector: user-defined constraints
The default value of NULL for balance
indicates to use the coefficients on the basis species that is present (i.e. with non-zero coefficients) in all formation reactions, or if that fails, to set the balance to 1.
However, if all the species (as listed in code aout$species
) are proteins (have an underscore character in their names), the default value of NULL for balance
indicates to use length as the balance.
NOTE: The summation of activities assumes an ideal system, so ‘molality’ is equivalent to ‘activity’ here.
loga.balance
gives the logarithm of the total activity of balance
(which is total activity of species for 1 or total activity of amino acid residue-equivalents for length).
If loga.balance
is missing, its value is taken from the activities of species listed in aout
; this default is usually the desired operation.
normalize
if TRUE indicates to normalize the molar formulas of species by the balance coefficients.
This operation is intended for systems of proteins, whose conventional formulas are much larger than the basis speices.
The normalization also applies to the balancing coefficients, which as a result consist of 1s.
After normalization and equilibration, the equilibrium activities are then re-scaled (for the original formulas of the species), unless as.residue
is TRUE.
equil.boltzmann
is used to calculate the equilibrium activities if balance
is 1 (or when normalize
or as.residue
is TRUE), otherwise equil.reaction
is called.
The default behavior can be overriden by specifying either boltzmann or reaction in method
.
Using equil.reaction
may be needed for systems with huge (negative or positive) affinities, where equil.boltzmann
produces a NaN result.
ispecies
can be supplied to identify a subset of the species to include in the calculation.