[CHNOSZ-commits] r383 - in pkg/CHNOSZ: . R demo inst inst/extdata/OBIGT man tests/testthat vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Feb 7 02:19:56 CET 2019


Author: jedick
Date: 2019-02-07 02:19:55 +0100 (Thu, 07 Feb 2019)
New Revision: 383

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/R/protein.info.R
   pkg/CHNOSZ/demo/Shh.R
   pkg/CHNOSZ/demo/bugstab.R
   pkg/CHNOSZ/demo/copper.R
   pkg/CHNOSZ/demo/protein.equil.R
   pkg/CHNOSZ/demo/yeastgfp.R
   pkg/CHNOSZ/inst/NEWS
   pkg/CHNOSZ/inst/extdata/OBIGT/OldAA.csv
   pkg/CHNOSZ/man/protein.Rd
   pkg/CHNOSZ/tests/testthat/test-add.protein.R
   pkg/CHNOSZ/tests/testthat/test-affinity.R
   pkg/CHNOSZ/tests/testthat/test-ionize.aa.R
   pkg/CHNOSZ/tests/testthat/test-protein.info.R
   pkg/CHNOSZ/vignettes/anintro.Rmd
   pkg/CHNOSZ/vignettes/equilibrium.Rnw
   pkg/CHNOSZ/vignettes/equilibrium.lyx
   pkg/CHNOSZ/vignettes/hotspring.Rnw
   pkg/CHNOSZ/vignettes/hotspring.lyx
   pkg/CHNOSZ/vignettes/vig.bib
Log:
add methionine and [Met] to OBIGT/OldAA.csv


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2019-02-06 17:29:09 UTC (rev 382)
+++ pkg/CHNOSZ/DESCRIPTION	2019-02-07 01:19:55 UTC (rev 383)
@@ -1,6 +1,6 @@
-Date: 2019-02-06
+Date: 2019-02-07
 Package: CHNOSZ
-Version: 1.1.3-90
+Version: 1.1.3-91
 Title: Thermodynamic Calculations and Diagrams for Geochemistry
 Authors at R: c(
     person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"),

Modified: pkg/CHNOSZ/R/protein.info.R
===================================================================
--- pkg/CHNOSZ/R/protein.info.R	2019-02-06 17:29:09 UTC (rev 382)
+++ pkg/CHNOSZ/R/protein.info.R	2019-02-07 01:19:55 UTC (rev 383)
@@ -148,8 +148,14 @@
 }
 
 protein.equil <- function(protein, T=25, loga.protein=0, digits=4) {
+  out <- character()
+  mymessage <- function(...) {
+    message(...)
+    text <- paste(list(...), collapse = " ")
+    out <<- c(out, text)
+  }
   # show the individual steps in calculating metastable equilibrium among proteins
-  message("protein.equil: temperature from argument is ", T, " degrees C")
+  mymessage("protein.equil: temperature from argument is ", T, " degrees C")
   TK <- convert(T, "K")
   # get the amino acid compositions of the proteins
   aa <- pinfo(pinfo(protein))
@@ -165,13 +171,13 @@
     ionize.it <- TRUE
     iword <- "ionized"
     pH <- -thermo$basis$logact[match("H+", rownames(bmat))]
-    message("protein.equil: pH from thermo$basis is ", pH)
+    mymessage("protein.equil: pH from thermo$basis is ", pH)
   }
   # tell the user whose [Met] is in thermo$obigt
   info.Met <- info(info('[Met]', "aq"))
-  message("protein.equil: [Met] is from reference ", info.Met$ref1)
+  mymessage("protein.equil: [Met] is from reference ", info.Met$ref1)
   ## first set of output: show results of calculations for a single protein
-  message("protein.equil [1]: first protein is ", pname[1], " with length ", plength[1])
+  mymessage("protein.equil [1]: first protein is ", pname[1], " with length ", plength[1])
   # standard Gibbs energies of basis species
   G0basis <- unlist(suppressMessages(subcrt(thermo$basis$ispecies, T=T, property="G")$out))
   # coefficients of basis species in formation reactions of proteins
@@ -182,71 +188,72 @@
   G0prot <- unlist(suppressMessages(subcrt(pname, T=T, property="G")$out))
   # standard Gibbs energy of formation reaction of nonionized protein, cal/mol
   G0protform <- G0prot - G0basissum
