From noreply at r-forge.r-project.org Mon Dec 19 05:17:19 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 19 Dec 2016 05:17:19 +0100 (CET) Subject: [CHNOSZ-commits] r117 - in pkg/CHNOSZ: . R demo inst man tests/testthat Message-ID: <20161219041720.12E43187E9F@r-forge.r-project.org> Author: jedick Date: 2016-12-19 05:17:18 +0100 (Mon, 19 Dec 2016) New Revision: 117 Added: pkg/CHNOSZ/tests/testthat/test-nonideal.R Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/R/nonideal.R pkg/CHNOSZ/R/subcrt.R pkg/CHNOSZ/demo/solubility.R pkg/CHNOSZ/inst/NEWS pkg/CHNOSZ/man/data.Rd pkg/CHNOSZ/man/nonideal.Rd pkg/CHNOSZ/man/util.units.Rd pkg/CHNOSZ/man/water.Rd Log: subcrt() uses common logarithm for loggam Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2016-11-29 02:50:22 UTC (rev 116) +++ pkg/CHNOSZ/DESCRIPTION 2016-12-19 04:17:18 UTC (rev 117) @@ -1,6 +1,6 @@ -Date: 2016-11-29 +Date: 2016-12-19 Package: CHNOSZ -Version: 1.0.8-4 +Version: 1.0.8-5 Title: Chemical Thermodynamics and Activity Diagrams Author: Jeffrey Dick Maintainer: Jeffrey Dick Modified: pkg/CHNOSZ/R/nonideal.R =================================================================== --- pkg/CHNOSZ/R/nonideal.R 2016-11-29 02:50:22 UTC (rev 116) +++ pkg/CHNOSZ/R/nonideal.R 2016-12-19 04:17:18 UTC (rev 117) @@ -25,7 +25,7 @@ } # Alberty, 2003 Eq. 3.6-1 loggamma <- function(a,Z,I,B) { - a * Z^2 * I^(1/2) / (1 + B * I^(1/2)) } - # XXX check the following equations 20080208 jmd + # TODO: check the following equations 20080208 jmd if(prop=='log') return(loggamma(eval(A),Z,I,B)) else if(prop=='G') return(thermo$opt$R * T * loggamma(eval(A),Z,I,B)) else if(prop=='H') return(thermo$opt$R * T^2 * loggamma(eval(DD(A,'T',1)),Z,I,B)) Modified: pkg/CHNOSZ/R/subcrt.R =================================================================== --- pkg/CHNOSZ/R/subcrt.R 2016-11-29 02:50:22 UTC (rev 116) +++ pkg/CHNOSZ/R/subcrt.R 2016-12-19 04:17:18 UTC (rev 117) @@ -392,14 +392,10 @@ isaq.new <- logical() iscgl.new <- logical() isH2O.new <- logical() - #print(sinfo) - #print(sinph) - #print(reaction) for(i in 1:length(sinfo)) { iphases <- which(sinfo[i]==sinph) # deal with repeated species here ... divide iphases # by the number of duplicates - #print(iphases) if(TRUE %in% duplicated(inpho[iphases])) { iphases <- iphases[length(which(sinfo==sinfo[i]))] } @@ -467,11 +463,8 @@ iscgl <- iscgl.new isH2O <- isH2O.new - #print(out) - newprop <- eprop[eprop!='rho'] # the order of the properties - #if(ncol(out[[1]])>1) for(i in 1:length(out)) { if(length(newprop)>1) for(i in 1:length(out)) { # keep state/loggam columns if they exists ipp <- match(newprop,tolower(colnames(out[[i]]))) @@ -548,8 +541,14 @@ } } } + # convert loggam to common logarithm and # put ionic strength next to any loggam columns - for(i in 2:length(out)) if('loggam' %in% colnames(out[[i]])) out[[i]] <- cbind(out[[i]],IS=newIS) + for(i in 2:length(out)) { + if('loggam' %in% colnames(out[[i]])) { + out[[i]] <- cbind(out[[i]],IS=newIS) + out[[i]][, "loggam"] <- out[[i]][, "loggam"]/log(10) + } + } # more fanagling for species if(!do.reaction) { out <- list(species=out$species,out=out[2:length(out)]) Modified: pkg/CHNOSZ/demo/solubility.R =================================================================== --- pkg/CHNOSZ/demo/solubility.R 2016-11-29 02:50:22 UTC (rev 116) +++ pkg/CHNOSZ/demo/solubility.R 2016-12-19 04:17:18 UTC (rev 117) @@ -31,7 +31,7 @@ species(1:3, unlist(e$loga.equil)) a <- affinity(T=T) # check they're actually equal - stopifnot(all(abs(unlist(a$values) - a$values[[1]]) < 1e-10)) + stopifnot(all(abs(unlist(a$values) - as.vector(a$values[[1]])) < 1e-10)) return(a$values[[1]]) } Modified: pkg/CHNOSZ/inst/NEWS =================================================================== --- pkg/CHNOSZ/inst/NEWS 2016-11-29 02:50:22 UTC (rev 116) +++ pkg/CHNOSZ/inst/NEWS 2016-12-19 04:17:18 UTC (rev 117) @@ -1,4 +1,4 @@ -CHANGES IN CHNOSZ 1.0.8-4 (2016-11-29) +CHANGES IN CHNOSZ 1.0.8-5 (2016-12-19) -------------------------------------- - Add "AA" as a keyword for preset species in basis() (cysteine, @@ -9,6 +9,12 @@ - More flexible parsing of chemical formulas for ZC() and other functions; e.g. ZC(colMeans(protein.formula(1:4))) now works. +- supcrt() now returns 'loggam' using the common logarithm; add + test-nonideal.R to check for consistency between loggam and logK + values returned by supcrt(). Thanks to David T. Wang for the bug + report and test. (This also fixes the bug previously noted for the + first example in ?nonideal.) + CHANGES IN CHNOSZ 1.0.8 (2016-05-28) ------------------------------------ Modified: pkg/CHNOSZ/man/data.Rd =================================================================== --- pkg/CHNOSZ/man/data.Rd 2016-11-29 02:50:22 UTC (rev 116) +++ pkg/CHNOSZ/man/data.Rd 2016-12-19 04:17:18 UTC (rev 117) @@ -246,7 +246,7 @@ Shock, E. L. et al. {1998} \emph{SLOP98.dat} (computer data file). http://geopig.asu.edu/supcrt92_data/slop98.dat, accessed on 2005-11-05. Current location: \url{http://geopig.asu.edu/sites/default/files/slop98.dat}. - Wagman, D. D., Evans, W. H., Parker, V. B., Schumm, R. H., Halow, I., Bailey, S. M., Churney, K. L. and Nuttall, R. L. (1982) The NBS tables of chemical thermodynamic properties. Selected values for inorganic and C\eqn{_1}{1} and C\eqn{_2}{2} organic substances in SI units. \emph{J. Phys. Chem. Ref. Data} \bold{11} (supp. 2), 1--392. \url{http://www.nist.gov/data/PDFfiles/jpcrdS2Vol11.pdf} + Wagman, D. D., Evans, W. H., Parker, V. B., Schumm, R. H., Halow, I., Bailey, S. M., Churney, K. L. and Nuttall, R. L. (1982) The NBS tables of chemical thermodynamic properties. Selected values for inorganic and C\eqn{_1}{1} and C\eqn{_2}{2} organic substances in SI units. \emph{J. Phys. Chem. Ref. Data} \bold{11} (supp. 2), 1--392. \url{https://srd.nist.gov/JPCRD/jpcrdS2Vol11.pdf} } Modified: pkg/CHNOSZ/man/nonideal.Rd =================================================================== --- pkg/CHNOSZ/man/nonideal.Rd 2016-11-29 02:50:22 UTC (rev 116) +++ pkg/CHNOSZ/man/nonideal.Rd 2016-12-19 04:17:18 UTC (rev 117) @@ -26,8 +26,9 @@ } \section{Warning}{ -The activity coefficients (gamma) in the first example below are lower than those shown on p. 274-276 of Alberty, 2003 (compare gamma near 0.75 in for charge = -1, IS = 0.25, T = 25 on p. 274 with gamma near 0.5 here). -This may be due to an unidentified bug in the function. +The logarithms of activity coefficients (\code{loggam}) returned by \code{nonideal} use the natural logarithm (cf. Alberty, 2003 Eq. 3.6-1). +To maintain consistency with the conventions used elsewhere in the package (i.e. for logarithms of equilibrium constants and of chemical activities), the values of \code{loggam} returned by \code{\link{subcrt}} are expressed using the common (base 10) logarithm. +Note that the first example below uses \code{loggam} returned by \code{subcrt}, therefore requiring a base of 10 for calculating gamma. } \examples{\dontshow{data(thermo)} @@ -43,9 +44,10 @@ s <- subcrt(c("H2PO4-", "HADP-2", "HATP-3", "ATP-4"), IS=IS, grid="IS", T=T[j]) for(i in 1:4) lines(IS, 10^s$out[[i]]$loggam, col=col[j]) } -text(0.1, 0.62, "Z = -1") -text(0.075, 0.18, "Z = -2") -text(0.05, 0.06, "Z = -3") +text(0.125, 0.8, "Z = -1") +text(0.1, 0.42, "Z = -2") +text(0.075, 0.18, "Z = -3") +text(0.05, 0.08, "Z = -4") title(main=paste("activity coefficient (gamma) of -1,-2,-3,-4", "charged species at 0, 25, 40 deg C, after Alberty, 2003", sep="\n"), cex.main=0.95) Modified: pkg/CHNOSZ/man/util.units.Rd =================================================================== --- pkg/CHNOSZ/man/util.units.Rd 2016-11-29 02:50:22 UTC (rev 116) +++ pkg/CHNOSZ/man/util.units.Rd 2016-12-19 04:17:18 UTC (rev 117) @@ -33,7 +33,9 @@ \details{ - The units settings are used by \code{\link{subcrt}}, \code{\link{affinity}}, and \code{\link{diagram}} to accept input in or convert output to the units desired by the user. The settings, which can be queried or changed with \code{T.units}, \code{E.units} and \code{P.units}, refer to the units of temperature (\code{K} or \code{C}), energy (\code{cal} or \code{J}), and pressure (\code{bar}, \code{MPa}). (The first value in each of those pairs refers to the default units). +The units settings are used by \code{\link{subcrt}}, \code{\link{affinity}}, and \code{\link{diagram}} to accept input in or convert output to the units desired by the user. +The settings, which can be queried or changed with \code{T.units}, \code{E.units} and \code{P.units}, refer to the units of temperature (\code{C} or \code{K}), energy (\code{cal} or \code{J}), and pressure (\code{bar}, \code{MPa}). +(The first value in each of those pairs refers to the default units). The actual units conversions are handled by \code{convert}, through which \code{values} are transformed into destination \code{units} (names not case sensitive). The possible conversions and settings for the \code{units} argument are shown in the following table. Modified: pkg/CHNOSZ/man/water.Rd =================================================================== --- pkg/CHNOSZ/man/water.Rd 2016-11-29 02:50:22 UTC (rev 116) +++ pkg/CHNOSZ/man/water.Rd 2016-12-19 04:17:18 UTC (rev 117) @@ -142,7 +142,7 @@ \references{ - Archer, D. G. and Wang, P. M. (1990) The dielectric constant of water and Debye-Huckel limiting law slopes. \emph{J. Phys. Chem. Ref. Data} \bold{19}, 371--411. \url{http://www.nist.gov/data/PDFfiles/jpcrd383.pdf} + Archer, D. G. and Wang, P. M. (1990) The dielectric constant of water and Debye-Huckel limiting law slopes. \emph{J. Phys. Chem. Ref. Data} \bold{19}, 371--411. \url{http://dx.doi.org/10.1063/1.555853} Haar, L., Gallagher, J. S. and Kell, G. S. (1984) \emph{NBS/NRC Steam Tables}. Hemisphere, Washington, D. C., 320 p. \url{http://www.worldcat.org/oclc/301304139} @@ -152,7 +152,7 @@ Johnson, J. W., Oelkers, E. H. and Helgeson, H. C. (1992) SUPCRT92: A software package for calculating the standard molal thermodynamic properties of minerals, gases, aqueous species, and reactions from 1 to 5000 bar and 0 to 1000\eqn{^{\circ}}{?}C. \emph{Comp. Geosci.} \bold{18}, 899--947. \url{http://dx.doi.org/10.1016/0098-3004(92)90029-Q} - Levelt-Sengers, J. M. H., Kamgarparsi, B., Balfour, F. W. and Sengers, J. V. (1983) Thermodynamic properties of steam in the critical region. \emph{J. Phys. Chem. Ref. Data} \bold{12}, 1--28. \url{http://www.nist.gov/data/PDFfiles/jpcrd214.pdf} + Levelt-Sengers, J. M. H., Kamgarparsi, B., Balfour, F. W. and Sengers, J. V. (1983) Thermodynamic properties of steam in the critical region. \emph{J. Phys. Chem. Ref. Data} \bold{12}, 1--28. \url{http://dx.doi.org/10.1063/1.555676} Wagner, W. and Pruss, A. (2002) The IAPWS formulation 1995 for the thermodynamic properties of ordinary water substance for general and scientific use. \emph{J. Phys. Chem. Ref. Data} \bold{31}, 387--535. \url{http://dx.doi.org/10.1063/1.1461829} Added: pkg/CHNOSZ/tests/testthat/test-nonideal.R =================================================================== --- pkg/CHNOSZ/tests/testthat/test-nonideal.R (rev 0) +++ pkg/CHNOSZ/tests/testthat/test-nonideal.R 2016-12-19 04:17:18 UTC (rev 117) @@ -0,0 +1,7 @@ +context("nonideal") + +test_that("loggam and logK values are consistent", { + rxn1 <- subcrt(c("anhydrite", "Ca+2", "SO4-2"), c(-1, 1, 1), P=1, T=25, I=0) + rxn2 <- subcrt(c("anhydrite", "Ca+2", "SO4-2"), c(-1, 1, 1), P=1, T=25, I=0.7) + expect_equal(rxn1$out$logK, rxn2$out$loggam + rxn2$out$logK) +}) From noreply at r-forge.r-project.org Wed Dec 21 12:10:05 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 21 Dec 2016 12:10:05 +0100 (CET) Subject: [CHNOSZ-commits] r118 - in pkg/CHNOSZ: . data inst inst/extdata/thermo man tests/testthat vignettes Message-ID: <20161221111005.1AB7A1880AB@r-forge.r-project.org> Author: jedick Date: 2016-12-21 12:10:04 +0100 (Wed, 21 Dec 2016) New Revision: 118 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/data/OBIGT.csv pkg/CHNOSZ/data/refs.csv pkg/CHNOSZ/inst/NEWS pkg/CHNOSZ/inst/extdata/thermo/OBIGT-2.csv pkg/CHNOSZ/inst/extdata/thermo/obigt_check.csv pkg/CHNOSZ/man/protein.Rd pkg/CHNOSZ/man/protein.info.Rd pkg/CHNOSZ/man/read.expr.Rd pkg/CHNOSZ/tests/testthat/test-affinity.R pkg/CHNOSZ/tests/testthat/test-ionize.aa.R pkg/CHNOSZ/tests/testthat/test-iprotein.R pkg/CHNOSZ/tests/testthat/test-protein.info.R pkg/CHNOSZ/tests/testthat/test-subcrt.R pkg/CHNOSZ/tests/testthat/test-util.data.R pkg/CHNOSZ/vignettes/equilibrium.Rnw pkg/CHNOSZ/vignettes/equilibrium.lyx pkg/CHNOSZ/vignettes/hotspring.Rnw pkg/CHNOSZ/vignettes/hotspring.lyx Log: add citric acid cycle data from Canovas and Shock, 2016 Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2016-12-19 04:17:18 UTC (rev 117) +++ pkg/CHNOSZ/DESCRIPTION 2016-12-21 11:10:04 UTC (rev 118) @@ -1,6 +1,6 @@ -Date: 2016-12-19 +Date: 2016-12-21 Package: CHNOSZ -Version: 1.0.8-5 +Version: 1.0.8-6 Title: Chemical Thermodynamics and Activity Diagrams Author: Jeffrey Dick Maintainer: Jeffrey Dick Modified: pkg/CHNOSZ/data/OBIGT.csv =================================================================== --- pkg/CHNOSZ/data/OBIGT.csv 2016-12-19 04:17:18 UTC (rev 117) +++ pkg/CHNOSZ/data/OBIGT.csv 2016-12-21 11:10:04 UTC (rev 118) @@ -1713,10 +1713,10 @@ dH2UTP-2,NA,C9H13N2O14P3-2,aq,LH06a,NA,4.Feb.03,-775114,-945072,95.02,97.96,191.34,2.4367,132.3092,-19.279,-2.6907,203.5,-29.52,5,-2 dH3UTP-,NA,C9H14N2O14P3-,aq,LH06a,NA,4.Feb.03,-777814,-943572,109.11,158.49,202.56,2.472,139.4108,-19.444,-2.9842,262.2,-29.07,4.9,-1 dH4UTP,NA,C9H15N2O14P3,aq,LH06a,NA,4.Feb.03,-779850,-940671,125.67,213.85,207.7,2.4888,142.7899,-19.522,-3.1239,315.8,-28.65,4.8,0 -"citric acid",NA,C6H8O7,aq,LH06a,NA,5.Feb.03,-297180,-364527,78.89,73.47,112.98,0,0,0,0,96.43,-11.57,-0.06,0 -H2-citrate,NA,C6H7O7-,aq,LH06a,NA,5.Feb.03,-292912,-363530,67.92,47.04,102.48,0,0,0,0,89.4,-14.12,1.5,-1 -H-citrate-2,NA,C6H6O7-2,aq,LH06a,NA,5.Feb.03,-286417,-362947,48.09,7.71,91.08,0,0,0,0,73.14,-21.06,2.4843,-2 -citrate-3,NA,C6H5O7-3,aq,LH06a,NA,5.Feb.03,-277690,-363750,16.13,-43.16,74.08,0,0,0,0,31.5,-24.41,2.75,-3 +"citric acid",NA,C6H8O7,aq,LH06a,CS16,21.Dec.16,-297180,-364527,78.89,73.47,112.98,17.2019,32.2622,-2.7285,-4.1127,96.43,-11.57,-0.06,0 +H2-citrate,NA,C6H7O7-,aq,LH06a,CS16,21.Dec.16,-292912,-363530,67.92,47.04,102.48,16.3576,30.3484,-2.2931,-4.0336,89.4,-14.12,1.5,-1 +H-citrate-2,NA,C6H6O7-2,aq,LH06a,CS16,21.Dec.16,-286417,-362947,48.09,7.71,91.08,15.1704,27.6579,-1.6828,-3.9224,73.14,-21.06,2.48,-2 +citrate-3,NA,C6H5O7-3,aq,LH06a,CS16,21.Dec.16,-277690,-363750,16.13,-43.16,74.08,12.9466,22.6175,-0.5371,-3.714,31.5,-24.41,2.75,-3 MgAMP,MgAMP,MgC10H12N5O7P,aq,LH06b,NA,10.Jun.03,-359729,-497815,41.69,115.391969407266,158.14,2.3212,109.107,-18.7412,-1.7315,191.66,-18.262,4.3,0 MgADP-,MgADP-,MgC10H12N5O10P2-,aq,LH06b,NA,21.May.03,-567524,-730933,55.74,139.985659655832,189.17,2.4109,127.142,-19.16,-2.477,175.24,-3.8947,3,-1 MgHADP,MgHADP,MgC10H13N5O10P2,aq,LH06b,NA,10.Jun.03,-574465,-731643,76.54,161.472275334608,199.93,2.4625,137.497,-19.3997,-2.9051,244.57,-19.376,4.8,0 @@ -1809,6 +1809,30 @@ "cis-1,2-dichloroethylene","cis-1,2-DCE",C2H2Cl2,aq,HS99,NA,01.May.12,6620,-7712,39.23,95,68.2,11.0468,19.1914,-1.7922,-3.5723,60.4606,16.3169,-0.15,0 "trans-1,2-dichloroethylene","trans-1,2-DCE",C2H2Cl2,aq,HS99,NA,01.May.12,7700,-6950,38.16,95,68.2,11.0468,19.1914,-1.7922,-3.5723,60.4606,16.3169,-0.15,0 "vinyl chloride",VC,C2H3Cl,aq,HS99,NA,01.May.12,12785,-4551,18.11,45,55.8,9.35,15.0507,-0.1702,-3.4011,31.1575,6.1319,-0.15,0 +"cis-aconitic acid",NA,C6H6O6,aq,CS16,NA,21.Dec.16,-236200,-291400,63.9,64,108.7,16.5766,30.8449,-2.4072,-4.0541,59.7379,1.3622,-0.164,0 +H2-cis-aconitate,NA,C6H5O6-,aq,CS16,NA,21.Dec.16,-233600,-290480,58.2,37.6,98.2,15.4873,28.376,-1.8452,-3.9521,51.8298,-3.6503,0.7477,-1 +H-cis-aconitate-2,NA,C6H4O6-2,aq,CS16,NA,21.Dec.16,-227700,-289900,40.4,-1.7,86.8,14.6306,26.4342,-1.4046,-3.8718,30.3757,-4.1266,2.601,-2 +cis-aconitate-3,NA,C6H3O6-3,aq,CS16,NA,21.Dec.16,-218970,-290700,8.4,-52.6,69.8,13.0954,22.9544,-0.6139,-3.7279,-0.2807,-4.7435,4.6843,-3 +"isocitric acid",NA,C6H8O7,aq,CS16,NA,21.Dec.16,-295880,-363960,76.4,74.5,114.3,17.3743,32.653,-2.817,-4.1289,68.8768,2.3996,-0.082,0 +H2-isocitrate,NA,C6H7O7-,aq,CS16,NA,21.Dec.16,-291390,-362960,64.7,48.1,103.8,16.2126,30.0199,-2.2197,-4.02,61.1741,-3.523,0.6493,-1 +H-isocitrate-2,NA,C6H6O7-2,aq,CS16,NA,21.Dec.16,-284960,-362380,45.1,8.8,92.4,15.3672,28.1034,-1.783,-3.9408,39.977,-3.9993,2.5298,-2 +isocitrate-3,NA,C6H5O7-3,aq,CS16,NA,21.Dec.16,-276230,-363180,13.1,-42.1,75.4,13.8316,24.623,-0.9928,-3.7969,9.3108,-4.6163,4.6132,-3 +"a-ketoglutaric acid",NA,C5H6O5,aq,CS16,NA,21.Dec.16,-201800,-245700,76.1,39.9,95.7,14.8287,26.8831,-1.5061,-3.8903,41.2055,-1.0189,-0.084,0 +H-a-ketoglutarate,NA,C5H5O5-,aq,CS16,NA,21.Dec.16,-198800,-242300,77.1,2.9,88.9,14.1054,25.2437,-1.1337,-3.8226,15.3765,-4.0709,0.4615,-1 +a-ketoglutarate-2,NA,C5H4O5-2,aq,CS16,NA,21.Dec.16,-191800,-240400,60.1,-49.9,82.7,13.9562,24.9058,-1.057,-3.8086,-19.3472,-4.7108,2.3026,-2 +H-succinate,NA,C4H5O4-,aq,CS16,NA,21.Dec.16,-172060,-217350,45.2,9.3,69.99,11.6617,19.7057,0.1226,-3.5935,26.1173,-3.9932,0.9446,-1 +succinate-2,NA,C4H4O4-2,aq,CS16,NA,21.Dec.16,-164380,-217350,19.5,-50.5,56.32,10.4577,15.8622,3.5716,-3.4346,-14.0383,-4.718,2.917,-2 +"fumaric acid",NA,C4H4O4,aq,CS16,NA,21.Dec.16,-154820,-186260,60.62,47,77.9,12.3542,21.2748,-0.2318,-3.6585,45.951,-0.3174,-0.186,0 +H-fumarate,NA,C4H3O4-,aq,CS16,NA,21.Dec.16,-150600,-186150,46.83,10,65.4,11.0637,18.3498,0.4327,-3.5376,26.4785,-3.9848,0.9199,-1 +fumarate-2,NA,C4H2O4-2,aq,CS16,NA,21.Dec.16,-144320,-186830,23.48,-42.8,51.7,9.9248,15.7683,1.0191,-3.4309,-7.3722,-4.6247,2.8572,-2 +"malic acid",NA,C4H6O5,aq,CS16,NA,21.Dec.16,-213530,-259310,68.21,56.43,82.22,12.9644,22.6577,-0.5461,-3.7157,53.9427,0.6143,-0.136,0 +H-malate,NA,C4H5O5-,aq,CS16,NA,21.Dec.16,-208810,-258610,54.75,19.4,75.4,12.3867,21.3482,-0.249,-3.6615,34.5541,-3.8709,0.8,-1 +malate-2,NA,C4H4O5-2,aq,CS16,NA,21.Dec.16,-201860,-258890,30.48,-33.4,69.19,12.2779,21.1017,-0.1928,-3.6513,0.8264,-4.5108,2.7512,-2 +"oxaloacetic acid",NA,C4H4O5,aq,CS16,NA,21.Dec.16,-200000,-235100,72.9,29.1,79.1,12.5492,21.7168,-0.3324,-3.6768,32.3818,-2.0859,-0.105,0 +H-oxaloacetate,NA,C4H3O5-,aq,CS16,NA,21.Dec.16,-196600,-231300,74,-7.9,72.3,11.8516,20.1357,0.0269,-3.6114,5.2703,-4.2017,0.5084,-1 +oxaloacetate-2,NA,C4H2O5-2,aq,CS16,NA,21.Dec.16,-190600,-230300,57.2,-60.7,66.1,11.7014,19.7949,0.1041,-3.5973,-29.4812,-4.8417,2.3465,-2 +"pyruvic acid",NA,CH3COCOOH,aq,CS16,NA,21.Dec.16,-117000,-140300,62.1,36.3,64.6,10.5381,17.1584,0.7032,-3.4883,37.4903,-1.3746,-0.176,0 +pyruvate,NA,CH3COCOO-,aq,CS16,NA,21.Dec.16,-113600,-137400,60.4,-3.7,51.5,9.0836,13.862,1.4526,-3.3521,11.2428,-4.1508,0.7144,-1 acanthite,Acn,Ag2S,cr1,HDN+78,NA,5.May.78,-9446,-7550,34.3,NA,34.2,15.63,8.6,0,0,0,0,0,450 acanthite,Acn,Ag2S,cr2,HDN+78,NA,5.May.78,-9235.197,-7024.866,35.3543,NA,34.2,1.819,53,0,0,0,0,0,620 acanthite,Acn,Ag2S,cr3,HDN+78,NA,5.May.78,-8227.324,-4960.457,38.898,NA,34.2,21.6,0,0,0,0,0,0,1000 Modified: pkg/CHNOSZ/data/refs.csv =================================================================== --- pkg/CHNOSZ/data/refs.csv 2016-12-19 04:17:18 UTC (rev 117) +++ pkg/CHNOSZ/data/refs.csv 2016-12-21 11:10:04 UTC (rev 118) @@ -15,6 +15,7 @@ BZA10,"E. F. Bazarkina, A. V. Zotov and N. N. Akinfiev",2010,"Geol. Ore Deposits 52, 167-178",http://dx.doi.org/10.1134/S1075701510020054 CGM+81,"S. Cabani, P. Gianni, V. Mollica and L. Lepori",1981,"J. Solution Chem. 10, 563-595",http://dx.doi.org/10.1007/BF00646936 CHNOSZ,"J. M. Dick",2007,"CHNOSZ package documentation",http://chnosz.net +CS16,"P. A. Canovas III and E. L. Shock",2016,"Geochim. Cosmochim. Acta 195, 293-322",http://dx.doi.org/10.1016/j.gca.2016.08.028 CSM+07,"M. Censky, J. Sedlbauer et al.",2007,"Geochim. Cosmochim. Acta 71, 580-603",http://dx.doi.org/10.1016/j.gca.2006.10.022 CWM89,"J. D. Cox, D. D. Wagman and V. A. Medvedev, eds.",1989,"CODATA Key Values for Thermodynamics",http://www.worldcat.org/oclc/18559968 Dic07,"J. M. Dick",2007,"Ph.D. Dissertation, U.C. Berkeley", Modified: pkg/CHNOSZ/inst/NEWS =================================================================== --- pkg/CHNOSZ/inst/NEWS 2016-12-19 04:17:18 UTC (rev 117) +++ pkg/CHNOSZ/inst/NEWS 2016-12-21 11:10:04 UTC (rev 118) @@ -1,4 +1,4 @@ -CHANGES IN CHNOSZ 1.0.8-5 (2016-12-19) +CHANGES IN CHNOSZ 1.0.8-6 (2016-12-21) -------------------------------------- - Add "AA" as a keyword for preset species in basis() (cysteine, @@ -9,12 +9,19 @@ - More flexible parsing of chemical formulas for ZC() and other functions; e.g. ZC(colMeans(protein.formula(1:4))) now works. -- supcrt() now returns 'loggam' using the common logarithm; add +- subcrt() now returns 'loggam' using the common logarithm; add test-nonideal.R to check for consistency between loggam and logK - values returned by supcrt(). Thanks to David T. Wang for the bug - report and test. (This also fixes the bug previously noted for the - first example in ?nonideal.) + values returned by subcrt(). This also fixes the issue previously + noted for the first example in ?nonideal. Thanks to David T. Wang for + the bug report and test. +- OBIGT.csv: Add data for citric acid cycle metabolites from Canovas and + Shock, 2016. + +- Clean up OBIGT-2.csv: remove data from Dalla-Betta and Schulte, 2009 + (citric acid cycle metabolites; thioester species have been kept) and + from Dick et al., 2006 (methionine and [Met]). + CHANGES IN CHNOSZ 1.0.8 (2016-05-28) ------------------------------------ Modified: pkg/CHNOSZ/inst/extdata/thermo/OBIGT-2.csv =================================================================== --- pkg/CHNOSZ/inst/extdata/thermo/OBIGT-2.csv 2016-12-19 04:17:18 UTC (rev 117) +++ pkg/CHNOSZ/inst/extdata/thermo/OBIGT-2.csv 2016-12-21 11:10:04 UTC (rev 118) @@ -134,29 +134,9 @@ m-diaminobenzene,NA,C6H8N2,aq,CSM+07,NA,12.Sep.07,56238,29995,90.94,75.76,96.9,2.0467,11.1955,149.555,-8.2091,79.8375,-1.8372,0.0342,0 p-diaminobenzene,NA,C6H8N2,aq,CSM+07,NA,12.Sep.07,56238,29995,90.94,75.76,96.9,2.0467,11.1955,149.555,-8.2091,79.8375,-1.8372,0.0342,0 aminophenols,NA,C6H7NO,aq,CSM+07,NA,12.Sep.07,5712,-17734,86.33,70.27,93,1.9788,10.4161,144.173,-7.7925,75.4541,-2.4763,0.1868,0 -"pyruvic acid",NA,CH3COCOOH,aq,DS09,NA,30.Jun.10,-116898,NA,43,27.39,54.6,9.3442,13.7309,0.5923,-3.348,5.8903,9.1799,-0.3088,0 -pyruvate,NA,CH3COCOO-,aq,DS09,NA,30.Jun.10,-113504,NA,40.99,-12.62,41.5,7.7918,10.0868,4.2106,-3.1973,5.3246,-4.261,0.1009,-1 -"oxaloacetic acid",NA,C4H4O5,aq,DS09,NA,30.Jun.10,-200359,NA,68.71,25.98,72.4,11.7108,17.158,5.9003,-3.4896,6.5026,9.0247,-0.1247,0 -H-oxaloacetate,NA,C4H3O5-,aq,DS09,NA,30.Jun.10,-196869,NA,55.71,-18.57,60.3,10.288,15.9467,2.5031,-3.4396,-2.5335,-4.3332,0.7902,-1 -oxaloacetate-2,NA,C4H2O5-2,aq,DS09,NA,30.Jun.10,-190894,NA,25.79,-78.42,46.7,9.1083,13.1771,3.3102,-3.3251,-42.12,-5.0583,2.7237,-2 -"malic acid",NA,C4H6O5,aq,DS09,NA,30.Jun.10,-213098,NA,67.83,54.42,82.8,13.1508,20.272,5.1675,-3.6184,28.0217,12.1772,-0.1801,0 -H-malate,NA,C4H5O5-,aq,DS09,NA,30.Jun.10,-208509,NA,54.42,9.85,69.4,11.5282,18.858,1.6549,-3.5599,25.3824,-3.9885,0.8233,-1 -malate-2,NA,C4H4O5-2,aq,DS09,NA,30.Jun.10,-201506,NA,30.31,-49.98,55.7,10.3188,16.0191,2.4821,-3.4426,-15.0136,-4.7137,2.7969,-2 -"fumaric acid",NA,C4H4O4,aq,DS09,NA,30.Jun.10,-154350,NA,62.4,36.97,78.8,12.6212,21.4233,9.5284,-3.666,14.0502,10.2418,-0.2286,0 -H-fumarate,NA,C4H3O4-,aq,DS09,NA,30.Jun.10,-150120,NA,48.59,-7.6,65.4,11.012,17.646,2.0079,-3.5098,9.1659,-4.2001,0.8937,-1 -fumarate-2,NA,C4H2O4-2,aq,DS09,NA,30.Jun.10,-143858,NA,25.19,-67.42,51.7,9.7988,14.7985,2.8377,-3.3921,-31.3293,-4.9252,2.8324,-2 -"a-ketoglutaric acid",NA,C5H6O5,aq,DS09,NA,30.Jun.10,-201315,NA,75.31,41.44,89,13.963,22.0282,5.7667,-3.691,18.8537,10.7384,-0.0839,0 -H-a-ketoglutarate,NA,C5H5O5-,aq,DS09,NA,30.Jun.10,-198231,NA,58.2,-3.13,75.6,12.3535,20.7952,1.0903,-3.64,12.1953,-4.1458,0.6982,-1 -a-ketoglutarate-2,NA,C5H4O5-2,aq,DS09,NA,30.Jun.10,-191683,NA,32.5,-62.95,61.9,11.1522,17.9751,1.912,-3.5234,-27.9773,-4.8709,2.6719,-2 -"citric acid",NA,C6H8O7,aq,DS09,NA,30.Jun.10,-297180,NA,78.73,77.08,113.6,17.3131,29.2727,9.5366,-3.9905,46.7151,14.6883,-0.0558,0 -H2-citrate,NA,C6H7O7-,aq,DS09,NA,30.Jun.10,-293093,NA,68.4,44.91,98.1,15.3786,27.8965,-0.979,-3.9336,57.6138,-3.5638,0.5938,-1 -H-citrate-2,NA,C6H6O7-2,aq,DS09,NA,30.Jun.10,-286616,NA,48.35,0.2,88.5,14.7041,26.3129,-0.5174,-3.8681,31.407,-4.1055,2.4817,-2 -citrate-3,NA,C6H5O7-3,aq,DS09,NA,30.Jun.10,-277892,NA,22.01,-60.9,72,13.1248,22.6059,0.5629,-3.7148,-9.7775,-4.8461,4.4801,-3 "succinyl thioester",NA,C6H10O3S,aq,DS09,NA,30.Jun.10,-118690,NA,94.29,51.65,140.5,20.9773,37.1962,27.6083,-4.318,27.2302,11.8701,-0.0331,0 "succinyl thioester-1",NA,C6H9O3S-,aq,DS09,NA,30.Jun.10,-112070,NA,69.79,18.64,133.7,20.2297,39.2837,-4.2971,-4.4043,31.8088,-3.882,0.4476,-1 "acetyl thioester",NA,C4H8OS,aq,DS09,NA,30.Jun.10,-33485,NA,95.63,61.07,107.3,16.5664,24.6312,8.8162,-3.7986,40.8944,8.1836,-0.3839,0 -methionine,Met,C5H11NO2S,aq,AH97b,DLH06,25.Aug.06,-120120,-178520,62.36,70.7,105.4,24.95,6.9,13.59,-7.77,85.3,-6.6,0.13,0 -[Met],NA,C3H7S,aq,DLH06,NA,25.Aug.06,-35245,-59310,40.38,72.739,71.832,15.48,8.76,10.82,-6,63.7,4,-0.1,0 LiCrO4-,NA,LiCrO4-,aq,AML10,NA,03.Jul.10,-246189,-276987,23.021,-1.86,25.17,5.6394,5.9909,2.9644,-3.0267,16.8298,-3.4143,1.2728,-1 NaCrO4-,NA,NaCrO4-,aq,AML10,NA,03.Jul.10,-239025,-266828,38.364,-3.93,24.95,5.5308,5.7256,3.0783,-3.0157,13.4846,-3.8343,1.0404,-1 KCrO4-,NA,KCrO4-,aq,AML10,NA,03.Jul.10,-243870,-269706,48.161,-16.63,33.98,6.7157,8.6197,1.8358,-3.1354,4.6973,-6.4214,0.8921,-1 Modified: pkg/CHNOSZ/inst/extdata/thermo/obigt_check.csv =================================================================== --- pkg/CHNOSZ/inst/extdata/thermo/obigt_check.csv 2016-12-19 04:17:18 UTC (rev 117) +++ pkg/CHNOSZ/inst/extdata/thermo/obigt_check.csv 2016-12-21 11:10:04 UTC (rev 118) @@ -175,10 +175,6 @@ "OBIGT",1495,"n-butanethiol","aq",2.19,, "OBIGT",1621,"dH2TMP","aq",,-1, "OBIGT",1623,"dHUMP-","aq",1.84,, -"OBIGT",1715,"citric acid","aq",,-112.81, -"OBIGT",1716,"H2-citrate","aq",,-106.64, -"OBIGT",1717,"H-citrate-2","aq",,-97.98, -"OBIGT",1718,"citrate-3","aq",,-81.71, "OBIGT",1731,"HNicMP(ox)","aq",,9.54, "OBIGT",1739,"ribose-5-phosphate","aq",,7.48, "OBIGT",1742,"H4NADP(red)","aq",1.73,, @@ -194,52 +190,52 @@ "OBIGT",1760,"fructose","aq",1.3,, "OBIGT",1761,"sorbose","aq",1.3,, "OBIGT",1762,"cyclohexane","aq",9.35,6.64, -"OBIGT",1787,"Gly-Ala-Gly","aq",,-126.09, -"OBIGT",1788,"Gly-Arg+-Gly","aq",,-182.01, -"OBIGT",1789,"Gly-Asn-Gly","aq",,-145.77, -"OBIGT",1790,"Gly-Asp-Gly","aq",,-139.16, -"OBIGT",1791,"Gly-Cys-Gly","aq",,-139.2, -"OBIGT",1792,"Gly-Gln-Gly","aq",,-158.09, -"OBIGT",1793,"Gly-Glu-Gly","aq",,-155.4, -"OBIGT",1794,"Gly-Gly-Gly","aq",,-107.83, -"OBIGT",1795,"Gly-His-Gly","aq",,-167.84, -"OBIGT",1796,"Gly-Ile-Gly","aq",,-172.24, -"OBIGT",1797,"Gly-Leu-Gly","aq",,-171.74, -"OBIGT",1798,"Gly-Lys+-Gly","aq",,-175.45, -"OBIGT",1799,"Gly-Met-Gly","aq",,-172.45, -"OBIGT",1800,"Gly-Phe-Gly","aq",,-188.52, -"OBIGT",1801,"Gly-Pro-Gly","aq",,-140.68, -"OBIGT",1802,"Gly-Ser-Gly","aq",,-125.79, -"OBIGT",1803,"Gly-Thr-Gly","aq",,-141.19, -"OBIGT",1804,"Gly-Tyr-Gly","aq",,-190.24, -"OBIGT",1805,"Gly-Val-Gly","aq",,-155.72, -"OBIGT",1806,"[GXGBB]","aq",,-98.93, -"OBIGT",1844,"antigorite","cr1",,,812 -"OBIGT",1878,"clinochlore,7a","cr1",,,666 -"OBIGT",1897,"daphnite,14a","cr",,,-836 -"OBIGT",1922,"ferrosilite","cr1",,,694 -"OBIGT",1923,"ferrosilite","cr2",,,694 -"OBIGT",1938,"greenalite","cr",,,142507 -"OBIGT",1953,"hydromagnesite","cr",,,-2569 -"OBIGT",2090,"n-octadecane","cr",-2.63,, -"OBIGT",2091,"n-nonadecane","cr",-13.32,, -"OBIGT",2092,"n-eicosane","cr",-2.79,, -"OBIGT",2093,"n-heneicosane","cr",-8.61,, -"OBIGT",2094,"n-docosane","cr",-2.63,, -"OBIGT",2095,"n-tricosane","cr",-5.22,, -"OBIGT",2096,"n-tetracosane","cr",-2.02,, -"OBIGT",2097,"n-pentacosane","cr",-2.93,, -"OBIGT",2098,"n-hexacosane","cr",-1.29,, -"OBIGT",2099,"n-heptacosane","cr",-1.23,, -"OBIGT",2151,"carbazole","cr",-43.39,, -"OBIGT",2192,"triphenylene","cr",,,541 -"OBIGT",2487,"deoxyadenosine","cr",,,-2977 -"OBIGT",2494,"acetamide","cr",-67.91,, -"OBIGT",2610,"n-nonacontane","liq",,,635 -"OBIGT",2617,"2-methyloctane","liq",10,, -"OBIGT",3030,"5,6-dithiadecane","liq",2,, -"OBIGT",3104,"ethylene","gas",-4.59,, -"OBIGT",3114,"3,5-dimethylphenol","gas",,,628 +"OBIGT",1785,"Gly-Ala-Gly","aq",,-126.09, +"OBIGT",1786,"Gly-Arg+-Gly","aq",,-182.01, +"OBIGT",1787,"Gly-Asn-Gly","aq",,-145.77, +"OBIGT",1788,"Gly-Asp-Gly","aq",,-139.16, +"OBIGT",1789,"Gly-Cys-Gly","aq",,-139.2, +"OBIGT",1790,"Gly-Gln-Gly","aq",,-158.09, +"OBIGT",1791,"Gly-Glu-Gly","aq",,-155.4, +"OBIGT",1792,"Gly-Gly-Gly","aq",,-107.83, +"OBIGT",1793,"Gly-His-Gly","aq",,-167.84, +"OBIGT",1794,"Gly-Ile-Gly","aq",,-172.24, +"OBIGT",1795,"Gly-Leu-Gly","aq",,-171.74, +"OBIGT",1796,"Gly-Lys+-Gly","aq",,-175.45, +"OBIGT",1797,"Gly-Met-Gly","aq",,-172.45, +"OBIGT",1798,"Gly-Phe-Gly","aq",,-188.52, +"OBIGT",1799,"Gly-Pro-Gly","aq",,-140.68, +"OBIGT",1800,"Gly-Ser-Gly","aq",,-125.79, +"OBIGT",1801,"Gly-Thr-Gly","aq",,-141.19, +"OBIGT",1802,"Gly-Tyr-Gly","aq",,-190.24, +"OBIGT",1803,"Gly-Val-Gly","aq",,-155.72, +"OBIGT",1804,"[GXGBB]","aq",,-98.93, +"OBIGT",1866,"antigorite","cr1",,,812 +"OBIGT",1900,"clinochlore,7a","cr1",,,666 +"OBIGT",1919,"daphnite,14a","cr",,,-836 +"OBIGT",1944,"ferrosilite","cr1",,,694 +"OBIGT",1945,"ferrosilite","cr2",,,694 +"OBIGT",1960,"greenalite","cr",,,142507 +"OBIGT",1975,"hydromagnesite","cr",,,-2569 +"OBIGT",2112,"n-octadecane","cr",-2.63,, +"OBIGT",2113,"n-nonadecane","cr",-13.32,, +"OBIGT",2114,"n-eicosane","cr",-2.79,, +"OBIGT",2115,"n-heneicosane","cr",-8.61,, +"OBIGT",2116,"n-docosane","cr",-2.63,, +"OBIGT",2117,"n-tricosane","cr",-5.22,, +"OBIGT",2118,"n-tetracosane","cr",-2.02,, +"OBIGT",2119,"n-pentacosane","cr",-2.93,, +"OBIGT",2120,"n-hexacosane","cr",-1.29,, +"OBIGT",2121,"n-heptacosane","cr",-1.23,, +"OBIGT",2173,"carbazole","cr",-43.39,, +"OBIGT",2214,"triphenylene","cr",,,541 +"OBIGT",2509,"deoxyadenosine","cr",,,-2977 +"OBIGT",2516,"acetamide","cr",-67.91,, +"OBIGT",2633,"n-nonacontane","liq",,,635 +"OBIGT",2640,"2-methyloctane","liq",10,, +"OBIGT",3053,"5,6-dithiadecane","liq",2,, +"OBIGT",3127,"ethylene","gas",-4.59,, +"OBIGT",3137,"3,5-dimethylphenol","gas",,,628 "OBIGT-2",33,"AgCl2-","aq",1.65,, "OBIGT-2",36,"AgCl","aq",,-1.88, "OBIGT-2",39,"Cu+","aq",-5.84,-1.78, @@ -249,14 +245,9 @@ "OBIGT-2",100,"MnAsO4-","aq",-1.45,, "OBIGT-2",119,"methyldiethanolamine","aq",1.61,, "OBIGT-2",135,"aminophenols","aq",-1.55,, -"OBIGT-2",137,"pyruvate","aq",8.37,2.23, -"OBIGT-2",140,"oxaloacetate-2","aq",1.21,, -"OBIGT-2",144,"fumaric acid","aq",,6.38, -"OBIGT-2",150,"citric acid","aq",,2.62, -"OBIGT-2",153,"citrate-3","aq",,-1.34, -"OBIGT-2",154,"succinyl thioester","aq",,13.76, -"OBIGT-2",155,"succinyl thioester-1","aq",1.2,, -"OBIGT-2",254,"realgar","cr",3.14,, -"OBIGT-2",262,"Tb(OH)3","cr",,,-777 -"OBIGT-2",294,"jarosite","cr",,,20697 -"OBIGT-2",295,"natrojarosite","cr",,,17554 +"OBIGT-2",136,"succinyl thioester","aq",,13.76, +"OBIGT-2",137,"succinyl thioester-1","aq",1.2,, +"OBIGT-2",236,"realgar","cr",3.14,, +"OBIGT-2",244,"Tb(OH)3","cr",,,-777 +"OBIGT-2",276,"jarosite","cr",,,20697 +"OBIGT-2",277,"natrojarosite","cr",,,17554 Modified: pkg/CHNOSZ/man/protein.Rd =================================================================== --- pkg/CHNOSZ/man/protein.Rd 2016-12-19 04:17:18 UTC (rev 117) +++ pkg/CHNOSZ/man/protein.Rd 2016-12-21 11:10:04 UTC (rev 118) @@ -57,7 +57,7 @@ ## as a function of oxygen fugacity, after Dick, 2008, Fig. 5b # use old properties of [Met] to reproduce this example data(thermo) -add.obigt() +mod.obigt("[Met]", G=-35245, H=-59310) # make our protein list organisms <- c("METSC", "METJA", "METFE", "HALJP", "METVO", "METBU", "ACEKI", "GEOSE", "BACLI", "AERSA") Modified: pkg/CHNOSZ/man/protein.info.Rd =================================================================== --- pkg/CHNOSZ/man/protein.info.Rd 2016-12-19 04:17:18 UTC (rev 117) +++ pkg/CHNOSZ/man/protein.info.Rd 2016-12-21 11:10:04 UTC (rev 118) @@ -99,8 +99,8 @@ # clear out amino acid residues loaded by the example above # ( in affinity(iprotein=ip) ) data(thermo) -# load supplemental database to use "old" [Met] sidechain group -add.obigt() +# use properties of the "old" [Met] sidechain group (Dick et al., 2006) +mod.obigt("[Met]", G=-35245, H=-59310) # set up the basis species to those used in DS11 basis("CHNOS+") # note this yields logaH2 = -4.657486 Modified: pkg/CHNOSZ/man/read.expr.Rd =================================================================== --- pkg/CHNOSZ/man/read.expr.Rd 2016-12-19 04:17:18 UTC (rev 117) +++ pkg/CHNOSZ/man/read.expr.Rd 2016-12-21 11:10:04 UTC (rev 118) @@ -88,8 +88,8 @@ ## speciation diagram for ER.to.Golgi proteins (COPII coat ## proteins) as a function of logfO2, after Dick, 2009 -# add old parameters for [Met] sidechain to database -add.obigt() +# use old parameters for [Met] sidechain group +mod.obigt("[Met]", G=-35245, H=-59310) y <- yeastgfp("ER.to.Golgi") # don't use those with NA abundance ina <- is.na(y$abundance) Modified: pkg/CHNOSZ/tests/testthat/test-affinity.R =================================================================== --- pkg/CHNOSZ/tests/testthat/test-affinity.R 2016-12-19 04:17:18 UTC (rev 117) +++ pkg/CHNOSZ/tests/testthat/test-affinity.R 2016-12-21 11:10:04 UTC (rev 118) @@ -101,8 +101,8 @@ sites <- c("N", "S", "R", "Q", "P") aa <- read.aa(system.file("extdata/protein/DS11.csv", package="CHNOSZ")) ip <- add.protein(aa[1:5, ]) - # to reproduce, we need use the "old" parameters for [Met] - add.obigt() + # to reproduce, we need use the "old" parameters for [Met] from Dick et al., 2006 + mod.obigt("[Met]", G=-35245, H=-59310) a <- affinity(T=T, pH=pH, H2=H2, iprotein=ip) # divide A/2.303RT by protein length pl <- protein.length(ip) Modified: pkg/CHNOSZ/tests/testthat/test-ionize.aa.R =================================================================== --- pkg/CHNOSZ/tests/testthat/test-ionize.aa.R 2016-12-19 04:17:18 UTC (rev 117) +++ pkg/CHNOSZ/tests/testthat/test-ionize.aa.R 2016-12-21 11:10:04 UTC (rev 118) @@ -65,7 +65,7 @@ G.AMY_BACSU.25 <- c(-24.9, -24.9, -24.7, -24.5, -24.4, -23.9, -23.5, -23.2) G.AMY_BACSU.100 <- c(-26.7, -26.7, -26.4, -26.1, -25.7, -25.1, -24.9, -24.9) # calculate the Gibbs energies of the nonionized proteins using the same [Met] parameters as in the paper - add.obigt() + mod.obigt("[Met]", G=-35245, H=-59310) G.nonionized <- subcrt("AMY_BACSU", T=c(25, 100))$out[[1]]$G aa <- ip2aa(iprotein("AMY_BACSU")) G.ionization.25 <- ionize.aa(aa, "G", T=25, pH=seq(0, 14, 2))[,1] Modified: pkg/CHNOSZ/tests/testthat/test-iprotein.R =================================================================== --- pkg/CHNOSZ/tests/testthat/test-iprotein.R 2016-12-19 04:17:18 UTC (rev 117) +++ pkg/CHNOSZ/tests/testthat/test-iprotein.R 2016-12-21 11:10:04 UTC (rev 118) @@ -29,10 +29,9 @@ Cp <- 6415.5 V <- 10421 formula <- "C613H959N193O185S10" - # use add.obigt to load the parameters for [Met] sidechain group - # from above reference instead of the updated values - # from LaRowe and Dick, 2012 (Geochim Cosmochim Acta 80, 70-91) - add.obigt() + # use parameters for [Met] sidechain group from above reference + # (OBIGT.csv uses updated values from LaRowe and Dick, 2012 (Geochim Cosmochim Acta 80, 70-91)) + mod.obigt("[Met]", G=-35245, H=-59310) lprop <- info(info("LYSC_CHICK")) expect_equal(G, lprop$G) expect_equal(Cp, lprop$Cp, tolerance=1e-5) Modified: pkg/CHNOSZ/tests/testthat/test-protein.info.R =================================================================== --- pkg/CHNOSZ/tests/testthat/test-protein.info.R 2016-12-19 04:17:18 UTC (rev 117) +++ pkg/CHNOSZ/tests/testthat/test-protein.info.R 2016-12-21 11:10:04 UTC (rev 118) @@ -5,7 +5,7 @@ # test_that somehow affects capture.output so we set up the problem here protein <- iprotein(c("CSG_METVO", "CSG_METJA")) -suppressMessages(add.obigt()) +suppressMessages(mod.obigt("[Met]", G=-35245, H=-59310)) basis("CHNOS+") swap.basis("O2", "H2") pequil <- capture.output(protein.equil(protein, loga.protein=-3)) Modified: pkg/CHNOSZ/tests/testthat/test-subcrt.R =================================================================== --- pkg/CHNOSZ/tests/testthat/test-subcrt.R 2016-12-19 04:17:18 UTC (rev 117) +++ pkg/CHNOSZ/tests/testthat/test-subcrt.R 2016-12-21 11:10:04 UTC (rev 118) @@ -9,8 +9,6 @@ test_that("unbalanced reactions are balanced given sufficient basis species", { basis("CHNOS") - # since it doesn't alter the species indices of the basis species, this can come second ... - add.obigt() s <- subcrt(c("malic acid", "citric acid"), c(-1, 1)) expect_equal(s$reaction$coeff, c(-1, 1, -2, -1, 1.5)) expect_equal(s$reaction$name, c("malic acid", "citric acid", "CO2", "water", "oxygen")) Modified: pkg/CHNOSZ/tests/testthat/test-util.data.R =================================================================== --- pkg/CHNOSZ/tests/testthat/test-util.data.R 2016-12-19 04:17:18 UTC (rev 117) +++ pkg/CHNOSZ/tests/testthat/test-util.data.R 2016-12-21 11:10:04 UTC (rev 118) @@ -35,13 +35,13 @@ }) test_that("add.obigt() replaces existing entries without changing species index", { - # store the original species index of citric acid - icitric <- info("citric acid", "aq") - # add supplemental database - includes citric acid + # store the original species index of Al+3 + iAl <- info("Al+3", "aq") + # add supplemental database - includes Al+3 file <- system.file("extdata/thermo/OBIGT-2.csv", package="CHNOSZ") isp <- add.obigt(file, force=TRUE) - # species index of citric acid should not have changed - expect_equal(info("citric acid", "aq"), icitric) + # species index of Al+3 should not have changed + expect_equal(info("Al+3", "aq"), iAl) # check that names of species modified are same as in file newdat <- read.csv(file, stringsAsFactors=FALSE) # the order isn't guaranteed ... just make sure they're all there Modified: pkg/CHNOSZ/vignettes/equilibrium.Rnw =================================================================== --- pkg/CHNOSZ/vignettes/equilibrium.Rnw 2016-12-19 04:17:18 UTC (rev 117) +++ pkg/CHNOSZ/vignettes/equilibrium.Rnw 2016-12-21 11:10:04 UTC (rev 118) @@ -1,4 +1,4 @@ -%% LyX 2.1.4 created this file. For more info, see http://www.lyx.org/. +%% LyX 2.2.2 created this file. For more info, see http://www.lyx.org/. %% Do not edit unless you really know what you are doing. \documentclass[english,round]{article} \usepackage{mathpazo} @@ -15,7 +15,7 @@ \usepackage[authoryear]{natbib} \usepackage[unicode=true,pdfusetitle, bookmarks=true,bookmarksnumbered=false,bookmarksopen=false, - breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=true] + breaklinks=false,pdfborder={0 0 0},pdfborderstyle={},backref=false,colorlinks=true] {hyperref} \hypersetup{ citecolor=magenta, urlcolor=blue} @@ -43,10 +43,8 @@ options(digits=3) @ - \title{Equilibrium in CHNOSZ} - \author{Jeffrey M. Dick} \maketitle @@ -56,7 +54,6 @@ diagrams) and includes an Appendix on details of the equilibration calculations. - \section{Concepts} \begin{description} \item [{Species~of~interest}] Chemical species for which you want to @@ -143,7 +140,6 @@ (also with a derivation of energetic distance from equilibrium using the \textbf{starred affinity}). - \section{Organization} The function sequences below assume you have already defined the basis @@ -221,7 +217,6 @@ \section{Examples} - \subsection{Amino acids} Basis species: $\mathrm{CO_{2}}$, $\mathrm{H_{2}O}$, $\mathrm{NH_{3}}$, @@ -586,14 +581,12 @@ \clearpage - \section{Applications} Many of the help-page examples and demos in CHNOSZ use these methods to reproduce (or closely emulate) published figures. Below is not a comprehensive list, but just some highlights. - \subsection{Maximum affinity method} \begin{itemize} \item The ``Aqueous Aluminum'' example in \texttt{?diagram} shows predominance @@ -602,8 +595,8 @@ for minerals (balance $\ne$ 1, after \citealp{Hel70c}). \item Next is an example of using \emph{unequal activities} of species (mineral activity = 1; variable aqueous species activity indicated by the contours -(logarithm of activity)) to plot aqueous species -- mineral stability -boundaries (balance = 1, after Figure 14 of \citealp{Pou49}). +(logarithm of activity)) to plot aqueous species \textendash{} mineral +stability boundaries (balance = 1, after Figure 14 of \citealp{Pou49}). \end{itemize} <>= basis(c("Cu+2", "H2O", "H+", "e-")) @@ -620,7 +613,6 @@ @ - \subsection{Equilibration method} \begin{itemize} \item Speciation of reduced and oxidized glutathione, after \citet{SB01}. @@ -714,7 +706,6 @@ The results shows that two approaches are equivalent when the molar formulas are normalized. - \section{Standard states, the ideal approximation and sources of data} By chemical activity we mean the quantity $a_{i}$ that appears in @@ -740,19 +731,15 @@ For the CSG examples below, we would like to reproduce exactly the values appearing in publications. Because recent versions of CHNOSZ incorporate data updates for the methionine sidechain group, we should -therefore revert to the previous values before proceeding. The \texttt{add.obigt()} -function does just that, as well as adds other species from the supplemental -database provided with CHNOSZ: +therefore revert to the previous values \citep{DLH06} before proceeding. <>= data(thermo) -add.obigt() +mod.obigt("[Met]", G=-35245, H=-59310) @ - \section{Reaction-matrix approach} - \subsection{CSG Example: Whole formulas} Let us calculate the equilibrium activities of two proteins in metastable @@ -856,7 +843,6 @@ 553\times a_{\mathrm{CSG\_METVO}}+530\times a_{\mathrm{CSG\_METJA}}=1.083\,.\label{eq:a_residue} \end{equation} - At equilibrium, the affinities of the formation reactions, per conserved quantity (in this case protein backbone groups) are equal. Therefore $\boldsymbol{A}=\boldsymbol{A}_{3}/553=\boldsymbol{A}_{4}/530$ is @@ -869,7 +855,7 @@ \begin{equation} \boldsymbol{A}/2.303RT=\left(314.1877-\log a_{\mathrm{CSG\_METJA}}\right)/530\,.\label{eq:A_METJA} \end{equation} -Now we have three equations (\ref{eq:a_residue}--\ref{eq:A_METJA}) +Now we have three equations (\ref{eq:a_residue}\textendash \ref{eq:A_METJA}) with three unknowns. The solution can be displayed in CHNOSZ as follows. Because the balancing coefficients differ from unity, the function called by \texttt{equilibrate()} in this case is \texttt{equil.reaction()}, @@ -890,7 +876,6 @@ equilibrium. Later we explain the concept of using residue equivalents of the proteins to achieve a different result. - \subsection{Implementing the reaction-matrix approach} CHNOSZ implements a method for solving the system of equations that @@ -925,7 +910,6 @@ and may give a warning about poor convergence if a certain tolerance is not reached. - \subsection{CSG Example: normalized formulas (residue equivalents)} Let us consider the formation reactions of the normalized formulas @@ -992,10 +976,8 @@ normalize = TRUE)}. Instead, because balance = 1, the Boltzmann distribution, which is faster, can be used. - \section{Boltzmann distribution} - \subsection{CSG Example: Normalized formulas} An expression for Boltzmann distribution, relating equilibrium activities @@ -1015,10 +997,8 @@ arrive at $a_{12}=0.3065982$ and $a_{13}=0.7764018$, the same result as above. - \section{Notes on implementation} - \subsection{CSG example: another look} All the tedium of writing reactions, calculating affinities, etc., @@ -1049,7 +1029,6 @@ can be multiplied by $\ln10$ to get the values shown above in Eqs. \ref{eq:A_METVO_residue} and \ref{eq:A_METJA_residue}.) - \subsection{Visualizing the effects of normalization} A comparison of equilibrium calculations that do and do not use normalized @@ -1114,7 +1093,6 @@ might also be relevant to other systems where the molecules are in various stages of polymerization. - \section*{Document history} \begin{itemize} \item 2009-11-29 Initial version containing CSG example (title: Calculating Modified: pkg/CHNOSZ/vignettes/equilibrium.lyx =================================================================== --- pkg/CHNOSZ/vignettes/equilibrium.lyx 2016-12-19 04:17:18 UTC (rev 117) +++ pkg/CHNOSZ/vignettes/equilibrium.lyx 2016-12-21 11:10:04 UTC (rev 118) @@ -1,7 +1,9 @@ -#LyX 2.1 created this file. For more info see http://www.lyx.org/ -\lyxformat 474 +#LyX 2.2 created this file. For more info see http://www.lyx.org/ +\lyxformat 508 \begin_document \begin_header +\save_transient_properties true +\origin unavailable \textclass article \begin_preamble %\VignetteIndexEntry{Equilibrium in CHNOSZ} @@ -20,16 +22,16 @@ \language_package default \inputencoding auto \fontencoding global -\font_roman palatino -\font_sans lmss -\font_typewriter lmtt -\font_math auto +\font_roman "palatino" "default" +\font_sans "lmss" "default" +\font_typewriter "lmtt" "default" +\font_math "auto" "auto" \font_default_family default \use_non_tex_fonts false \font_sc false \font_osf false -\font_sf_scale 100 -\font_tt_scale 100 +\font_sf_scale 100 100 +\font_tt_scale 100 100 \graphics default \default_output_format default \output_sync 0 @@ -557,6 +559,10 @@ \begin_layout Enumerate Maximum affinity method, balance = 1 +\begin_inset Separator latexpar +\end_inset + + \end_layout \begin_deeper @@ -593,6 +599,10 @@ \end_deeper \begin_layout Enumerate Equilibration method, balance = 1 [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/chnosz -r 118