[CHNOSZ-commits] r270 - in pkg/CHNOSZ: . R demo inst man man/macros vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Oct 30 04:40:14 CET 2017


Author: jedick
Date: 2017-10-30 04:40:13 +0100 (Mon, 30 Oct 2017)
New Revision: 270

Added:
   pkg/CHNOSZ/demo/carboxylase.R
Removed:
   pkg/CHNOSZ/R/anim.R
   pkg/CHNOSZ/man/anim.Rd
Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/NAMESPACE
   pkg/CHNOSZ/R/examples.R
   pkg/CHNOSZ/demo/00Index
   pkg/CHNOSZ/inst/NEWS
   pkg/CHNOSZ/man/CHNOSZ-package.Rd
   pkg/CHNOSZ/man/examples.Rd
   pkg/CHNOSZ/man/macros/macros.Rd
   pkg/CHNOSZ/man/util.array.Rd
   pkg/CHNOSZ/vignettes/anintro.Rmd
Log:
remove anim.TCA(); move anim.carboxylase() to demo/carboxylase.R


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2017-10-29 05:49:00 UTC (rev 269)
+++ pkg/CHNOSZ/DESCRIPTION	2017-10-30 03:40:13 UTC (rev 270)
@@ -1,6 +1,6 @@
-Date: 2017-10-29
+Date: 2017-10-30
 Package: CHNOSZ
-Version: 1.1.0-68
+Version: 1.1.0-69
 Title: Thermodynamic Calculations for Geobiochemistry
 Author: Jeffrey Dick
 Maintainer: Jeffrey Dick <j3ffdick at gmail.com>

Modified: pkg/CHNOSZ/NAMESPACE
===================================================================
--- pkg/CHNOSZ/NAMESPACE	2017-10-29 05:49:00 UTC (rev 269)
+++ pkg/CHNOSZ/NAMESPACE	2017-10-30 03:40:13 UTC (rev 270)
@@ -31,7 +31,6 @@
   "protein.obigt", "hkf", "cgl", "which.pmax",
   "equil.boltzmann", "equil.reaction", "find.tp",
   "ionize.aa", "MP90.cp", "aasum",
-  "anim.carboxylase",
   "qqr", "RMSD", "CVRMSD", "spearman", "DGmix", "DDGmix", "DGtr",
   "ratlab",
   "EOSregress", "EOScoeffs", "EOSplot", "EOSvar",
@@ -55,7 +54,7 @@
   "EOSlab", "EOScalc",
   "basis.elements", "element.mu", "ibasis",
   "water.SUPCRT92", "eqdata", "plot_findit",
-  "nonideal", "anim.TCA", "uniprot.aa", "run.guess",
+  "nonideal", "uniprot.aa", "run.guess",
 # added 20170301 or later
   "GHS_Tr", "calculateDensity", "calculateGibbsOfWater",
   "calculateEpsilon", "calculateQ", "water.DEW", "berman",