-  message("protein.equil [1]: reaction to form nonionized protein from basis species has G0(cal/mol) of ", signif(G0protform[1], digits))
+  mymessage("protein.equil [1]: reaction to form nonionized protein from basis species has G0(cal/mol) of ", signif(G0protform[1], digits))
   if(ionize.it) {
     # standard Gibbs energy of ionization of protein, cal/mol
     G0ionization <- suppressMessages(ionize.aa(aa, property="G", T=T, pH=pH))[1, ]
-    message("protein.equil [1]: ionization reaction of protein has G0(cal/mol) of ", signif(G0ionization[1], digits))
+    mymessage("protein.equil [1]: ionization reaction of protein has G0(cal/mol) of ", signif(G0ionization[1], digits))
     # standard Gibbs energy of formation reaction of ionized protein, cal/mol
     G0protform <- G0protform + G0ionization
   }
   # standard Gibbs energy of formation reaction of non/ionized residue equivalents, dimensionless
   R <- 1.9872  # gas constant, cal K^-1 mol^-1
   G0res.RT <- G0protform/R/TK/plength
-  message("protein.equil [1]: per residue, reaction to form ", iword, " protein from basis species has G0/RT of ", signif(G0res.RT[1], digits))
+  mymessage("protein.equil [1]: per residue, reaction to form ", iword, " protein from basis species has G0/RT of ", signif(G0res.RT[1], digits))
   # coefficients of basis species in formation reactions of residues
   resbasis <- suppressMessages(protein.basis(aa, T=T, normalize=TRUE))
   # logQstar and Astar/RT
   logQstar <- colSums(t(resbasis) * - thermo$basis$logact)
-  message("protein.equil [1]: per residue, logQstar is ", signif(logQstar[1], digits))
+  mymessage("protein.equil [1]: per residue, logQstar is ", signif(logQstar[1], digits))
   Astar.RT <- -G0res.RT - log(10)*logQstar
-  message("protein.equil [1]: per residue, Astar/RT = -G0/RT - 2.303logQstar is ", signif(Astar.RT[1], digits))
-  if(!is.numeric(protein)) message("protein.equil [1]: not comparing calculations with affinity() because 'protein' is not numeric")
+  mymessage("protein.equil [1]: per residue, Astar/RT = -G0/RT - 2.303logQstar is ", signif(Astar.RT[1], digits))
+  if(!is.numeric(protein)) mymessage("protein.equil [1]: not comparing calculations with affinity() because 'protein' is not numeric")
   else {
     # for **Astar** we have to set the activities of the proteins to zero, not loga.protein!
     a <- suppressMessages(affinity(iprotein=protein, T=T, loga.protein=0))
     aAstar.RT <- log(10) * as.numeric(a$values) / plength
-    message("check it!       per residue, Astar/RT calculated using affinity() is ", signif(aAstar.RT[1], digits))
+    mymessage("check it!       per residue, Astar/RT calculated using affinity() is ", signif(aAstar.RT[1], digits))
     if(!isTRUE(all.equal(Astar.RT, aAstar.RT, check.attributes=FALSE)))
       stop("Bug alert! The same value for Astar/RT cannot be calculated manually as by using affinity()")
   }
