util.misc

## Don't show: data(thermo)
thermo$obigt: 1911 aqueous, 3588 total species
## End(Don't show) ## properties of phase transitions si <- info("enstatite")
info.character: found enstatite(cr) with 2 phase transitions, also available in cr_Berman
# (dP/dT) of transitions dPdTtr(si) # first transition
[1] 384.5063
dPdTtr(si+1) # second transition
[1] 11.90108
# temperature of transitions (Ttr) as a function of P Ttr(si,P=c(1,10,100,1000))
[1] 903.0000 903.0234 903.2575 905.5981
Ttr(si,P=c(1,10,100,1000))
[1] 903.0000 903.0234 903.2575 905.5981
# calculate the GHS at Tr for the high-temperature phases of iron # using transition enthalpies from the SUPCRT92 database (sprons92.dat) Htr <- c(326.0, 215.0, 165.0) iiron <- info("iron")
info.character: found iron(cr) with 3 phase transitions
GHS_Tr(iiron, Htr)
info.numeric: Cp of iron(cr) is NA; set by EOS parameters to 5.97 info.numeric: Cp of iron(cr2) is NA; set by EOS parameters to 11.13 info.numeric: Cp of iron(cr3) is NA; set by EOS parameters to 6.39 info.numeric: Cp of iron(cr4) is NA; set by EOS parameters to 7.22 info.numeric: Cp of jadeite(cr) is NA; set by EOS parameters to 38.21 $Gf_Tr [1] -618.2369 1293.5261 979.2901 $Hf_Tr [1] -1768.418 1865.343 1252.891 $S_Tr [1] 2.662275 8.437884 7.437662
# the results calculated above are stored in the database ... info(1:3 + iiron)[, c("G", "H", "S")]
info.numeric: Cp of iron(cr2) is NA; set by EOS parameters to 11.13 info.numeric: Cp of iron(cr3) is NA; set by EOS parameters to 6.39 info.numeric: Cp of iron(cr4) is NA; set by EOS parameters to 7.22 G H S 2055 -618.237 -1768.418 2.662 2056 1293.526 1865.343 8.438 2057 979.290 1252.891 7.438
# ... meaning that we can recalculate the transition enthalpies using subcrt() sapply(info(0:2 + iiron)$T, function(T) { # a very small T increment around the transition temperature T <- convert(c(T-0.01, T), "C") # use suppressMessages to make the output less crowded substuff <- suppressMessages(subcrt("iron", T=T, P=1)) diff(substuff$out$iron$H) })
info.numeric: Cp of iron(cr) is NA; set by EOS parameters to 5.97 info.numeric: Cp of iron(cr2) is NA; set by EOS parameters to 11.13 info.numeric: Cp of iron(cr3) is NA; set by EOS parameters to 6.39 [1] 326.1088 215.1114 165.0914
## 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)))