CHNOSZ {CHNOSZ} | R Documentation |
CHNOSZ is a software package for calculating the standard molal thermodynamic properties and chemical affinities of reactions in geobiochemical systems and for visualizing the equilibrium activities of species on chemical speciation and predominance diagrams.
The functions in CHNOSZ perform three primary tasks: 1) calculation of the standard molal Gibbs energies and other thermodynamic properties of species and reactions. 2) calculation of the activity products of formation reactions of the species of interest from the basis species. The basis species stand for the descriptive compositional variables, i.e. perfectly mobile components (Korzhinskii, 1965). 3) combination of the results of (1) and (2) to generate diagrams showing the equilibrium distributions of species as a function of temperature, pressure, and chemical activities or fugacities of the basis species (which may include pH and Eh if the proton and electron are in the basis).
Here is some help on getting started with CHNOSZ:
library(CHNOSZ)
at the command line (or select the name of the package from the GUI menu).
examples()
to run all the examples provided in CHNOSZ
. This takes about ten minutes depending on your system. Expect to get four warning messages when the examples are finished (or more if you don't have some other package required by the examples).
thermo
, which is added into the global namespace when you load the package. Running the examples or operating some of the functions may cause changes to this object; and correct operation of some of the examples demands that thermo
is in its original state. The command data(thermo)
is your friend, as it causes the program to reload the data object, effectively forgetting any changes made to it.
thermo
.
help.start()
(or choose R help in the GUI) to launch a browser, and select Packages then CHNOSZ. You can copy the text of individual examples from the browser window into the command line interface. The documentation topics are arranged alphabetically; to read them in a more logical order, use this sequence (identical to the order of the examples
): CHNOSZ
, thermo
, utilities
, info
, eos
, water
, subcrt
, nuts
, makeup
, basis
, species
, affinity
, diagram
, buffer
, protein
, ionize
, get.protein
, revisit
, transfer
, eqdata
.
dontrun
tag. The user can experiment with dontrun
examples by pasting the code to the command line interface.
CHNOSZ depends on R version 2.7.0 or greater. The reason for this dependency is that some of the examples that create plots cause errors in earlier versions of R on Linux (there was a major update to the X11 device in 2.7.0). Except for that issue, CHNOSZ can run on R versions 2.4.0 or greater. The reason for the latter dependency is availability of the stringsAsFactors argument to data.frame
. In some functions in this package, stringsAsFactors is set to FALSE to facilitate manipulating the thermo$obigt
and thermo$protein
objects.
As this package develops around the papers that support and use it, some errors and omissions in these papers have become apparent. The values of a2 and a4 for [-CH2NH2] were inadvertently set to zero in Table 6 of Dick et al., 2006. The correct values for these parameters are contained in the thermodynamic database distributed with CHNOSZ. There is a plotting error in Dick, 2009 that caused the colors of the points in Figs. 5 and 6 of that paper to be incorrectly assigned. This error is addressed in one of the examples for get.protein
. These errors are relatively minor and do not change the conclusions of the respective papers.
Work on this project at U.C. Berkeley (through 2008) was supported by research grants from the U.S. National Science Foundation and Department of Energy. Professor Harold C. Helgeson (d. May 2007) was principal investigator on these grants and my research advisor during the initial stages of development of this software. Effective in 2009: This material is based upon work supported by the National Science Foundation under grant EAR-0847616 (http://www.nsf.gov/awardsearch/showAward.do?AwardNumber=0847616). Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.
Dick, J. M., LaRowe, D. E. and Helgeson, H. C., 2006. Temperature, pressure, and electrochemical constraints on protein speciation: Group additivity calculation of the standard molal thermodynamic properties of ionized unfolded proteins. Biogeosciences, 3, 311-336. http://www.biogeosciences.net/3/311/2006/bg-3-311-2006.html
Dick, J. M., 2009. Calculation of the relative metastabilities of proteins in subcellular compartments of Saccharomyces cerevisiae. BMC Syst. Biol., 3, 75. http://dx.doi.org/10.1186/1752-0509-3-75
Korzhinskii, D. S., 1965. The theory of systems with perfectly mobile components and processes of mineral formation. Am. J. Sci., 263, 193-205. http://www.ajsonline.org/cgi/content/abstract/263/3/193
### Getting Started ## standard thermodynamic properties of species subcrt("H2O") subcrt("alanine") # names of proteins have an underscore subcrt("LYSC_CHICK") # custom temperature range T <- seq(0,500,100) subcrt("H2O",T=T,P=1000) # temperature - pressure grid P <- seq(1000,4000,1000) subcrt("H2O",T=T,P=P,grid="P") ## information about species # query the database using formulas info("C6H12O6") info("SiO2") # query using names info("quartz") t <- info(c("glucose","mannose")) # show the equations of state parameters info(t) # approximate matches for names or formulas info("acid ") info("SiO2 ") ## standard thermodynamic properties of reactions # fermentation example info(c("fructose","ethanol")) subcrt(c("fructose","C2H5OH","CO2"),c(-1,2,2)) # weathering example -- also see transfer() subcrt(c("k-feldspar","H2O","H+","kaolinite","K+","SiO2"), c(-2,-1,-2,1,2,4)) # partial reaction auto-completion is possible basis(c("SiO2","H2O","K+","H+","O2")) subcrt(c("k-feldspar","kaolinite"),c(-2,1)) ## chemical affinities # basis species basis(c("CO2","H2O","O2")) # species of interest species(c("CH4","C2H4O2","CO2")) # chemical affinities of formation reactions # take off $values for complete output affinity()$values affinity(O2=c(-90,-60,5))$values