-  if(length(pname)==1) message("protein.equil [all]: all done... give me more than one protein for equilibrium calculations")
+  if(length(pname)==1) mymessage("protein.equil [all]: all done... give me more than one protein for equilibrium calculations")
   else {
     ## next set of output: equilibrium calculations
-    message("protein.equil [all]: lengths of all proteins are ", paste(plength, collapse=" "))
-    message("protein.equil [all]: Astar/RT of all residue equivalents are ", paste(signif(Astar.RT, digits), collapse=" "))
+    mymessage("protein.equil [all]: lengths of all proteins are ", paste(plength, collapse=" "))
+    mymessage("protein.equil [all]: Astar/RT of all residue equivalents are ", paste(signif(Astar.RT, digits), collapse=" "))
     expAstar.RT <- exp(Astar.RT)
     sumexpAstar.RT <- sum(expAstar.RT)
-    message("protein.equil [all]: sum of exp(Astar/RT) of all residue equivalents is ", signif(sumexpAstar.RT, digits))
+    mymessage("protein.equil [all]: sum of exp(Astar/RT) of all residue equivalents is ", signif(sumexpAstar.RT, digits))
     # boltzmann distribution
     alpha <- expAstar.RT / sumexpAstar.RT    
-    message("protein.equil [all]: equilibrium degrees of formation (alphas) of residue equivalents are ", paste(signif(alpha, digits), collapse=" "))
+    mymessage("protein.equil [all]: equilibrium degrees of formation (alphas) of residue equivalents are ", paste(signif(alpha, digits), collapse=" "))
     # check with equilibrate()
     if(is.numeric(protein)) {
       loga.equil.protein <- unlist(suppressMessages(equilibrate(a, normalize=TRUE))$loga.equil)
       # here we do have to convert from logarithms of activities of proteins to degrees of formation of residue equivalents
       a.equil.residue <- plength*10^loga.equil.protein
       ealpha <- a.equil.residue/sum(a.equil.residue)
-      message("check it!     alphas of residue equivalents from equilibrate() are ", paste(signif(ealpha, digits), collapse=" "))
+      mymessage("check it!     alphas of residue equivalents from equilibrate() are ", paste(signif(ealpha, digits), collapse=" "))
       if(!isTRUE(all.equal(alpha, ealpha, check.attributes=FALSE)))
         stop("Bug alert! The same value for alpha cannot be calculated manually as by using equilibrate()")
     }
     # total activity of residues
     loga.residue <- log10(sum(plength * 10^loga.protein))
-    message("protein.equil [all]: for activity of proteins equal to 10^", signif(loga.protein, digits), ", total activity of residues is 10^", signif(loga.residue, digits))
+    mymessage("protein.equil [all]: for activity of proteins equal to 10^", signif(loga.protein, digits), ", total activity of residues is 10^", signif(loga.residue, digits))
     # equilibrium activities of residues
     loga.residue.equil <- log10(alpha*10^loga.residue)
-    message("protein.equil [all]: log10 equilibrium activities of residue equivalents are ", paste(signif(loga.residue.equil, digits), collapse=" "))
+    mymessage("protein.equil [all]: log10 equilibrium activities of residue equivalents are ", paste(signif(loga.residue.equil, digits), collapse=" "))
     # equilibrium activities of proteins
     loga.protein.equil <- log10(10^loga.residue.equil/plength)
-    message("protein.equil [all]: log10 equilibrium activities of proteins are ", paste(signif(loga.protein.equil, digits), collapse=" "))
+    mymessage("protein.equil [all]: log10 equilibrium activities of proteins are ", paste(signif(loga.protein.equil, digits), collapse=" "))
     # check with equilibrate()
     if(is.numeric(protein)) {
       eloga.protein.equil <- unlist(suppressMessages(equilibrate(a, loga.balance=loga.residue, normalize=TRUE))$loga.equil)
-      message("check it!    log10 eq'm activities of proteins from equilibrate() are ", paste(signif(eloga.protein.equil, digits), collapse=" "))
+      mymessage("check it!    log10 eq'm activities of proteins from equilibrate() are ", paste(signif(eloga.protein.equil, digits), collapse=" "))
       if(!isTRUE(all.equal(loga.protein.equil, eloga.protein.equil, check.attributes=FALSE)))
         stop("Bug alert! The same value for log10 equilibrium activities of proteins cannot be calculated manually as by using equilibrate()")
     }
   }
+  return(out)
 }
 

Modified: pkg/CHNOSZ/demo/Shh.R
===================================================================
--- pkg/CHNOSZ/demo/Shh.R	2019-02-06 17:29:09 UTC (rev 382)
+++ pkg/CHNOSZ/demo/Shh.R	2019-02-07 01:19:55 UTC (rev 383)
@@ -1,8 +1,8 @@
 # Compare affinities of Sonic hedgehog and transcription factors involved in dorsal-ventral patterning
 # (Dick, 2015. Chemical integration of proteins in signaling and development. https://doi.org/10.1101/015826)
 
