next up previous
Next: util.matrix Up: CHNOSZ examples Previous: util.fasta

util.formula

## Don't show: data(thermo)
thermo$obigt: 1809 aqueous, 3368 total species
## End(Don't show) ## mass and entropy from chemical formulas mass("H2O")
[1] 18.01528
entropy("H2O")
[1] 55.74952
mass("-1") # electron
[1] 0
entropy("-1")
[1] 15.61663
## three ways to get the formula of alanine iA <- info("alanine")
info.character: found alanine(aq), also available in cr
info(iA)$formula
[1] "C3H7NO2"
as.chemical.formula(makeup(iA))
[1] "C3H7NO2"
get.formula(iA)
[1] "C3H7NO2"
## converting among Gibbs energy, enthalpy, entropy # calculate the value of G from H and S GHS("H2O", H=water("H"), S=water("S"))[1, ]
$G H 1 -56678.22 $H H 1 -68317.14 $S S 1 16.71239
# that not quite equal to the value from water("G"); # probably using different entropies of the elements ## average oxidation states of carbon stopifnot(ZC("CO2") == 4) stopifnot(ZC("CH4") == -4) stopifnot(ZC("CHNOSZ") == 7) si <- info(info("LYSC_CHICK"))
aa2eos: found LYSC_CHICK (C613H959N193O185S10, 129 residues) checkGHS: G of LYSC_CHICK aq (3369) differs by 268 cal mol-1 from tabulated value
stopifnot(si$formula == "C613H959N193O185S10") stopifnot(all.equal(ZC(si$formula), 0.0163132130131)) ## calculate the chemical formulas, then ## ZC of all of the proteins in CHNOSZ' database pf <- protein.formula(thermo$protein) range(mass(pf))
[1] 18.01528 550310.65548
# use na.rm=TRUE because we have a "protein" with a formula of H2O range(ZC(pf), na.rm=TRUE)
[1] -1 1


next up previous
Next: util.matrix Up: CHNOSZ examples Previous: util.fasta