# Functions for Miscellaneous Tasks

### Description

Calculate *dP/dT* and temperature of phase transitions, calculate heat capacities of unfolded proteins using an equation from the literature, calculate non-ideal contributions to apparent standard molal properties, identify a conserved basis species, scale logarithms of activity to a desired total activity, calculate Gibbs energy of transformation of a system.

### Usage

1 2 3 4 |

### Arguments

`x` |
numeric index of a mineral phase ( |

`P` |
numeric, pressure (bar) |

`dPdT` |
numeric, values of ( |

`species` |
dataframe, species definition such as that in |

`logact` |
numeric, logarithms of activity |

`length` |
numeric, numbers of residues |

`logact.tot` |
numeric, logarithm of total activity |

### Details

`dPdTtr`

returns values of *(dP/dT)Ttr*, where *Ttr* represents the transition temperature, of the phase transition at the high-*T* stability limit of the `x`

th species in `thermo$obigt`

(no checking is done to verify that the species represents in fact one phase of a mineral with phase transitions). `dPdTtr`

takes account of the Clapeyron equation, *(dP/dT)Ttr*=*DS/DV*, where *DS* and *DV* represent the changes in entropy and volume of phase transition, and are calculated using `subcrt`

at Ttr from the standard molal entropies and volumes of the two phases involved. Using values of `dPdT`

calculated using `dPdTtr`

or supplied in the arguments, `Ttr`

returns as a function of `P`

values of the upper transition temperature of the mineral phase represented by the `x`

th species.

`nonideal`

takes a list of dataframes (in `proptable`

) containing the standard molal properties of the identified `species`

.
The function bypasses (leaves unchanged) properties of the proton (H+), electron (e-), and all species whose charge (determined by the number of Z in their `makeup`

) is equal to zero.
The values of `IS`

are combined with Alberty's (2003) equation 3.6-1 (Debye-Huckel equation) and its derivatives, to calculate apparent molal properties at the specified ionic strength(s) and temperature(s).
The lengths of `IS`

and `T`

supplied in the arguments should be equal to the number of rows of each dataframe in `proptable`

, or one to use single values throughout.
The apparent molal properties that can be calculated include `G`

, `H`

, `S`

and `Cp`

; any columns in the dataframes of `proptable`

with other names are left untouched.
A column named `loggam`

(logarithm of gamma, the activity coefficient) is appended to the output dataframe of species properties.

`which.balance`

returns, in order, which column(s) of `species`

all have non-zero values. It is used by `diagram`

and `transfer`

to determine a conservant (i.e. basis species that are conserved in transformation reactions) if none is supplied by the user.

`spearman`

calculates Spearman's rank correlation coefficient for `a`

and `b`

.

`unitize`

scales the logarithms of activities given in `logact`

so that the logarithm of total activity of residues is equal to zero (i.e. total activity of residues is one), or to some other value set in `logact.tot`

. `length`

indicates the number of residues in each species. If `logact`

is NULL, the function takes the logarithms of activities from the current species definition. If any of those species are proteins, the function gets their lengths using `protein.length`

.

### Value

Numeric returns are made by `dPdTtr`

, `Ttr`

, `spearman`

, `mod.obigt`

Functions with no (or unspecified) returns are `thermo.plot.new`

, `thermo.postscript`

, `label.plot`

and `water.lines`

.

### References

Alberty, R. A. (2003) *Thermodynamics of Biochemical Reactions*, John Wiley & Sons, Hoboken, New Jersey, 397 p. http://www.worldcat.org/oclc/51242181

### See Also

For some of the functions on which these utilities depend or were modeled, see `paste`

, `substr`

, `tolower`

, `par`

and `text`

.

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ```
## properties of phase transitions
si <- info("enstatite")
# (dP/dT) of transitions
dPdTtr(si) # first transition
dPdTtr(si+1) # second transition
# temperature of transitions (Ttr) as a function of P
Ttr(si,P=c(1,10,100,1000))
Ttr(si,P=c(1,10,100,1000))
## scale logarithms of activity
# suppose we have two proteins whose lengths are 100 and
# 200; what are the logarithms of activity of the proteins
# that are equal to each other and that give a total
# activity of residues equal to unity?
logact <- c(-3,-3) # could be any two equal numbers
length <- c(100,200)
logact.tot <- 0
loga <- unitize(logact,length,logact.tot)
# the proteins have equal activity
stopifnot(identical(loga[1],loga[2]))
# the sum of activity of the residues is unity
stopifnot(isTRUE(all.equal(sum(10^loga * length),1)))
## now, what if the activity of protein 2 is ten
## times that of protein 1?
logact <- c(-3,-2)
loga <- unitize(logact,length,logact.tot)
# the proteins have unequal activity
stopifnot(isTRUE(all.equal(loga[2]-loga[1],1)))
# but the activities of residues still add up to one
stopifnot(isTRUE(all.equal(sum(10^loga * length),1)))
``` |