-# to reproduce the calculations in the paper, use superseded data for [Gly] 20190206
-add.obigt("OldAA")
+# to reproduce the calculations in the paper, use superseded data for [Gly] and [UPBB] 20190206
+add.obigt("OldAA", c("[Gly]", "[UPBB]"))
 
 # UniProt names of the proteins
 pname <- c("SHH", "OLIG2", "NKX22", "FOXA2", "IRX3", "PAX6", "NKX62", "DBX1",

Modified: pkg/CHNOSZ/demo/bugstab.R
===================================================================
--- pkg/CHNOSZ/demo/bugstab.R	2019-02-06 17:29:09 UTC (rev 382)
+++ pkg/CHNOSZ/demo/bugstab.R	2019-02-07 01:19:55 UTC (rev 383)
@@ -2,8 +2,8 @@
 # based on "bugstab" function in Supporting Information of Dick, 2016
 # (https://doi.org/10.7717/peerj.2238)
 
-# to reproduce the calculations in the paper, use superseded data for [Gly] 20190206
-add.obigt("OldAA")
+# to reproduce the calculations in the paper, use superseded data for [Gly] and [UPBB] 20190206
+add.obigt("OldAA", c("[Gly]", "[UPBB]"))
 # set up graphics device
 layout(cbind(matrix(sapply(list(c(1, 2), c(3, 4)), function(x) rep(rep(x, each=3), 3)), nrow=6, byrow=TRUE),
              matrix(rep(c(0, 5, 5, 5, 5, 0), each=4), nrow=6, byrow=TRUE)))

Modified: pkg/CHNOSZ/demo/copper.R
===================================================================
--- pkg/CHNOSZ/demo/copper.R	2019-02-06 17:29:09 UTC (rev 382)
+++ pkg/CHNOSZ/demo/copper.R	2019-02-07 01:19:55 UTC (rev 383)
@@ -3,7 +3,7 @@
 ## (Aksu, S. and Doyle, F. M., 2001. Electrochemistry of copper in aqueous glycine 
 ## solutions. J. Electrochem. Soc., 148, B51-B57. doi:10.1149/1.1344532)
 
-# we need some superseded Cu-Gly complexes 20190206
+# we need superseded data for Cu-Gly complexes 20190206
 add.obigt("OldAA")
 # add some new species to thermo$obigt
 m1 <- makeup(info(c("Cu+", "glycinate", "glycinate")), sum=TRUE)

Modified: pkg/CHNOSZ/demo/protein.equil.R
===================================================================
--- pkg/CHNOSZ/demo/protein.equil.R	2019-02-06 17:29:09 UTC (rev 382)
+++ pkg/CHNOSZ/demo/protein.equil.R	2019-02-07 01:19:55 UTC (rev 383)
@@ -4,9 +4,7 @@
 # clear out amino acid residues loaded by the example above
 # ( in affinity(iprotein=ip) )
 data(thermo)
-# use properties of the "old" [Met] sidechain group (Dick et al., 2006)
-mod.obigt("[Met]", G=-35245, H=-59310)
-# also use parameters for [Gly] from DLH06 20190206
+# use superseded properties of [Met], [Gly], and [UPBB] (Dick et al., 2006)
 add.obigt("OldAA")
 # set up the basis species to those used in DS11
 basis("CHNOS+")
@@ -27,5 +25,5 @@
 Aref.residue <- Astar.residue - loga.residue  # 0.446, after Eq. 16
 # A-star of the residue in natural log units (A/RT)
 log(10) * Astar.residue  # 0.4359, after Eq. 23
-# forget about the old [Met] group for whatever comes next
+# forget about the superseded group properties for whatever comes next
 data(thermo)

Modified: pkg/CHNOSZ/demo/yeastgfp.R
===================================================================
--- pkg/CHNOSZ/demo/yeastgfp.R	2019-02-06 17:29:09 UTC (rev 382)
+++ pkg/CHNOSZ/demo/yeastgfp.R	2019-02-07 01:19:55 UTC (rev 383)
@@ -1,9 +1,7 @@
 ## Oxygen fugacity - activity of H2O predominance 
 ## diagrams for proteologs for 23 YeastGFP localizations
-# use old properties of [Met] (Dick et al., 2006) to reproduce this example
+# use superseded properties of [Met], [Gly], and [UPBB] (Dick et al., 2006)
 data(thermo)
-mod.obigt("[Met]", G=-35245, H=-59310)
-# also use parameters for [Gly] from DLH06 20190206
 add.obigt("OldAA")
 # arranged by decreasing metastability:
 # order of this list of locations is based on the 

Modified: pkg/CHNOSZ/inst/NEWS
===================================================================
--- pkg/CHNOSZ/inst/NEWS	2019-02-06 17:29:09 UTC (rev 382)
+++ pkg/CHNOSZ/inst/NEWS	2019-02-07 01:19:55 UTC (rev 383)
@@ -1,4 +1,4 @@
-CHANGES IN CHNOSZ 1.1.3-90 (2019-02-06)
+CHANGES IN CHNOSZ 1.1.3-91 (2019-02-07)
 ---------------------------------------
 
 BUG FIXES
@@ -168,8 +168,12 @@
 
 - Add or update glycine, diglycine, and triglycine (zwitterions and
   ions), and diketopiperazine, [Gly] and [UPBB] groups from Kitadai,
-  2014. Superseded data have been moved to OBIGT/OldAA.csv.
+  2014.
 
+- For reproducing previous calculations, superseded data for [Gly] and
+  [UPBB], as well as [Met] (earlier superseded by LaRowe and Dick,
+  2012), have been moved to OBIGT/OldAA.csv.
+
 DIAGRAMS
 
 - Lines in 1-D diagram()s can optionally be drawn as splines using the

Modified: pkg/CHNOSZ/inst/extdata/OBIGT/OldAA.csv
===================================================================
--- pkg/CHNOSZ/inst/extdata/OBIGT/OldAA.csv	2019-02-06 17:29:09 UTC (rev 382)
+++ pkg/CHNOSZ/inst/extdata/OBIGT/OldAA.csv	2019-02-07 01:19:55 UTC (rev 383)
@@ -5,7 +5,9 @@
 diketopiperazine,NA,C4H6N2O2,aq,Sho92,CHNOSZ.6,28.Feb.92,-57440,-99300,53.5,17,76.73,12.1058,16.0764,11.6608,-3.4435,19.5904,-3.4064,-0.4702,0
 glycine,Gly,C2H5NO2,aq,"AH97b.2 [S07]","DLH06.1 [S07]",25.Aug.06,-90950,-124780,39.29,9.3,43.2,11.3,0.71,3.99,-3.04,28.5,-8.4,0.23,0
 glycinium,Gly+,C2H6NO2+,aq,"AH97b.2 [S07]","DLH06.1 [S07]",25.Aug.06,-94160,-125720,46.91,40,56.4,19.57,-7.58,-40.35,5.41,49,-1.8,0.59,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
 [Gly],NA,H,aq,"DLH06 [S15]",NA,25.Aug.06,-6075,-5570,17.31,11.371,9.606,1.83,2.57,1.22,-1.27,6.9,2.2,0,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
 [UPBB],NA,C2H2NO,aq,"DLH06 [S15]",NA,25.Aug.06,-21436,-45220,1.62,-4.496,26.296,8.1,-3.75,-6.73,1.13,11.2,-7.5,0.05,0
 alanate,NA,C3H6NO2-,aq,"SK95.1 [S98]",AH97b.1,3.Sep.06,-75360,-121470,30.71,17.8,61.88,10.6281,17.3648,0.6505,-3.4968,12.685,-4.1859,1.17,-1
 glycinate,NA,C2H4NO2-,aq,"SK95.1 [S98]",AH97b.1,3.Sep.06,-77610,-114190,30.07,-6.6,43.77,8.1592,11.7696,1.921,-3.2655,12.9389,-4.1859,1.1975,-1

Modified: pkg/CHNOSZ/man/protein.Rd
===================================================================
--- pkg/CHNOSZ/man/protein.Rd	2019-02-06 17:29:09 UTC (rev 382)
+++ pkg/CHNOSZ/man/protein.Rd	2019-02-07 01:19:55 UTC (rev 383)
@@ -29,9 +29,10 @@
 
 ## surface-layer proteins from Methanococcus and others
 ## as a function of oxygen fugacity, after Dick, 2008, Fig. 5b
-# use old properties of [Met] (Dick et al., 2006) to reproduce this example
+# to reproduce the calculations in the paper,
+# use superseded data for [Met], [Gly] and [UPBB]
 data(thermo)
-mod.obigt("[Met]", G=-35245, H=-59310)
+add.obigt("OldAA")
 # make our protein list
 organisms <- c("METSC", "METJA", "METFE", "HALJP", "METVO",
   "METBU", "ACEKI", "GEOSE", "BACLI", "AERSA")

Modified: pkg/CHNOSZ/tests/testthat/test-add.protein.R
===================================================================
--- pkg/CHNOSZ/tests/testthat/test-add.protein.R	2019-02-06 17:29:09 UTC (rev 382)
+++ pkg/CHNOSZ/tests/testthat/test-add.protein.R	2019-02-07 01:19:55 UTC (rev 383)
@@ -27,10 +27,7 @@
   Cp <- 6415.5
   V <- 10421
   formula <- "C613H959N193O185S10"
-  # use parameters for [Met] sidechain group from DLH06
-  # (OBIGT.csv uses updated values from LaRowe and Dick, 2012 (Geochim Cosmochim Acta 80, 70-91))
-  mod.obigt("[Met]", G=-35245, H=-59310)
-  # also use parameters for [Gly] from DLH06 20190206
+  # to reproduce, use superseded properties of [Met], [Gly], and [UPBB] (Dick et al., 2006)
   add.obigt("OldAA")
   lprop <- info(info("LYSC_CHICK"))
   expect_equal(G, lprop$G)

Modified: pkg/CHNOSZ/tests/testthat/test-affinity.R
===================================================================
--- pkg/CHNOSZ/tests/testthat/test-affinity.R	2019-02-06 17:29:09 UTC (rev 382)
+++ pkg/CHNOSZ/tests/testthat/test-affinity.R	2019-02-07 01:19:55 UTC (rev 383)
@@ -111,9 +111,7 @@
   file <- system.file("extdata/protein/DS11.csv", package="CHNOSZ")
   aa <- read.csv(file, as.is=TRUE)
   ip <- add.protein(aa[1:5, ])
-  # to reproduce, we need use the "old" parameters for [Met] from Dick et al., 2006
-  mod.obigt("[Met]", G=-35245, H=-59310)
-  # also use parameters for [Gly] from DLH06 20190206
+  # to reproduce, use superseded properties of [Met], [Gly], and [UPBB] (Dick et al., 2006)
   add.obigt("OldAA")
   a <- affinity(T=T, pH=pH, H2=H2, iprotein=ip)
   # divide A/2.303RT by protein length

Modified: pkg/CHNOSZ/tests/testthat/test-ionize.aa.R
===================================================================
--- pkg/CHNOSZ/tests/testthat/test-ionize.aa.R	2019-02-06 17:29:09 UTC (rev 382)
+++ pkg/CHNOSZ/tests/testthat/test-ionize.aa.R	2019-02-07 01:19:55 UTC (rev 383)
@@ -64,9 +64,7 @@
   # digitized from Fig. 12 of Dick et al., 2006
   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
-  mod.obigt("[Met]", G=-35245, H=-59310)
-  # also use parameters for [Gly] from DLH06 20190206
+  # to reproduce the calculations in the paper, use superseded properties of [Met], [Gly], and [UPBB]
   add.obigt("OldAA")
   G.nonionized <- subcrt("AMY_BACSU", T=c(25, 100))$out[[1]]$G
   aa <- pinfo(pinfo("AMY_BACSU"))

Modified: pkg/CHNOSZ/tests/testthat/test-protein.info.R
===================================================================
--- pkg/CHNOSZ/tests/testthat/test-protein.info.R	2019-02-06 17:29:09 UTC (rev 382)
+++ pkg/CHNOSZ/tests/testthat/test-protein.info.R	2019-02-07 01:19:55 UTC (rev 383)
@@ -13,22 +13,18 @@
   expect_equal(pinfo(c("LYSC_CHICK", "MYGPHYCA")), c(6, NA))
 })
 
