CHNOSZ

Thermodynamic Calculations and Diagrams for Geochemistry

Thermodynamic database with minerals, inorganic and organic aqueous species.
Balance reactions with basis species, calculate standard Gibbs energy, equilibrium constant, and chemical affinity.
Make Eh-pH, logfO2-T, and other types of chemical activity diagrams.
What is it?

The CHNOSZ package for R provides an integrated set of tools for thermodynamic calculations in aqueous geochemistry and geobiochemistry. It has functions for writing balanced reactions to form species from user-selected basis species and for calculating the standard molal properties of species and reactions, including the standard Gibbs energy and equilibrium constant (details). Calculations of the non-equilibrium chemical affinity and equilibrium chemical activity of species can be portrayed on diagrams as a function of temperature, pressure, or activity of basis species; in two dimensions, this gives a maximum affinity or predominance diagram. The diagrams have formatted chemical formulas and axis labels, and water stability limits can be added to Eh-pH, logfO2-T, and other diagrams with a redox variable. The package has been developed to handle common calculations in aqueous geochemistry, such as solubility due to complexation of metal ions, mineral buffers of redox or pH, and changing the basis species across a diagram ("mosaic diagrams"). CHNOSZ also has unique capabilities for comparing the compositional and thermodynamic properties of different proteins.

An Example
Based on a figure from Yang et al. (2018)
Fe-O-H-S
add.obigt("SUPCRT92")
basis(c("Fe", "H2", "H2S", "H2O"),
  c("cr", "aq", "aq", "liq"))
species(c("hematite", "pyrite",
  "pyrrhotite", "magnetite"))
a <- affinity(H2S = c(-4, -1.5),
  H2 = c(-6, -1), T = 300, P = 700)
diagram(a, fill = "terrain")
title(main = "Fe-O-H-S")
legend("bottomright",
  c("300 °C, 700 bar"))
More diagrams All examples
Documentation
Installation
  1. Get R from the Comprehensive R Archive Network (CRAN).
  2. Start an R session, then use these commands to install and load the package and run the examples from the documentation:
  3. install.packages("CHNOSZ")
    library(CHNOSZ)
    examples()
    
    
  4. To install the development version, use this command instead:
  5. install.packages("CHNOSZ",
      repos = "https://R-Forge.R-project.org")
    
    

logKcalc

Calculate Equilibrium Constants for GWB Thermodynamic Data Files

Install logKcalc from GitHub. Here are the vignettes from the package:

canprot

Compositional Analysis of Differentially Expressed Proteins in Cancer

Install canprot from GitHub or CRAN. Here you can browse the HTML help pages and vignettes from the package:

JMDplots

Plots from Papers by Jeffrey M. Dick

Install JMDplots from GitHub. See below for vignettes for recent papers or all vignettes from the package.

gradH2O Salinity gradients (2020)

canH2O Water in cancer (2020)

bisonBison Pool (2011 and 2013)
(added on 2020-07-12)

Compositional analysis of pan-cancer datasets for the canH2O paper

TCGA The Cancer Genome Atlas

HPA Human Protein Atlas

About

Thermodynamic models in CHNOSZ: The thermodynamic properties of liquid water are calculated using Fortran code from SUPCRT92 (Johnson et al., 1992) or an implementation in R of the IAPWS-95 formulation (Wagner and Pruß, 2002). Thermodynamic properties of other species are taken from a database for minerals and inorganic and organic aqueous species including biomolecules, or from amino acid group additivity for proteins (Dick et al., 2006). The corresponding high-temperature properties are calculated using the Berman-Brown (1985) equations for minerals and the revised Helgeson-Kirkham-Flowers (1981) equations for aqueous species. The HKF equations are augmented with the Deep Earth Water (DEW) model (Sverjensky et al., 2014) and estimates of parameters in the extended Debye-Hückel equation (Manning et al., 2013) to calculate standard-state properties and activity coefficients for given ionic strength at high pressure (to 6 GPa). Activity coefficients are implemented via adjusted standard Gibbs energies at specified ionic strength (Alberty, 1996), which converts all activity variables in the workflow to molalities. A related adjustment is available to convert standard Gibbs energies for gases from the 1 bar standard state used in SUPCRT to a variable-pressure standard state (Anderson and Crerar, 1993, Ch. 12).

Citing CHNOSZ: Please cite this paper in any publications that make use of CHNOSZ: Dick (2019). The thermodynamic database represents the work of many researchers. If you publish results that depend on any of these data, please cite the primary sources. For a list of references, use the thermo.refs() function in the package, or access the table of references here.

CHNOSZ, logKcalc, canprot, and JMDplots are free software made available under the GPL. The maintainer of these packages is Jeffrey Dick. Please contact him at j3ffdick@gmail.com.

Last updated: 2020-08-30