add.obigt(file = system.file("extdata/thermo/OBIGT-2.csv",
package = "CHNOSZ"), force = FALSE, E.units = "cal")
mod.obigt(species, ..., missingvalues = NA)
add.protein(file="protein.csv")
change(name, ...)
browse.refs(key=NULL)
checkEOS(eos, state, prop, ret.diff = FALSE)
checkGHS(ghs, ret.diff = FALSE)
check.obigt()
obigt2eos(obigt, state, fixGHS = FALSE)thermo$obigt.thermo$obigt.thermo$obigt.obigt, protein and buffers dataframes in the global thermo list.add.obigt and add.protein read data from the specified file and add it to either thermo$obigt or thermo$protein, as appropriate. Set force to TRUE to replace species that exist in the thermodynamic database (each unique combination of a name and a state in the database is considered to be a unique species). force, if not specified, reverts to TRUE if the file is left at its default. Given the default setting of E.units, the function does not perform any unit conversions. If E.units is set to J, then the thermodynamic parameters are converted from units of Joules to calories, as used in the CHNOSZ database.
mod.obigt changes one or more of the properties of one or more species or adds species to the thermodynamic database. These changes are lost if you reload the database by calling data(thermo) or if you quit the Rsession without saving it. To modify the properties of species, give the names in the species argument and supply other arguments: if one of these arguments is state, species in those states will be updated. Additional arguments refer to the name of the property(s) to be updated and correspond to the column names of thermo$obigt (the names of the properties are matched to any part of compound column names, such as z.T). The values provided should be in the units specifed in the documentation for the thermo data object. To add species, supply the new names in species and provide an argument named formula with the corresponding chemical formulas. Additional arguments refer to any of the properties you wish to specify. Properties that are not specified are assigned the value of missingvalues which is NA by default (however if state is missing it is set to the value of thermo$opt$state). The values returned (invisible-y) by mod.obigt are the rownumbers of the affected species.
change is a wrapper function to mod.obigt and mod.buffer. The name provided in the argument refers to the name or numeric index of the species to update or add using mod.obigt, unless the name begins with an underscore character, in which case the remaining part of the name (after the underscore) is passed to mod.buffer. The arguments in ... are sent without change to the subordinate function.
browse.refs with default arguments uses browseURL to display the sources of thermodynamic data in thermo$refs, with the URLs in that table showing as hyperlinks in the browser. Otherwise, if key is character, the URLs of those reference keys are opened in the browser. If key is numeric, the values refer to the species in those rows of thermo$obigt, and the URLs for each listed reference (thermo$obigt$ref1, thermo$obigt$ref2) are opened. If key is a list, it is interpreted as the result of a call to subcrt, and the reference URLs for each species involved in the calculation are opened.
checkEOS compares heat capacity and volume calculated from equation-of-state parameters with reference (tabulated) values at 25 degrees C and 1 bar and prints a message and returns the calculated value if tolerance is exceeded. The Helgeson-Kirkham-Flowers equations of state parameters are in eos, which is a data frame with columns (and column names) in the same format as thermo$obigt. The property can be one of Cp or V. The code only distinguishes between states of aq and all others. The tolerances are 1 cal/K.mol for Cp and 1 cm3/mol for V. If ret.diff is TRUE, the differences are returned irrespective of their values, and no messages are printed.
checkGHS compares G (standard molal Gibbs energy of formation from the elements) calculated from H (standard molal enthalpy of formation) and S (standard molal entropy) with reference (tabulated) values of G at 25 degrees C and 1 bar. A message is printed and the calculated difference is returned if it exceeds a tolerance of 500 cal/mol. The calculation requires that G, H and S, and the chemical formula of the species all be present. checkEOS and checkGHS are used by info when retrieving species parameters from the database.
check.obigt is a function to check self-consistency of each entry (with itself) in the thermodynamic database, using checkEOS and checkGHS. The function checks data in both thermo$obigt and extdata/thermo/OBIGT-2.csv. The output is a table listing only species that exceed at least one of the tolerance limits, giving the name of the database (OBIGT or OBIGT-2), the species index (rownumber in the database), species name and state, and DCp, DV and DG, for the calculated differences (only those above the tolerances are given). This function is used to generate the file found at extdata/thermo/obigt_check.csv.
obigt2eos takes a data frame in the format of thermo$obigt of one or more rows, removes scaling factors from equations-of-state parameters, and applies new column names depending on the state. This function is used by both info and subcrt when retrieving entries from the thermodynamic database. If fixGHS is TRUE a missing one of G, H or S for any species is calculated from the other two and the chemical formula of the species (used by subcrt when retrieving database entries).
add.obigt (extdata/thermo/OBIGT-2.csv) is used in some of the example calculations in the help page for diagram and also in anim.TCA. mod.buffer for updating the list of available buffers.
data(thermo)
## modify/add species
info(ia <- info("alanine","cr"))
mod.obigt("alanine",state="cr",G=0,H=0,S=0)
# now the values of G, H, and S are inconsistent
# with the elemental composition of alanine
info(ia)
# add a species
mod.obigt("myspecies",formula="CHNOSZ",G=0,H=0)
info(im <- info("myspecies"))
## marked dontrun because they open pages in a browser
# show the contents of thermo$refs
browse.refs()
# Internet needed for the following examples:
# open URL for Helgeson et al., 1998
browse.refs("HOK+98")
# open two URLs for alanine
browse.refs(info("alanine"))
# open three URLs for species in the reaction
s <- subcrt(c("O2","O2"),c("gas","aq"),c(-1,1))
browse.refs(s)Run the code above in your browser using DataLab