-# 20170430 comment this section becuase `pequil` somehow is just empty
-# using the current development version of testthat (on Github)
-## test_that somehow affects capture.output so we set up the problem here
-#protein <- pinfo(c("CSG_METVO", "CSG_METJA"))
-#suppressMessages(mod.obigt("[Met]", G=-35245, H=-59310))
-#basis("CHNOS+")
-#suppressMessages(swap.basis("O2", "H2"))
-#pequil <- capture.output(protein.equil(protein, loga.protein=-3), type="message")
-#
-#test_that("protein.equil() reports values consistent with Dick and Shock (2011)", {
-#  # the Astar/RT in the paragraph following Eq. 23, p. 6 of DS11
-#  # (truncated because of rounding)
-#  expect_true(any(grepl(c("0\\.435.*1\\.36"), pequil)))
-#  # the log10 activities of the proteins in the left-hand column of the same page
-#  expect_true(any(grepl(c("-3\\.256.*-2\\.834"), pequil)))
-#})
+test_that("protein.equil() reports values consistent with Dick and Shock (2011)", {
+  protein <- pinfo(c("CSG_METVO", "CSG_METJA"))
+  suppressMessages(add.obigt("OldAA"))
+  basis("CHNOS+")
+  suppressMessages(swap.basis("O2", "H2"))
+  pequil <- protein.equil(protein, loga.protein=-3)
+  # the Astar/RT in the paragraph following Eq. 23, p. 6 of DS11
+  # (truncated because of rounding)
+  expect_true(any(grepl(c("0\\.435.*1\\.36"), pequil)))
+  # the log10 activities of the proteins in the left-hand column of the same page
+  expect_true(any(grepl(c("-3\\.256.*-2\\.834"), pequil)))
+})
 
 # references
 # Dick, J. M. and Shock, E. L. (2011) Calculation of the relative chemical stabilities of proteins 