Deleted: pkg/CHNOSZ/R/anim.R
===================================================================
--- pkg/CHNOSZ/R/anim.R	2017-10-29 05:49:00 UTC (rev 269)
+++ pkg/CHNOSZ/R/anim.R	2017-10-30 03:40:13 UTC (rev 270)
@@ -1,202 +0,0 @@
-# CHNOSZ/anim.R
-# functions to make various animations
-
-anim.TCA <- function(redox=list(O2=c(-95,-60)),high.T=FALSE,
-  nframes=100,pHlim=c(0,10),width = 420, height = 320) {
-  # tricarboxylic acids 20100701, 20110204 jmd
-  # we depend on an empty png directory
-  if(!"png" %in% dir()) stop("directory 'png' not present")
-  else if(length(dir("png")) > 0) stop("directory 'png' not empty")
-  # expand default logfO2 range if we're at high temperature
-  if(high.T & missing(redox)) redox <- list(O2=c(-100,-40))
-  # the name of 'redox' should be either O2 or H2
-  basis(c("CO2","H2O",names(redox),"H+"))
-  # load the species in order of increasing degree of ionization
-  species(c("pyruvic acid","oxaloacetic acid","malic acid", # Z = 0
-    "fumaric acid","a-ketoglutaric acid","citric acid",
-    "pyruvate","H-oxaloacetate","H-malate","H-fumarate",    # Z = -1
-    "H-a-ketoglutarate","H2-citrate",
-    "oxaloacetate-2","malate-2","fumarate-2",               # Z = -2
-    "a-ketoglutarate-2","H-citrate-2",
-    "citrate-3"),rep("aq",18))                              # Z = -3
-  # start the plot device - multiple png figures
-  png(filename="png/Rplot%04d.png",width=width,height=height)
-  par(mar=c(3,3.5,1.5,1),mgp=c(1.9,1,0))
-  # leadin/out frames
-  # the variable(s) that change with each frame
-  pH <- seq(pHlim[1],pHlim[2],length.out=nframes)
-  pHres <- length(pH)
-  pHlim <- range(pH)
-  baseres <- 128
-  # calculate the affinity
-  redox[[1]] <- c(redox[[1]],baseres)
-  affargs <- c(redox,list(H2O=c(-10,10,baseres),pH=c(pHlim,pHres)))
-  a.cold <- do.call(affinity,affargs)
-  if(high.T) {
-    affargs <- c(affargs,list(T=100))
-    a.hot <- do.call(affinity,affargs)
-  }
-  # put the movie together
-  nframes.in <- 15
-  nframes.out <- 20
-  iframes <- c(rep(1,nframes.in),1:length(pH),rep(pHres,nframes.out))
-  for(i in 1:length(iframes)) {
-    print(paste("frame",i,"of",length(iframes),"at pH",pH[iframes[i]]))
-    # don't fill fields with heat colors if we're doing a high-T overlay
-    if(high.T) color <- "lightgrey" else color <- "heat"
-    # take a single O2-H2O slice along pH
-    diagram(slice.affinity(a.cold,3,iframes[i]),fill=color,cex=1.5)
-    ltext <- substitute(paste(italic(T)==x~degree*C),list(x=25))
-    lcol <- "black"
-    # overlay the high-T diagram
-    if(high.T) {
-      ltext <- c(ltext,substitute(paste(italic(T)==x~degree*C),list(x=100)))
-      lcol <- c(lcol,"red")
-      diagram(slice.affinity(a.hot,3,iframes[i]),add=TRUE,col="red",cex=1.5)
-    }
-    if(high.T) legend("topleft",legend=as.expression(ltext),lty=1,col=lcol)
-    title(main=paste("TCA cycle reactants; pH =",
-      format(round(pH[iframes[i]],2))),cex.main=1)
-  }
-  # close the plot device - convert to movie
-  dev.off()
-  cat("anim.TCA: converting to animated GIF...\n")
-  outfile <- "TCA.gif"
-  # convert tool from imagemagick.org; -loop 0 for infinite loop
-  syscmd <- paste("convert -loop 0 -delay 10 png/*.png png/",outfile,sep="")
-  cat(paste(syscmd,"\n"))
-  # we need shell() on windows for the paths to include ImageMagick
-  if(.Platform$OS.type=="unix") sres <- system(syscmd)
-  else sres <- shell(syscmd)
-  if(sres==0) cat(paste("anim.TCA: animation is at png/",outfile,"\n",sep=""))
-  else {
-    cat("anim.TCA: error converting to animated GIF\n")
-    cat("anim.TCA: check that 'convert' tool from ImageMagick is in your PATH\n")
-  }
-}
-
-anim.carboxylase <- function(T=25:125,ntop=5,lcex=0.8,width=420,height=320) {
-  # animate rank-activity diagrams over a temperature
-  # and logaH2 gradient, or plot a single one for a single temperature
-  # plot rank-activity diagrams for 24 carboxylases;
-  # 12 ribulose phosphate carboxylase
-  # 12 acetyl-coenzyme A carboxylase
-  # 6 of each type are nominally from mesophilic organisms
-  # and 6 from thermophilic organisms
-  # arranged here in order of increasing growth temperature
-  rubisco <- c("RBL_BRAJA","A6YF84_9PROT","A1E8R4_9CHLO","A8C9T6_9MYCO","A3EQE1_9BACT","A5CKC7_9CHRO",
-    "RBL_SYNJA","Q6JAI0_9RHOD","RBL_METJA","A3DND9_STAMF","A1RZJ5_THEPD","RBL_PYRHO")
-  rubisco.organisms <- c("a-proteobacterium-R","b-proteobacterium","Bracteacoccus","Mycobacterium",
-    "Leptospirillum","Cyanobium","Synechococcus","Cyanidiales",
-    "Methanococcus-R","Desulfurococcus","Thermofilum","Pyrococcus")
-  accoaco <- c("Q9F7M8_PRB01","ACCA_DEIRA","A6CDM2_9PLAN","A4AGS7_9ACTN","ACCA_CAUCR","A1VC70_DESVV",
-    "A6VIX9_METM7","Q2JSS7_SYNJA","A0GZU2_9CHLR","A7WGI1_9AQUI","Q05KD0_HYDTH","ACCA_AQUAE")
-  accoaco.organisms <- c("g-proteobacterium","Deinococcus","Planctomyces","Actinobacterium",
-    "a-proteobacterium-A","d-proteobacterium","Methanococcus-A","Synechococcus",
-    "Chloroflexus","Hydrogenobaculum","Hydrogenobacter","Aquifex")
-  # assemble them all
-  organisms <- c(rubisco.organisms,accoaco.organisms)
-  # new scheme 20090611: red for hot, blue for cold
-  # open for rubisco, filled for accoaco
-  col <- rep(c(rep("blue",6),rep("red",6)),2)
-  pch <- c(rep(c(0:2,5:7),2),rep(c(15:20),2))
-  # how many frames do we want?
-  res <- length(T)
-  if(res==1) ido <- 1
-  else {
-    # check for png directory
-    if(!"png" %in% dir()) stop("directory 'png' not present")
-    else if(length(dir("png")) > 0) stop("directory 'png' not empty")
-    # start the plot device - multiple png figures
-    png(filename="png/Rplot%04d.png",width=width,height=height)
-    # add counters for lead-in and lead-out frames
-    ido <- c(rep(1,15),1:res,rep(res,20))
-  }
-  # set up system
-  basis(c("CO2","H2O","NH3","H2","H2S","H+"),
-    c("aq","liq","aq","aq","aq","aq"),c(-3,0,-4,-6,-7,-7))
-  species(c(rubisco,accoaco))
-  # equation for logaH2 as a function of temperature
-  # from Dick and Shock, 2011
-  # http://dx.plos.org/10.1371/journal.pone.0022782
-  get.logaH2 <- function(T) return(-11+T*3/40)
-  H2 <- get.logaH2(T)
-  # calculate affinities
-  if(res==1) {
-    basis("H2",H2)
-    a <- affinity(T=T)
-  } else a <- affinity(T=T,H2=H2)
-  # calculate activities
-  e <- equilibrate(a, normalize=TRUE)
-  # for each point make a rank plot
-  rank <- 1:length(e$loga.equil)
-  for(i in 1:length(ido)) {
-    # print some progress
-    if(i%%20 == 0) cat("\n") else cat(".")
-    # keep track of positions of previous points
-    loga <- numeric()
-    for(j in 1:length(e$loga.equil)) loga <- c(loga, e$loga.equil[[j]][ido[i]])
-    if(i > 4) myrank4 <- myrank3
-    if(i > 3) myrank3 <- myrank2
-    if(i > 2) myrank2 <- myrank1
-    if(i > 1) myrank1 <- myrank
-    order <- order(loga,decreasing=TRUE)
-    myrank <- rank(loga)
-    cex <- rep(1.2,24)
-    # show changes by increasing point size
-    # any points that changed on the step before the step 
-    # before the step before?
-    if(i > 4) {
-      ichanged <- myrank3 != myrank4
-      cex[ichanged[order]] <- cex[ichanged[order]] + 0.1
-    }
-    # any points that changed on the step before the step before?
-    if(i > 3) {
-      ichanged <- myrank2 != myrank3
-      cex[ichanged[order]] <- cex[ichanged[order]] + 0.2
-    }
-   # any points that changed on the step before?
-    if(i > 2) {
-      ichanged <- myrank1 != myrank2
-      cex[ichanged[order]] <- cex[ichanged[order]] + 0.3
-    }
-    # any points that changed on this step?
-    if(i > 1) {
-      ichanged <- myrank != myrank1
-      cex[ichanged[order]] <- cex[ichanged[order]] + 0.4
-    }
-    plot(rank,loga[order],col=col[order],pch=pch[order],
-      ylab=expression(log~italic(a)),cex=cex,cex.main=1,cex.lab=1,cex.axis=1)
-    myT <- format(round(T,1))[ido[i]]
-    myH2 <- format(round(H2,2))[ido[i]]
-    title(main=substitute(list(X~degree*C, log*italic(a)[paste(H2)]==Y),
-      list(X=myT,Y=myH2)))
-    # legends showing highest and lowest few
-    legend("topright",legend=c(paste("top",ntop),organisms[order[1:ntop]]),
-      pch=c(NA,pch[order[1:ntop]]),col=c(NA,col[order[1:ntop]]),
-      pt.cex=c(NA,cex[1:ntop]),cex=lcex)
-    order <- order(loga)
-    legend("bottomleft",legend=c(paste("low",ntop),organisms[order[ntop:1]]),
-      pch=c(NA,pch[order[ntop:1]]),col=c(NA,col[order[ntop:1]]),
-      pt.cex=c(NA,cex[24:(24-ntop+1)]),cex=lcex)
-  }
-  # finish up animation stuff
-  if(res > 1) {
-    # finish progress report
-    cat("\n")
-    # close PNG plot device
-    dev.off()
-    # make animated GIF using ImageMagick
-    cat("anim.carboxylase: converting to animated GIF...\n")
-    outfile <- "carboxylase.gif"
-    syscmd <- paste("convert -loop 0 -delay 10 png/*.png png/", outfile, sep = "")
-    cat(paste(syscmd,"\n"))
-    if(.Platform$OS.type=="unix") sres <- system(syscmd)
-    else sres <- shell(syscmd)
-    if(sres==0) cat(paste("anim.carboxylase: animation is at png/",outfile,"\n",sep=""))
-    else {
-      cat("anim.carboxylase: error converting to animated GIF\n")
-      cat("anim.carboxylase: check that 'convert' tool from ImageMagick is in your PATH\n")
-    }
-  }
-}

