Web interface to activity diagrams
CHNOSZ via Rpad is a web-browser-based workbook for calculating standard molal thermodynamic properties and making equilibrium activity diagrams. These can be Eh-pH diagrams or other types of predominance diagrams, or those showing the equilibrium distribution of species as a function of an intensive variable -- chemical activities of basis species, temperature, or pressure. The available species include minerals, proteins and inorganic and organic aqueous species.
Two movies are available to illustrate the operation of the workbook. This one (2.6MB, 2 min.) shows the production of an overlay diagram. This one (5.9MB, 3 min.) goes through the steps to add proteins to a system and change one of the basis species. (If you have problems viewing these movies, try the VLC media player.) The workbook also contains eight pre-loaded examples for a variety of species and variables.
The page loads with initial database selections and parameter settings taken from the selected example. After the initial setup operations are complete, the progress wheel (throbber) disappears. Then, customize the system as you like it:
The primary thermodynamic database is the OBIGT.csv data file with ca. 3000 entries giving the names, formulas, standard molal thermodynamic properties, and equations of state parameters of species. A separate protein database in CHNOSZ contains the amino acid compositions of over 200 proteins. You can add proteins to the current R session using the form described below.
Choose the example to run. This activates a subset of the thermodynamic database and sets up the system definition.
There are eight preset examples. The later examples activate larger portions of the thermodynamic database. After selecting an example from the drop-down menu, let the page finish loading and then press one of the "Calculate" buttons to generate a diagram or calculate a table of thermodynamic properties. The links below are to the images produced using the examples (png) and to printouts of the browser page after running each example (pdf).
Query the species database. The search term can be all or part of the name or chemical formula of a species. If the search is matched exactly to one species (a chemical substance in a defined physical state), the full database entry for that species is displayed. Fuzzy matches generate a list of the names of species, as well as abbreviated database listings if the number of matches is not too large. The physical states of species can be indicated by appending a space followed by "aq", "cr", "gas", "liq" or "cr1", "cr2" etc to the search term. (These designations refer to aqueous, crystalline, gasesous and liquid species, and to different phases of a mineral.) Type in a numeric search to directly return that row from the database. Note that proteins are not included in the search, unless they have been added as species using the form described below.
A comma-separated list of source keys in the database. These are usually formed by the first letters of the last names of the authors of the primary citation and a two-digit code for the publication year, e.g. JOH92. A key can also be numeric, in which case it stands for the corresponding row in the database. Hitting GO updates the basis and species drop-down menus. For a list of sources of thermodynamic data, see here, or the "source.csv" file packaged with CHNOSZ. Note that activating large subsets of the database will cause the page to be rendered slower by your browser (due to time required to generate drop-down menus with hundreds of items).
Select the basis species for the system and the logarithms of their chemical activities. The basis species are used to define the chemical potentials of the system and must be equal in number to the chemical elements in the system. To consider systems with charged species (e.g., Fe+2, ionized proteins), charge must be present among the basis species. The equations representing the stoichiometric numbers of elements in the basis species must be linearly independent. For example, the same basis species can not be used twice. The logarithms of the chemical activities of the basis species are single values -- a zero denotes unit activity, which corresponds to the standard state definitions. For aqueous species other than water, a negative value for the logarithm of activity is common. If the selected basis species meet the requirements, they are loaded into the session after hitting GO, otherwise a blank basis definition is loaded. Successful changes to the basis species cause the plot variable drop-down menus to be updated accordingly.
Input the sequences and names of proteins to be added to the current R session. Protein names in CHNOSZ are written like LYSC_CHICK, i.e. they contain two strings separated by an underscore. If you supply a protein name without an underscore, "_NEW" will be appended to the name. Also, protein names can not be repeated. The sequence can be composed of any characters (including control characters such as linefeed/carriage return) but only those matching the one-letter abbreviations for the amino acids are recognized. If the sequence is empty, proteins are searched in CHNOSZ's protein composition databases depending on the text after the underscore (e.g., "YML020W_SGD", "ybjA_ECO", "cytoplasm_YEASTGFP" and "PRIO_BOVIN" all work). After hitting GO, the properties and parameters of the new proteins, calculated using group additivity, are added to the current instance of the species database, and the new proteins appear in the species selection menus.
Select the "species of interest", i.e. those whose relative stabilities and/or thermodynamic properties you wish to calculate. The species list has the same layout as the basis species selection form above, with the addition of a column (the first one) for reaction coefficients. The latter describe a reaction whose properties will be calculated (the second "Calculate" button) and do not affect the computation of activity diagrams (the first "Calculate" button below). The list of species is made up of the database entries that have been activated using the data selection form above, followed by proteins located in the CHNOSZ protein database or added using the protein entry form. Notation for the species is the name (which may be equivalent to the formula) followed by the state. Pressing GO causes the species selection to be processed and generates a report that identifies any species of interest whose elements are not among those of the basis species.
Enter the parameters for the desired plot. The intensive variables that can be specified are the logarithms of activities of the basis species and temperature (in degrees C) and pressure (in bar). Pressure can also be set to "Psat" (see below). Ranges of one or two variables can be chosen to represent the axes of the diagram, and override any corresponding single-value settings of temperature, pressure, or logarithm of activity of basis species. If one variable is chosen, it is placed on the x-axis, and the y-axis denotes the equilibrium logarithm of activities of the species of interest (it is a 1-D activity, or speciation diagram). The y-axis range defaults to (-4,0), but can be altered by setting values in the form here. A special case is if the y-axis range is (0,1), when the degrees of formation of the species of interest are plotted instead of the logarithms of activities (the sum of the degrees of formation is always one). If two variables are chosen, they represent the variation on the x- and y-axes. These 2-D predominance diagrams consist of (meta)stability fields for the species of interest. H+ and e- as basis species translate into pH and Eh in the variable selection. Water stability limits are added as dashed lines to Eh-pH and logfO2-pH predominance diagrams.
The plot options do the following:
The numerical results are stored in two text files, affinity.txt and diagram.txt, that are written to your working directory.
Calculate the standard molal thermodynamic properties of species or reactions at the specified temperature and pressure. T and P can each be set to a single value or to a range, which is computed at 10 intervals between the specified limits. "Wet" reactions involving liquid water and/or other aqueous species are constrained to the limits within the SUPCRT92 package (roughly 0 < T < 1000 deg C and 1 < P < 5000 bar). Setting P=0 signifies "Psat", or pressures corresponding to 1 bar below 100 degrees C and to H2O liquid-vapor equilibrium between 100 degrees C and the critical temperature (~374 degrees C). If all of the reaction coefficients of the species of interest are set to zero, the properties of the individual species are calculated. If any of the coefficients are non-zero, they denote the reaction coefficients, which are negative for reactants and positive for products. CHNOSZ detects if a reaction is not mass-balanced and prints a message to this effect. An unbalanced reaction will be automatically corrected by adding appropriate amounts of the basis species, if they exist and contain the unbalanced elements. The columns of the output table are T (temperature, degrees C), P (pressure, bar), rho (density of water, g/cm3, only for "wet" species or reactions), logK (equilibrium constant), G (standard molal Gibbs energy of formation from the elements, cal/mol), H (standard molal enthalpy of formation from the elements, cal/mol), S (standard molal entropy, cal/mol/K), V (standard molal volume, cm3/mol), and Cp (heat capacity, cal/mol/K). If basis species are present that include all elements in the reaction, values of logQ (reaction quotient) and A (chemical affinity, cal/mol) are also calculated.