Modified: pkg/CHNOSZ/vignettes/anintro.Rmd
===================================================================
--- pkg/CHNOSZ/vignettes/anintro.Rmd	2019-02-06 17:29:09 UTC (rev 382)
+++ pkg/CHNOSZ/vignettes/anintro.Rmd	2019-02-07 01:19:55 UTC (rev 383)
@@ -1522,15 +1522,13 @@
 logabundance <- unitize(log10(y$abundance[!ina]), pl)
 ```
 
-Now we can load the proteins and calculate their activities in metastable equilibrium as a function of `r logfO2`:
-```{marginfigure}
-The commented line uses <span style="color:red">`mod.obigt()`</span> and <span style="color:red">`add.obigt()`</span> to revert the parameters of the methionine and glycine sidechain groups to those present in older versions of CHNOSZ (Dick et al., 2006).
-The current database, with parameters set by <span style="color:red">`data(thermo)`</span> and used here, contains updated group additivity parameters for methionine (LaRowe and Dick, 2012).
-```
+Now we can load the proteins and calculate their activities in metastable equilibrium as a function of `r logfO2`.
+The commented line uses <span style="color:red">`add.obigt()`</span> to revert the group additivity parameters to those present in older versions of CHNOSZ (Dick et al., 2006).
+The current database, with parameters set by <span style="color:red">`data(thermo)`</span> and used here, contains updated group additivity parameters for the sidechain groups of methionine (LaRowe and Dick, 2012) and glycine and the protein backbone [@Kit14].
+
 ```{r yeastplot, eval=FALSE, echo=1:6}
 par(mfrow = c(1, 3))
 basis("CHNOS+")