Modified: pkg/CHNOSZ/R/examples.R
===================================================================
--- pkg/CHNOSZ/R/examples.R	2017-10-29 05:49:00 UTC (rev 269)
+++ pkg/CHNOSZ/R/examples.R	2017-10-30 03:40:13 UTC (rev 270)
@@ -11,7 +11,7 @@
     "util.water", "taxonomy", "info", "protein.info", "hkf", "water", "IAPWS95", "subcrt",
     "makeup", "basis", "swap.basis", "species", "affinity", "equil.boltzmann", 
     "diagram", "buffer", "nonideal", "add.protein", "protein", "ionize.aa", "yeast.aa",
-    "anim", "objective", "revisit", "EOSregress", "wjd")
+    "objective", "revisit", "EOSregress", "wjd")
   plot.it <- FALSE
   if(is.character(save.png))
     png(paste(save.png,"%d.png",sep=""),width=500,height=500,pointsize=12)
@@ -28,8 +28,8 @@
 
 demos <- function(which=c("sources", "protein.equil", "affinity", "NaCl", "density", 
   "ORP", "revisit", "findit", "ionize", "buffer", "protbuff", "yeastgfp", "mosaic",
-  "copper", "solubility", "wjd", "dehydration", "bugstab", "Shh", "activity_ratios",
-  "adenine", "DEW", "lambda", "TCA"), save.png=FALSE) {
+  "copper", "solubility", "wjd", "bugstab", "Shh", "activity_ratios",
+  "adenine", "DEW", "lambda", "TCA", "go-IU"), save.png=FALSE) {
   # run one or more demos from CHNOSZ with ask=FALSE, and return the value of the last one
   for(i in 1:length(which)) {
     # say something so the user sees where we are

Modified: pkg/CHNOSZ/demo/00Index
===================================================================
--- pkg/CHNOSZ/demo/00Index	2017-10-29 05:49:00 UTC (rev 269)
+++ pkg/CHNOSZ/demo/00Index	2017-10-30 03:40:13 UTC (rev 270)
@@ -23,3 +23,4 @@
 lambda          Thermodynamic properties of lambda transition in quartz
 TCA             Standard Gibbs energies of steps of the citric acid cycle
 go-IU           Diagrams using thermodynamic data in the SUPCRTBL compilation
+carboxylase     Rank abundance distribution for RuBisCO and acetyl-CoA carboxylase

Added: pkg/CHNOSZ/demo/carboxylase.R
===================================================================
--- pkg/CHNOSZ/demo/carboxylase.R	                        (rev 0)
+++ pkg/CHNOSZ/demo/carboxylase.R	2017-10-30 03:40:13 UTC (rev 270)
@@ -0,0 +1,129 @@
+# CHNOSZ/demo/carboxylase.R
+# animate rank-activity diagrams over a temperature
+# and logaH2 gradient, or plot a single one for a single temperature
+# first version ca. 200903; packaged anim.carboxylase() 20110818; converted to demo 20171030
+T <- 25:125
+ntop <- 5
+lcex <- 0.8
+width <- 380
+height <- 380
+# plot rank-activity diagrams for 24 carboxylases;
+# 12 ribulose phosphate carboxylase
+# 12 acetyl-coenzyme A carboxylase
+# 6 of each type are nominally from mesophilic organisms
+# and 6 from thermophilic organisms
+# arranged here in order of increasing growth temperature
+rubisco <- c("RBL_BRAJA","A6YF84_9PROT","A1E8R4_9CHLO","A8C9T6_9MYCO","A3EQE1_9BACT","A5CKC7_9CHRO",
+  "RBL_SYNJA","Q6JAI0_9RHOD","RBL_METJA","A3DND9_STAMF","A1RZJ5_THEPD","RBL_PYRHO")
+rubisco.organisms <- c("a-proteobacterium-R","b-proteobacterium","Bracteacoccus","Mycobacterium",
+  "Leptospirillum","Cyanobium","Synechococcus","Cyanidiales",
+  "Methanococcus-R","Desulfurococcus","Thermofilum","Pyrococcus")
+accoaco <- c("Q9F7M8_PRB01","ACCA_DEIRA","A6CDM2_9PLAN","A4AGS7_9ACTN","ACCA_CAUCR","A1VC70_DESVV",
+  "A6VIX9_METM7","Q2JSS7_SYNJA","A0GZU2_9CHLR","A7WGI1_9AQUI","Q05KD0_HYDTH","ACCA_AQUAE")
+accoaco.organisms <- c("g-proteobacterium","Deinococcus","Planctomyces","Actinobacterium",
+  "a-proteobacterium-A","d-proteobacterium","Methanococcus-A","Synechococcus",
+  "Chloroflexus","Hydrogenobaculum","Hydrogenobacter","Aquifex")
+# assemble them all
+organisms <- c(rubisco.organisms,accoaco.organisms)
+# new scheme 20090611: red for hot, blue for cold
+# open for rubisco, filled for accoaco
+col <- rep(c(rep("blue",6),rep("red",6)),2)
+pch <- c(rep(c(0:2,5:7),2),rep(c(15:20),2))
+# how many frames do we want?
+res <- length(T)
+if(res==1) ido <- 1 else {
+  # check for png directory
+  if(!"png" %in% dir()) stop("directory 'png' not present")
+  else if(length(dir("png")) > 0) stop("directory 'png' not empty")
+  # start the plot device - multiple png figures
+  png(filename="png/Rplot%04d.png",width=width,height=height)
+  # add counters for lead-in and lead-out frames
+  ido <- c(rep(1,15),1:res,rep(res,20))
+}
+# set up system
+basis(c("CO2","H2O","NH3","H2","H2S","H+"),
+  c("aq","liq","aq","aq","aq","aq"),c(-3,0,-4,-6,-7,-7))
+species(c(rubisco,accoaco))
+# equation for logaH2 as a function of temperature
+# from Dick and Shock, 2011
+# http://dx.plos.org/10.1371/journal.pone.0022782
+get.logaH2 <- function(T) return(-11+T*3/40)
+H2 <- get.logaH2(T)
+# calculate affinities
+if(res==1) {
+  basis("H2",H2)
+  a <- affinity(T=T)
+} else a <- affinity(T=T,H2=H2)
+# calculate activities
+e <- equilibrate(a, normalize=TRUE)
+# for each point make a rank plot
+rank <- 1:length(e$loga.equil)
+for(i in 1:length(ido)) {
+  # print some progress
+  if(i%%20 == 0) cat("\n") else cat(".")
+  # keep track of positions of previous points
+  loga <- numeric()
+  for(j in 1:length(e$loga.equil)) loga <- c(loga, e$loga.equil[[j]][ido[i]])
+  if(i > 4) myrank4 <- myrank3
+  if(i > 3) myrank3 <- myrank2
+  if(i > 2) myrank2 <- myrank1
+  if(i > 1) myrank1 <- myrank
+  order <- order(loga,decreasing=TRUE)
+  myrank <- rank(loga)
+  cex <- rep(1.2,24)
+  # show changes by increasing point size
+  # any points that changed on the step before the step 
+  # before the step before?
+  if(i > 4) {
+    ichanged <- myrank3 != myrank4
+    cex[ichanged[order]] <- cex[ichanged[order]] + 0.1
+  }
+  # any points that changed on the step before the step before?
+  if(i > 3) {
+    ichanged <- myrank2 != myrank3
+    cex[ichanged[order]] <- cex[ichanged[order]] + 0.2
+  }
+ # any points that changed on the step before?
+  if(i > 2) {
+    ichanged <- myrank1 != myrank2
+    cex[ichanged[order]] <- cex[ichanged[order]] + 0.3
+  }
+  # any points that changed on this step?
+  if(i > 1) {
+    ichanged <- myrank != myrank1
+    cex[ichanged[order]] <- cex[ichanged[order]] + 0.4
+  }
+  plot(rank,loga[order],col=col[order],pch=pch[order],
+    ylab=expression(log~italic(a)),cex=cex,cex.main=1,cex.lab=1,cex.axis=1)
+  myT <- format(round(T,1))[ido[i]]
+  myH2 <- format(round(H2,2))[ido[i]]
+  title(main=substitute(list(X~degree*C, log*italic(a)[paste(H2)]==Y),
+    list(X=myT,Y=myH2)))
+  # legends showing highest and lowest few
+  legend("topright",legend=c(paste("top",ntop),organisms[order[1:ntop]]),
+    pch=c(NA,pch[order[1:ntop]]),col=c(NA,col[order[1:ntop]]),
+    pt.cex=c(NA,cex[1:ntop]),cex=lcex)
+  order <- order(loga)
+  legend("bottomleft",legend=c(paste("low",ntop),organisms[order[ntop:1]]),
+    pch=c(NA,pch[order[ntop:1]]),col=c(NA,col[order[ntop:1]]),
+    pt.cex=c(NA,cex[24:(24-ntop+1)]),cex=lcex)
+}
+# finish up animation stuff
+if(res > 1) {
+  # finish progress report
+  cat("\n")
+  # close PNG plot device
+  dev.off()
+  # make animated GIF using ImageMagick
+  cat("anim.carboxylase: converting to animated GIF...\n")
+  outfile <- "carboxylase.gif"
+  syscmd <- paste("convert -loop 0 -delay 10 png/*.png png/", outfile, sep = "")
+  cat(paste(syscmd,"\n"))
+  if(.Platform$OS.type=="unix") sres <- system(syscmd)
+  else sres <- shell(syscmd)
+  if(sres==0) cat(paste("anim.carboxylase: animation is at png/",outfile,"\n",sep=""))
+  else {
+    cat("anim.carboxylase: error converting to animated GIF\n")
+    cat("anim.carboxylase: check that 'convert' tool from ImageMagick is in your PATH\n")
+  }
+}

Modified: pkg/CHNOSZ/inst/NEWS
===================================================================
--- pkg/CHNOSZ/inst/NEWS	2017-10-29 05:49:00 UTC (rev 269)
+++ pkg/CHNOSZ/inst/NEWS	2017-10-30 03:40:13 UTC (rev 270)
@@ -1,4 +1,4 @@
-CHANGES IN CHNOSZ 1.1.0-66 (2017-10-25)
+CHANGES IN CHNOSZ 1.1.0-69 (2017-10-30)
 ---------------------------------------
 
 MAJOR CHANGES:
@@ -173,6 +173,9 @@
   workflow, Thermodynamic data, Thermodynamic calculations, Water
   properties, Protein properties, Other tools, Utility functions.
 
+- Remove anim.TCA() and anim.carboxylase(); move the latter code to
+  demo/carboxylase.R.
+
 CHANGES IN CHNOSZ 1.1.0 (2017-05-04)
 ------------------------------------
 

Modified: pkg/CHNOSZ/man/CHNOSZ-package.Rd
===================================================================
--- pkg/CHNOSZ/man/CHNOSZ-package.Rd	2017-10-29 05:49:00 UTC (rev 269)
+++ pkg/CHNOSZ/man/CHNOSZ-package.Rd	2017-10-30 03:40:13 UTC (rev 270)
@@ -14,7 +14,7 @@
 Each help page (other than this one) has been given one of the following \dQuote{concept index entries}:
 \itemize{
   \item Main workflow: \code{\link{info}}, \code{\link{subcrt}}, \code{\link{basis}}, \code{\link{species}}, \code{\link{affinity}}, \code{\link{equilibrate}}, \code{\link{diagram}}
-  \item Extended workflow: \code{\link{swap.basis}}, \code{\link{buffer}}, \code{\link{mosaic}}, \code{\link{objective}}, \code{\link{revisit}}, \code{\link{findit}}, \code{\link{anim}}, \code{\link{EOSregress}}, \code{\link{wjd}}
+  \item Extended workflow: \code{\link{swap.basis}}, \code{\link{buffer}}, \code{\link{mosaic}}, \code{\link{objective}}, \code{\link{revisit}}, \code{\link{findit}}, \code{\link{EOSregress}}, \code{\link{wjd}}
   \item Thermodynamic data: \code{\link{data}}, \code{\link{extdata}}, \code{\link{add.obigt}}, \code{\link{util.data}}
   \item Thermodynamic calculations: \code{\link{util.formula}}, \code{\link{makeup}}, \code{\link{util.units}}, \code{\link{eos}}, \code{\link{berman}}, \code{\link{nonideal}}, \code{\link{util.misc}}
   \item Water properties: \code{\link{water}}, \code{\link{util.water}}, \code{\link{DEW}}, \code{\link{IAPWS95}}

Deleted: pkg/CHNOSZ/man/anim.Rd
===================================================================
--- pkg/CHNOSZ/man/anim.Rd	2017-10-29 05:49:00 UTC (rev 269)
+++ pkg/CHNOSZ/man/anim.Rd	2017-10-30 03:40:13 UTC (rev 270)
@@ -1,63 +0,0 @@
-\encoding{UTF-8}
-\name{anim.TCA}
-\alias{anim}
-\alias{anim.TCA}
-\alias{anim.carboxylase}
-\title{Functions to Make Animations}
-\description{
-  Make animated stability diagrams by creating a series of PNG files.
-}
-
-\usage{
-  anim.TCA(redox = list(O2 = c(-95, -60)), high.T = FALSE,
-    nframes = 100, pHlim = c(0,10), width = 420, height = 320)
-  anim.carboxylase(T = 25:125, ntop = 5, lcex = 0.8, width = 420, height = 320)
-}
-
-\arguments{
-  \item{redox}{list, redox variable and limits}
-  \item{high.T}{logical, overlay high-temperature diagram?}
-  \item{nframes}{numeric, number of frames to be animated}
-  \item{pHlim}{numeric, pH limits to use for animation}
-  \item{width}{numeric, width of plot device}
-  \item{height}{numeric, height of plot device}
-  \item{T}{numeric, temperature range for animation}
-  \item{ntop}{numeric, number of names to show in legend}
-  \item{lcex}{numeric, character expansion factor for legend}
-}
-
-\details{
-These functions create a series of PNG figures that can be converted into an animated diagram.
-The PNG files are created in the \samp{png} directory within the current working directory; the functions stop with an error if either this directory is not present or it is present but not empty.
-After making the PNG files, they are converted to an animated GIF using the \samp{convert} tool from the ImageMagick software distribution (\url{http://www.imagemagick.org}), if it is available on the system.
-The system command is called using \code{\link{system}}, or \code{shell} on Windows platforms.
-When installing ImageMagick on Windows, be sure to leave the \sQuote{Add application directory to your system path} option checked; this will make the \samp{convert} command from ImageMagick available in the shell.
-
-To ensure the calculations are performed as intended, each function first removes any existing system definition by calling \code{data(thermo)}.
-
-\code{anim.TCA} creates a series of figures showing how a logaH2O - logfO2 activity diagram for various species involved in the tricarboxylic acid (TCA) cycle changes as a function of pH.
-Alternatively, set \code{redox} to \code{list(H2=c(-20,0))} to draw a logaH2O - logaH2 diagram.
-The diagrams are made at 25 \degC unless \code{high.T} is TRUE, in which case high-temperature (100 \degC) stability fields are overlaid.
-
-\code{anim.carboxylase} animates equilibrium rank-activity diagrams along a combined temperature and logaH2 gradient, or makes a single plot on the default device (without conversion to animated GIF) if a single \code{temperature} is provided.
-The proteins in the calculation are 24 carboxylases from a variety of organisms.
-There are 12 ribulose phosphate carboxylase and 12 acetyl-coenzyme A carboxylase; 6 of each type are from nominally mesophilic organisms and 6 from nominally thermophilic organisms, shown as blue and red symbols on the diagrams.
-The activities of hydrogen at each temperature are calculated using \eqn{\log a_{\mathrm{H_{2}}_{\left(aq\right)}}=-11+3/\left(40\times T\left(^{\circ}C\right)\right)}{logaH2 = -11 + 3/40 * T(degC)}; this equation comes from a model of relative stabilities of proteins in a hot-spring environment (Dick and Shock, 2011).
-}
-
-\examples{\dontshow{data(thermo)}
-\dontrun{
-# animate a stability diagram with a high-temperature overlay
-anim.TCA(high.T=TRUE)
-# using H2 instead of O2
-anim.TCA(list(H2=c(-20,0))) }
-
-# using anim.carboxylase in non-animation mode
-anim.carboxylase(T=100)
-}
-
-\references{
-Dick, J. M. and Shock, E. L. (2011) Calculation of the relative chemical stabilities of proteins as a function of temperature and redox chemistry in a hot spring. \emph{PLoS ONE} \bold{6}, e22782. \url{https://doi.org/10.1371/journal.pone.0022782}
-}
-
-\concept{Extended workflow}

Modified: pkg/CHNOSZ/man/examples.Rd
===================================================================
--- pkg/CHNOSZ/man/examples.Rd	2017-10-29 05:49:00 UTC (rev 269)
+++ pkg/CHNOSZ/man/examples.Rd	2017-10-30 03:40:13 UTC (rev 270)
@@ -16,8 +16,8 @@
   demos(which = c("sources", "protein.equil", "affinity", "NaCl",
     "density", "ORP", "revisit", "findit", "ionize", "buffer",
     "protbuff", "yeastgfp", "mosaic", "copper", "solubility",
-    "wjd", "dehydration", "bugstab", "Shh", "activity_ratios",
-    "adenine", "DEW", "lambda", "TCA"),
+    "wjd", "bugstab", "Shh", "activity_ratios", "adenine",
+    "DEW", "lambda", "TCA", "go-IU"),
     save.png=FALSE)
 }
 
@@ -58,10 +58,20 @@
     \code{lambda} \tab * Effects of lambda transition on thermodynamic properties of quartz (Berman, 1988) \cr
     \code{TCA} \tab * Standard Gibbs energies of the tricarboxylic (citric) acid cycle (Canovas and Shock, 2016) \cr
     \code{go-IU} \tab * Diagrams using thermodynamic data in the SUPCRTBL compilation (Zimmer et al., 2016) \cr
+    \code{carboxylase} \tab * Rank abundance distribution for RuBisCO and acetyl-CoA carboxylase \cr
   }
 
 For either function, if \code{save.png} is TRUE, the plots are saved in \code{\link{png}} files whose names begin with the names of the help topics or demos.
 
+Two of the demos have external dependencies and are not automatically run by \code{demos}.
+\samp{dehydration} creates an interactive SVG file; this demo depends on the \pkg{RSVGTipsDevice}, which is not available for Windows
+\samp{carboxylase} creates an animated GIF; this demo requires that the ImageMagick \code{convert} commmand be available on the system (tested on Linux and Windows).
+
+\samp{carboxylase} animates diagrams showing rankings of calculated chemical activities along a combined \T and \logaH2 gradient, or makes a single plot on the default device (without conversion to animated GIF) if a single temperature (\code{T}) is specified in the code.
+To run this demo, an empty directory named \samp{png} must be present (as a subdirectory of the R working directory).
+The proteins in the calculation are 24 carboxylases from a variety of organisms.
+There are 12 ribulose phosphate carboxylase and 12 acetyl-coenzyme A carboxylase; 6 of each type are from nominally mesophilic organisms and 6 from nominally thermophilic organisms, shown as blue and red symbols on the diagrams.
+The activities of hydrogen at each temperature are calculated using \eqn{\log a_{\mathrm{H_{2}}_{\left(aq\right)}}=-11+3/\left(40\times T\left(^{\circ}C\right)\right)}{logaH2 = -11 + 3/40 * T(degC)}; this equation comes from a model of relative stabilities of proteins in a hot-spring environment (Dick and Shock, 2011).
 }
 
 \references{

Modified: pkg/CHNOSZ/man/macros/macros.Rd
===================================================================
--- pkg/CHNOSZ/man/macros/macros.Rd	2017-10-29 05:49:00 UTC (rev 269)
+++ pkg/CHNOSZ/man/macros/macros.Rd	2017-10-30 03:40:13 UTC (rev 270)
@@ -24,6 +24,7 @@
 \newcommand{\logK}{\ifelse{latex}{\eqn{\log K}}{\ifelse{html}{\out{log<i>K</i>}}{log K}}}
 \newcommand{\logfO2}{\ifelse{latex}{\eqn{\log f_{\mathrm{O_{2}}}}}{\ifelse{html}{\out{log<i>f</i><sub>O<sub>2</sub></sub>}}{logfO2}}}
 \newcommand{\logfH2}{\ifelse{latex}{\eqn{\log f_{\mathrm{H_{2}}}}}{\ifelse{html}{\out{log<i>f</i><sub>H<sub>2</sub></sub>}}{logfH2}}}
+\newcommand{\logaH2}{\ifelse{latex}{\eqn{\log a_{\mathrm{H_{2}}}}}{\ifelse{html}{\out{log<i>a</i><sub>H<sub>2</sub></sub>}}{logaH2}}}
 \newcommand{\logaH2O}{\ifelse{latex}{\eqn{\log a_{\mathrm{H_{2}O}}}}{\ifelse{html}{\out{log<i>a</i><sub>H<sub>2</sub>O</sub>}}{logaH2O}}}
 \newcommand{\loga}{\ifelse{latex}{\eqn{\log a}}{\ifelse{html}{\out{log<i>a</i>}}{log a}}}
 \newcommand{\ZC}{\ifelse{latex}{\eqn{Z_\mathrm{C}}}{\ifelse{html}{\out{<I>Z</I><sub>C</sub>}}{ZC}}}

Modified: pkg/CHNOSZ/man/util.array.Rd
===================================================================
--- pkg/CHNOSZ/man/util.array.Rd	2017-10-29 05:49:00 UTC (rev 269)
+++ pkg/CHNOSZ/man/util.array.Rd	2017-10-30 03:40:13 UTC (rev 270)
@@ -31,7 +31,7 @@
 
   \code{slice} extracts or assigns values from/to the \code{i}th slice(s) in the \code{d}th dimension of an array. Values are assigned to an array if \code{value} is not NULL. This function works by building an expression containing the extraction operator (\code{\link{[}}).
 
-  \code{slice.affinity} performs a slice operation on the \samp{values} element of the \samp{affinity} variable (which should be the output of \code{\link{affinity}}). This function is used e.g. by \code{\link{anim.TCA}} to extract slices that are the used to make frames of an animated stability diagram.
+  \code{slice.affinity} performs a slice operation on the \samp{values} element of the \samp{affinity} variable (which should be the output of \code{\link{affinity}}).
 
   \code{dimSums} sums an array along the \code{d}th dimension using only the \code{i}th slices in that dimension. If \code{i} is NULL, all slices in that dimension are summed together. For matrices, \code{dimSums(x,1)} has the same result as \code{\link{colSums}(x)} and \code{dimSums(x,2)} has the same result as \code{\link{rowSums}(x)}.
 }

Modified: pkg/CHNOSZ/vignettes/anintro.Rmd
===================================================================
--- pkg/CHNOSZ/vignettes/anintro.Rmd	2017-10-29 05:49:00 UTC (rev 269)
+++ pkg/CHNOSZ/vignettes/anintro.Rmd	2017-10-30 03:40:13 UTC (rev 270)
@@ -2047,11 +2047,6 @@
 <span style="color:green">`wjd()`</span> implements a Gibbs energy minimization using the method of steepest descent described by @WJD58.
 See <span style="color:blue">`?wjd`</span> as well as the vignette, [<span style="color:blue">*Winding journey down (in Gibbs energy)*</span>](wjd.pdf).
 
-## Animations
-
-A few functions have been written (see <span style="color:blue">`?anim`</span>) to make GIF animations of chemical activity diagrams from a series of PNG files.
-The functions require the `convert` system command from [ImageMagick](http://www.imagemagick.org).
-
 ## Group additivity and EQ3/6 output
 
 <span style="color:green">`RH2obigt()`</span> implements a group additivity calculation of standard molal thermodynamic properties and equations of state parameters of crystalline and liquid organic molecules from @RH98.



More information about the CHNOSZ-commits mailing list