Functions to Make Animations


Make animated stability diagrams by creating a series of PNG files.


  anim.TCA(redox = list(O2 = c(-95, -60)), high.T = FALSE,
    nframes = 100, pHlim = c(0,10), width = 420, height = 320)
  anim.plasma(width=480, height=480)
  anim.carboxylase(T = 25:125, ntop = 5, lcex = 0.8, width = 420, height = 320)



list, redox variable and limits


logical, overlay high-temperature diagram?


numeric, number of frames to be animated


numeric, pH limits to use for animation


numeric, width of plot device


numeric, height of plot device


numeric, temperature range for animation


numeric, number of names to show in legend


numeric, character expansion factor for legend


These functions create a series of PNG figures that can be converted into an animated diagram. The PNG files are created in the 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 convert tool from the ImageMagick software distribution (, if it is available on the system. The system command is called using the system function on unix-alikes, and using shell on Windows platforms. When installing ImageMagick on Windows, be sure to leave the ‘Add application directory to your system path’ option checked; this will make the convert command from ImageMagick available in the shell.

To ensure the results described below, each function here does remove any existing system definition by calling data(thermo).

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 redox to list(H2=c(-20,0)) to draw a logaH2O - logaH2 diagram. The diagrams are made at 25 °C unless high.T is TRUE, in which case high-temperature (100 °C) stability fields are overlain. The number of frames to be used for the animation (as pH increases ranges between the values specified in pHlim) is given by nframes.

anim.plasma produces a series of equilibrium activity diagrams for proteins in human blood plasma, as a function of log aO2 and log aH2, at 25 °C. Unlike most other examples in CHNOSZ, the chemical potentials of hydrogen and oxygen in the system are represented by the activities of O2 and H2, and H2O is not used as a basis species. Therefore, the equilibrium activities of H2O vary by many orders of magnitude across these diagrams. The list of proteins is taken from Anderson and Anderson (2003); see the description for the data file AA03.csv in extdata. The first diagram shows the equilibrium predominance fields with all 71 listed proteins in the calculation. In each subsequent diagram, the protein whose predominance field occupies the greatest area on the diagram is removed. The range of heat.colors indicates the reported reference abundances of the proteins, with the deepest (reddest) colors corresponding to the highest abundances.

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 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 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).


Anderson, N. L. and Anderson, N. G. (2003) The human plasma proteome: History, character and diagnostic prospects (Vol. 1 (2002) 845-867). Molecular and Cellular Proteomics 2, 50.

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. PLoS ONE 6, e22782.


## Not run: 
# animate a stability diagram with a high-temperature overlay
# using H2 instead of O2
## End(Not run)

# using anim.carboxylase in non-animation mode

Want to suggest features or report bugs for Use the GitHub issue tracker. Vote for new features on Trello.

comments powered by Disqus