-#mod.obigt("[Met]", G = -35245, H = -59310)
 #add.obigt("OldAA")
 a <- affinity(O2 = c(-80, -73), iprotein = ip, loga.protein = logact)
 e <- equilibrate(a)
@@ -1559,7 +1557,7 @@
 ```
 
 The minimum free energy difference occurs near `r logfO2` = -78.
-This agrees with the assessment shown in Figure 4 of @Dic09 (note that the old parameters for the methionine sidechain group were used in that study).
+This agrees with the assessment shown in Figure 4 of @Dic09 (but the updated group additivity parameters make the results slightly different).
 
 ## An affinity baseline
 

Modified: pkg/CHNOSZ/vignettes/equilibrium.Rnw
===================================================================
--- pkg/CHNOSZ/vignettes/equilibrium.Rnw	2019-02-06 17:29:09 UTC (rev 382)
+++ pkg/CHNOSZ/vignettes/equilibrium.Rnw	2019-02-07 01:19:55 UTC (rev 383)
@@ -714,13 +714,12 @@
 
 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 and glycine sidechain
-groups, we should therefore revert to the previous values \citep{DLH06}
-before proceeding.
+incorporate data updates for the protein backbone and methionine and
+glycine sidechain groups, we should therefore revert to the previous
+values \citep{DLH06} before proceeding.
 
 <<AddObigt>>=
 data(thermo)
-mod.obigt("[Met]", G=-35245, H=-59310)
 add.obigt("OldAA")
 @
 

Modified: pkg/CHNOSZ/vignettes/equilibrium.lyx
===================================================================
--- pkg/CHNOSZ/vignettes/equilibrium.lyx	2019-02-06 17:29:09 UTC (rev 382)
+++ pkg/CHNOSZ/vignettes/equilibrium.lyx	2019-02-07 01:19:55 UTC (rev 383)
@@ -3112,9 +3112,9 @@
 \begin_layout Standard
 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
- and glycine sidechain groups, we should therefore revert to the previous
- values 
+ Because recent versions of CHNOSZ incorporate data updates for the protein
+ backbone and methionine and glycine sidechain groups, we should therefore
+ revert to the previous values 
 \begin_inset CommandInset citation
 LatexCommand citep
 key "DLH06"
@@ -3141,11 +3141,6 @@
 
 \begin_layout Plain Layout
 
-mod.obigt("[Met]", G=-35245, H=-59310)
-\end_layout
-
-\begin_layout Plain Layout
-
 add.obigt(
 \begin_inset Quotes eld
 \end_inset

Modified: pkg/CHNOSZ/vignettes/hotspring.Rnw
===================================================================
--- pkg/CHNOSZ/vignettes/hotspring.Rnw	2019-02-06 17:29:09 UTC (rev 382)
+++ pkg/CHNOSZ/vignettes/hotspring.Rnw	2019-02-07 01:19:55 UTC (rev 383)
@@ -73,17 +73,16 @@
 the code.
 
 Load CHNOSZ and the thermodynamic database. In order to reproduce
-the calculations from the 2011 paper, we modify the methionine sidechain
-group using old values of standard Gibbs energy and enthalpy from
-\citep{DLH06}; these are inaccurate values that were updated by \citep{LD12}
-and are available starting in CHNOSZ\_0.9-9 (the current values are
-used further below). In addition, we load values for the glycine group
-that were superseded in 2019.
+the calculations from the 2011 paper, we load old values of standard
+Gibbs energy and enthalpy of the methionine sidechain group from \citep{DLH06};
+these are inaccurate values that were updated by \citep{LD12} and
+are available starting in CHNOSZ\_0.9-9 (the current values are used
+further below). This step also loads values for the glycine group
+and the protein backone {[}UPBB{]} that were superseded in 2019.
 
 <<libraryCHNOSZ>>=
 library(CHNOSZ)
 data(thermo)
-mod.obigt("[Met]", G=-35245, H=-59310)
 add.obigt("OldAA")
 @
 
@@ -414,7 +413,7 @@
   # use old [Met] for first row and new [Met] for second row
   if(j==2) {
     data(thermo)
-    add.obigt("OldAA")
+    add.obigt("OldAA", c("[Gly]", "[UPBB]"))
     ip.annot <- add.protein(aa.annot)
   }
   # setup basis species and proteins

Modified: pkg/CHNOSZ/vignettes/hotspring.lyx
===================================================================
--- pkg/CHNOSZ/vignettes/hotspring.lyx	2019-02-06 17:29:09 UTC (rev 382)
+++ pkg/CHNOSZ/vignettes/hotspring.lyx	2019-02-07 01:19:55 UTC (rev 383)
@@ -245,9 +245,9 @@
 
 \begin_layout Standard
 Load CHNOSZ and the thermodynamic database.
- In order to reproduce the calculations from the 2011 paper, we modify the
- methionine sidechain group using old values of standard Gibbs energy and
- enthalpy from 
+ In order to reproduce the calculations from the 2011 paper, we load old
+ values of standard Gibbs energy and enthalpy of the methionine sidechain
+ group from 
 \begin_inset CommandInset citation
 LatexCommand citep
 key "DLH06"
@@ -265,8 +265,8 @@
 
  and are available starting in CHNOSZ_0.9-9 (the current values are used
  further below).
- In addition, we load values for the glycine group that were superseded
- in 2019.
+ This step also loads values for the glycine group and the protein backone
+ [UPBB] that were superseded in 2019.
 \end_layout
 
 \begin_layout Standard
@@ -290,11 +290,6 @@
 
 \begin_layout Plain Layout
 
-mod.obigt("[Met]", G=-35245, H=-59310)
-\end_layout
-
-\begin_layout Plain Layout
-
 add.obigt(
 \begin_inset Quotes eld
 \end_inset
@@ -1820,7 +1815,23 @@
 \begin_inset Quotes erd
 \end_inset
 
-)
+, c(
+\begin_inset Quotes eld
+\end_inset
+
+[Gly]
+\begin_inset Quotes erd
+\end_inset
+
+, 
+\begin_inset Quotes eld
+\end_inset
+
+[UPBB]
+\begin_inset Quotes erd
+\end_inset
+
+))
 \end_layout
 
 \begin_layout Plain Layout

Modified: pkg/CHNOSZ/vignettes/vig.bib
===================================================================
--- pkg/CHNOSZ/vignettes/vig.bib	2019-02-06 17:29:09 UTC (rev 382)
+++ pkg/CHNOSZ/vignettes/vig.bib	2019-02-07 01:19:55 UTC (rev 383)
@@ -223,6 +223,19 @@
   doi           = {10.1016/0098-3004(92)90029-Q},
 }
 
+ at Article{Kit14,
+  author    = {Kitadai, Norio},
+  journal   = {Journal of Molecular Evolution},
+  title     = {{T}hermodynamic prediction of glycine polymerization as a function of temperature and p{H} consistent with experimentally obtained results},
+  year      = {2014},
+  volume    = {78},
+  number    = {3-4},
+  pages     = {171--187},
+  doi       = {10.1007/s00239-014-9616-1},
+  issn      = {0022-2844},
+  language  = {English},
+}
+
 @Article{LD12,
   author    = {LaRowe, Douglas E. and Dick, Jeffrey M.},
   journal   = {Geochimica et Cosmochimica Acta},



More information about the CHNOSZ-commits mailing list