[CHNOSZ-commits] r80 - in pkg/CHNOSZ: . R inst man vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Mar 10 17:00:18 CET 2015


Author: jedick
Date: 2015-03-10 17:00:18 +0100 (Tue, 10 Mar 2015)
New Revision: 80

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/R/equilibrate.R
   pkg/CHNOSZ/inst/NEWS
   pkg/CHNOSZ/man/equilibrate.Rd
   pkg/CHNOSZ/man/protein.info.Rd
   pkg/CHNOSZ/man/util.fasta.Rd
   pkg/CHNOSZ/vignettes/anintro.Rnw
   pkg/CHNOSZ/vignettes/anintro.lyx
Log:
update anintro.Rnw vignette


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2015-03-06 11:12:22 UTC (rev 79)
+++ pkg/CHNOSZ/DESCRIPTION	2015-03-10 16:00:18 UTC (rev 80)
@@ -1,6 +1,6 @@
-Date: 2015-03-06
+Date: 2015-03-10
 Package: CHNOSZ
-Version: 1.0.3-17
+Version: 1.0.3-18
 Title: Chemical Thermodynamics and Activity Diagrams
 Author: Jeffrey Dick
 Maintainer: Jeffrey Dick <j3ffdick at gmail.com>

Modified: pkg/CHNOSZ/R/equilibrate.R
===================================================================
--- pkg/CHNOSZ/R/equilibrate.R	2015-03-06 11:12:22 UTC (rev 79)
+++ pkg/CHNOSZ/R/equilibrate.R	2015-03-10 16:00:18 UTC (rev 80)
@@ -233,7 +233,8 @@
   #   "length"                   - balanced on sequence length of proteins 
   #                             (default if balance is missing and all species are proteins)
   #   1                       - balanced on one mole of species
-  #   numeric vector          - uesr-defined n.balance
+  #   numeric vector          - user-defined n.balance
+  #   "volume"                - standard-state volume listed in thermo$obigt
   # the index of the basis species that might be balanced
   ibalance <- numeric()
   # deal with proteins
@@ -259,6 +260,10 @@
       n.balance <- protein.length(aout$species$name)
       balance.description <- "protein length"
       msgout(paste("balance: coefficients are", balance.description, "\n"))
+    } else if(identical(balance, "volume")) {
+      n.balance <- info(aout$species$ispecies, check.it=FALSE)$V
+      balance.description <- "volume"
+      msgout(paste("balance: coefficients are", balance.description, "\n"))
     } else {
       # is the balance the name of a basis species?
       if(length(ibalance)==0) {

Modified: pkg/CHNOSZ/inst/NEWS
===================================================================
--- pkg/CHNOSZ/inst/NEWS	2015-03-06 11:12:22 UTC (rev 79)
+++ pkg/CHNOSZ/inst/NEWS	2015-03-10 16:00:18 UTC (rev 80)
@@ -1,4 +1,4 @@
-CHANGES IN CHNOSZ 1.0.3-17 (2015-03-06)
+CHANGES IN CHNOSZ 1.0.3-18 (2015-03-10)
 ---------------------------------------
 
 - Add files with average amino acid compositions of proteins from Bison
@@ -50,7 +50,7 @@
 - Add thermo$opt$varP option as a flag for subcrt() to calculate Gibbs
   energies of gases using a variable-pressure standard state.
 
-- Add 'solubility.R' demo.
+- Add 'solubility.R' demo and calcite solubility plot to anintro.Rnw.
 
 CHANGES IN CHNOSZ 1.0.3 (2014-01-12)
 ------------------------------------

Modified: pkg/CHNOSZ/man/equilibrate.Rd
===================================================================
--- pkg/CHNOSZ/man/equilibrate.Rd	2015-03-06 11:12:22 UTC (rev 79)
+++ pkg/CHNOSZ/man/equilibrate.Rd	2015-03-10 16:00:18 UTC (rev 80)
@@ -58,7 +58,7 @@
 
 \code{ispecies} can be supplied to identify a subset of the species to include in the calculation.
 
-\code{equil.boltzmann} is used to calculation the equilibrium activities if \code{balance} is \samp{1} (including the normalized result when \code{normalize} is TRUE), otherwise \code{equil.reaction} is called.
+\code{equil.boltzmann} is used to calculate the equilibrium activities if \code{balance} is \samp{1} (including the normalized result when \code{normalize} is TRUE), otherwise \code{equil.reaction} is called.
 
 }
 

Modified: pkg/CHNOSZ/man/protein.info.Rd
===================================================================
--- pkg/CHNOSZ/man/protein.info.Rd	2015-03-06 11:12:22 UTC (rev 79)
+++ pkg/CHNOSZ/man/protein.info.Rd	2015-03-10 16:00:18 UTC (rev 80)
@@ -122,13 +122,14 @@
 
 \donttest{## using protein.formula: average oxidation state of 
 ## carbon of proteins from different organisms
+# after Dick, 2014 (see Supporting Information to make plot with more groups)
 # get amino acid compositions of microbial proteins 
 # generated from the RefSeq database 
 file <- system.file("extdata/refseq/protein_refseq.csv.xz", package="CHNOSZ")
 ip <- add.protein(read.aa(file))
 # only use those organisms with a certain
 # number of sequenced bases
-ip <- ip[as.numeric(thermo$protein$abbrv[ip]) > 100000]
+ip <- ip[as.numeric(thermo$protein$abbrv[ip]) > 50000]
 pf <- protein.formula(thermo$protein[ip, ])
 zc <- ZC(pf)
 # the organism names we search for
@@ -153,6 +154,8 @@
 }
 
 \references{
+  Dick, J. M. (2014) Average oxidation state of carbon in proteins. \emph{J. R. Soc. Interface} \bold{11}, 20131095. \url{http://dx.doi.org/10.1098/rsif.2013.1095}
+
   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{http://dx.doi.org/10.1371/journal.pone.0022782}
 
   Makhatadze, G. I. and Privalov, P. L. (1990) Heat capacity of proteins. 1. Partial molar heat capacity of individual amino acid residues in aqueous solution: Hydration effect \emph{J. Mol. Biol.} \bold{213}, 375--384. \url{http://dx.doi.org/10.1016/S0022-2836(05)80197-4}

Modified: pkg/CHNOSZ/man/util.fasta.Rd
===================================================================
--- pkg/CHNOSZ/man/util.fasta.Rd	2015-03-06 11:12:22 UTC (rev 79)
+++ pkg/CHNOSZ/man/util.fasta.Rd	2015-03-10 16:00:18 UTC (rev 80)
@@ -75,6 +75,7 @@
 }
 
 \seealso{
+\code{\link{seq2aa}}, like \code{count.aa}, counts amino acids in a user-input sequence, but returns a data frame in the format of \code{thermo$protein}.
 \code{\link{nucleic.formula}} for an example of counting nucleobases in a DNA sequence.
 When computing relative abundances of many proteins that might be found with \code{grep.file} and \code{read.fasta}, consider using the \code{iprotein} arugment of \code{\link{affinity}} to speed things up; for an example see the help page for \code{\link{revisit}}. 
 }

Modified: pkg/CHNOSZ/vignettes/anintro.Rnw
===================================================================
--- pkg/CHNOSZ/vignettes/anintro.Rnw	2015-03-06 11:12:22 UTC (rev 79)
+++ pkg/CHNOSZ/vignettes/anintro.Rnw	2015-03-10 16:00:18 UTC (rev 80)
@@ -1,12 +1,12 @@
-%% LyX 2.0.5 created this file.  For more info, see http://www.lyx.org/.
+%% LyX 2.1.3 created this file.  For more info, see http://www.lyx.org/.
 %% Do not edit unless you really know what you are doing.
-\documentclass[noae,round]{article}
+\documentclass[english,noae,round]{article}
 \usepackage{mathpazo}
 \usepackage[T1]{fontenc}
-\usepackage[latin9]{inputenc}
 \usepackage[letterpaper]{geometry}
 \geometry{verbose,tmargin=2.5cm,bmargin=2.5cm,lmargin=2.5cm,rmargin=2.5cm}
 \usepackage{color}
+\usepackage{babel}
 \usepackage{amsbsy}
 \usepackage{amssymb}
 \usepackage{graphicx}
@@ -102,10 +102,8 @@
 the species of interest for relative stability calculations, calculate
 the affinities of formation reactions of the species of interest under
 reference (non-equilibrium) conditions, calculate the equilibrium
-chemical activities, and finally plot the results;%
-\footnote{\texttt{equilibrate()} appeared in version 0.9-9 of CHNOSZ. In previous
-versions, the equilibrium calculations were invoked by calls to \texttt{diagram()}.%
-}
+chemical activities, and finally plot the results;\footnote{\texttt{equilibrate()} appeared in version 0.9-9 of CHNOSZ. In previous
+versions, the equilibrium calculations were invoked by calls to \texttt{diagram()}.}
 \item using \texttt{revisit()} to calculate/plot statistics of the chemical
 activities of the species of interest and \texttt{findit()} to search
 for combinations of activities of basis species, temperature and/or
@@ -135,7 +133,6 @@
 install.packages("CHNOSZ")
 @
 
-
 Then load the CHNOSZ package to make its functions available in your
 working session.
 
@@ -143,7 +140,6 @@
 library(CHNOSZ)
 @
 
-
 Then load the \texttt{thermo} object, which contains the thermodynamic
 database and is also where your system settings will be stored.
 
@@ -151,7 +147,6 @@
 data(thermo)
 @
 
-
 The rest of this document assumes that the CHNOSZ package and data
 are loaded.
 
@@ -171,7 +166,6 @@
 info("ethylene")
 @
 
-
 There are two species named ``ethylene'' in the database. Normally,
 \texttt{info()} gives preference to aqueous species if they exist,
 so in this case we find that aqueous ethylene is species number 88
@@ -182,7 +176,6 @@
 info(88)
 @
 
-
 If you were instead interested in the properties of the gas, you could
 run:
 
@@ -190,7 +183,6 @@
 info("ethylene","gas")
 @
 
-
 \texttt{info()} itself is used by other functions in the package.
 It prints output to the screen, but also returns a numeric value if
 it finds a species matching the search term. So, we can retrieve the
@@ -203,7 +195,6 @@
 @
 
 
-
 \subsection{\texttt{thermo\$refs}}
 
 The thermodynamic data and other parameters used by the functions,
@@ -214,7 +205,6 @@
 summary(thermo)
 @
 
-
 Within this list, the thermodynamic database is contained in a data
 frame (an R object that is like a matrix with named columns), \texttt{thermo\$obigt},
 and the references to the original sources of thermodynamic data in
@@ -230,7 +220,6 @@
 browse.refs(88)
 @
 
-
 \texttt{browse.refs: opening URL for SH90 (E. L. Shock and H. C. Helgeson,
 \citeyear{SH90})}
 
@@ -243,7 +232,6 @@
 info("acid")
 @
 
-
 Here, \texttt{info()} couldn't find an exact match to a name, so it
 performed a fuzzy search. That's why ``uracil'' and ``metacinnabar''
 show up above. If you really just want species whose names include
@@ -256,7 +244,6 @@
 info(" acid")
 @
 
-
 The names of species other than proteins use (almost) exclusively
 lowercase letters. \texttt{info()} can also be used to search the
 text of the chemical formulas as they are entered in the database;
@@ -269,7 +256,6 @@
 @
 
 
-
 \section{Proteins}
 
 
@@ -287,7 +273,6 @@
 aa2eos(aa)
 @
 
-
 What happened there? Well, the first line found the row number (6)
 of \texttt{thermo\$protein} that contains the amino acid composition
 of LYSC\_CHICK. The second line extracted as a data frame. The third
@@ -302,7 +287,6 @@
 @
 
 
-
 \subsection{\texttt{info()}}
 
 Most of the time you probably won't be using the \texttt{iprotein()}
@@ -316,7 +300,6 @@
 info(si)
 @
 
-
 When CHNOSZ is first loaded, the thermodynamic properties and parameters
 of the proteins are not present in \texttt{thermo\$obigt}. Therefore,
 the first call to\texttt{ info()} just above had a side effect of
@@ -343,7 +326,6 @@
 subcrt("water")
 @
 
-
 The columns in the output are temperature ($^{\circ}$C), pressure
 (bar), density of water (g cm$^{-3}$), logarithm of the equilibrium
 constant (only meaningful for reactions; see below), and standard
@@ -368,7 +350,6 @@
 subcrt(c("C2H5OH","O2","CO2","H2O"),c(-1,-3,2,3),T=37)
 @
 
-
 For historical reasons (i.e., the prevalence of the use of oxygen
 fugacity in geochemical modeling; \citealp{And05}), $\mathrm{O_{2}}$
 breaks the general rule in CHNOSZ that species whose states are not
@@ -382,22 +363,18 @@
 subcrt(c("C2H5OH","O2","CO2","H2O"),c(-1,-3,2,3),c("aq","aq","aq","liq"),T=37)
 @
 
-
 A useful feature of \texttt{subcrt()} is that it emits a warning if
 the reaction is not balanced. Let's say you forgot to account for
-oxygen on the left-hand side of the reaction%
-\footnote{This example is motivated by the unbalanced reaction found at the
+oxygen on the left-hand side of the reaction\footnote{This example is motivated by the unbalanced reaction found at the
 \href{http://en.wikipedia.org/wiki/Ethanol_metabolism}{Wikipedia entry on ethanol metabolism}
 on 2010-09-23 and still present as of 2011-08-15: ``Complete Reaction:
 C$_{2}$H$_{6}$O(Ethanol)$\rightarrow$C$_{2}$H$_{4}$O(Acetaldehyde)$\rightarrow$C$_{2}$H$_{4}$O$_{2}$(acetic
-Acid) $\rightarrow$Acetyl-CoA$\rightarrow$3H$_{2}$O+2CO$_{2}$''.%
-}.
+Acid) $\rightarrow$Acetyl-CoA$\rightarrow$3H$_{2}$O+2CO$_{2}$''.}.
 
 <<subcrt_C2H5OH_unbal>>=
 subcrt(c("C2H5OH","CO2","H2O"),c(-1,2,3),T=37)
 @
 
-
 The function still reports the results of the calculations, but use
 them very cautiously (only if you have a specific reason for writing
 an unbalanced reaction). In the next section we'll see how to use
@@ -424,7 +401,6 @@
 <<basis_not,eval=FALSE>>=
 basis(c("CO2","H2O","NH3","H2S","H+"))
 @
-
 \begin{lyxcode}
 Error~in~put.basis(basis,~mystates)~:~
 
@@ -446,7 +422,6 @@
 basis(c("CO2","H2O","NH3","O2","H2S","H+"))
 @
 
-
 First basis definition! Note the column names, which give CHNOSZ its
 name. These represent the elements in the commonly-occurring amino
 acids, together with charge, denoted by ``Z''.
@@ -461,7 +436,6 @@
 subcrt(c("C2H5OH","CO2","H2O"),c(-1,2,3),T=37)
 @
 
-
 Here, \texttt{subcrt()} detected an unbalanced reaction, but since
 the missing element was among the elements of the basis species, it
 added the appropriate amount of $\mathrm{O_{2}}_{\left(gas\right)}$
@@ -473,7 +447,6 @@
 subcrt(c("C2H5OH"),c(-1),T=37)
 @
 
-
 What if you were interested in the thermodynamic properties of the
 reaction of ethanol to acetaldehyde, but didn't want to balance the
 reaction yourself (and you also didn't know how the formulas of the
@@ -483,7 +456,6 @@
 subcrt(c("ethanol","acetaldehyde"),c(-1,1),T=37)
 @
 
-
 Notice how 2 H's needed to be added to the right-hand side of the
 reaction; in our definition of basis species this comes out to $\mathrm{H_{2}O}-0.5\mathrm{O_{2}}$.
 With a different choice of basis species, but the same elements, the
@@ -498,7 +470,6 @@
 subcrt(c("ethanol","acetaldehyde"),c(-1,1),T=37)
 @
 
-
 In this case, the function finds that 2 H's are the compositional
 equivalent of $0.5\mathrm{C_{6}H_{13}NO_{2}}-0.125\mathrm{C_{6}H_{14}N_{2}O_{2}}-0.250\mathrm{C_{9}H_{11}NO_{3}}$.
 It's pretty easy for the computer to figure that out using matrix
@@ -523,7 +494,6 @@
 subcrt("LYSC_CHICK",1,T=25)
 @
 
-
 Note that using the keyword argument in \texttt{basis()} also set
 the logarithms of activities (or fugacity in the case of $\mathrm{O_{2}}_{\left(g\right)}$)
 to nominal values. While these settings do not affect the results
@@ -531,64 +501,17 @@
 the standard molal properties of the reaction), they are essential
 for calculating the relative stabilities of the species of interest.
 
-If the protein is not found in CHNOSZ's own database, the amino acid
-composition of the protein can be retrieved from the UniProt Knowledge
-Base using the Swiss-Prot name (if the computer is connected to the
-Internet). This is the only time a function in CHNOSZ asks for confirmation
-from a user, in order to give fair warning that an online activity
-is about to be performed.
+If the protein is not available in CHNOSZ's own database, the amino
+acid composition of the protein can be retrieved from the UniProtKB
+(if the computer is connected to the Internet).
 
-<<subcrt_ALAT1,eval=FALSE>>=
+<<subcrt_ALAT1>>=
+aa <- uniprot.aa("ALAT1_HUMAN")
+add.protein(aa)
 subcrt("ALAT1_HUMAN",1,T=25)
 @
 
-\begin{lyxcode}
-Shall~I~try~an~online~search~for~~ALAT1\_HUMAN~\_~SWISS~?~y
 
-protein:~trying~http://www.uniprot.org/uniprot/ALAT1\_HUMAN~...~got~it!
-
-protein:~found~P24298~...~~Alanine~aminotransferase~1~~(length~496).
-
-protein:~found~ALAT1\_HUMAN~(C2429H3866N684O705S22,~496~residues)
-
-subcrt:~1~species~at~298.15~K~and~1~bar~(wet)~
-
-subcrt:~reaction~is~not~balanced;~it~is~missing~this~composition:
-
-~~~~~C~~~~~H~~~~N~~~~O~~~S
-
-~-2429~-3866~-684~-705~-22
-
-subcrt:~adding~missing~composition~from~basis~definition~and~restarting...
-
-subcrt:~6~species~at~298.15~K~and~1~bar~(wet)~
-
-\$reaction
-
-~~~~~coeff~~~~~~~~name~~~~~~~~~~~~~~~formula~state~ispecies
-
-2926~~~~~1~ALAT1\_HUMAN~C2429H3866N684O705S22~~~~aq~~~~~2926
-
-69~~~-2429~~~~~~~~~CO2~~~~~~~~~~~~~~~~~~~CO2~~~~aq~~~~~~~69
-
-1~~~~~-885~~~~~~~water~~~~~~~~~~~~~~~~~~~H2O~~~liq~~~~~~~~1
-
-68~~~~-684~~~~~~~~~NH3~~~~~~~~~~~~~~~~~~~NH3~~~~aq~~~~~~~68
-
-70~~~~~-22~~~~~~~~~H2S~~~~~~~~~~~~~~~~~~~H2S~~~~aq~~~~~~~70
-
-2691~~2519~~~~~~oxygen~~~~~~~~~~~~~~~~~~~~O2~~~gas~~~~~2691
-
-\$out
-
-~~~T~P~~~~~~logK~~~~~~~~~G~~~~~~~~~H~~~~~~~~S~~~~~~V~~~~~~~~Cp
-
-1~25~1~-191972.3~261897066~273248830~38245.59~-73411~-107650.2
-
-\end{lyxcode}
-
-
-
 \section{Activity diagrams}
 
 
@@ -608,6 +531,7 @@
 of temperature (I do!)
 
 \setkeys{Gin}{width=0.6\textwidth}
+
 <<Bjerrum_diagram,fig=TRUE,width=4,height=4>>=
 basis("CHNOS+")
 species(c("CO2", "HCO3-", "CO3-2"))
@@ -618,10 +542,28 @@
 e <- equilibrate(a)
 diagram(e, add=TRUE, col="red")
 @
+
 \setkeys{Gin}{width=1.0\textwidth}
 
+This just shows the speciation (relative abundances) of the aqueous
+carbonate species. Calculating the solubility of a carbonate mineral,
+or of $\mathrm{CO_{2}}$ gas, is possible, but more involved; try
+the following:
 
+\setkeys{Gin}{width=0.6\textwidth}
 
+\selectlanguage{english}%
+<<demo_solubility, results=hide, fig=TRUE>>=
+demo("solubility", ask=FALSE)
+@
+
+\setkeys{Gin}{width=1.0\textwidth}
+
+See the code of the demo (look for \texttt{demo/solubility.R} in the
+directory where CHNOSZ is installed) to change the calculation from
+calcite to $\mathrm{CO_{2}}$.
+
+
 \subsection{Stability diagram for proteins}
 
 Suppose that we are asked to calculate the relative stabilities of
@@ -641,7 +583,6 @@
 species(c("SLAP_ACEKI", "CSG_METJA", "CSG_METVO", "CSG_HALJP"))
 @
 
-
 Note the output: the matrix denotes the coefficients of each of the
 basis species in the formation reaction for one mole of each of the
 species of interest. The \textbf{formation reaction} is the chemical
@@ -669,7 +610,6 @@
 a <- affinity(O2=c(-90,-70))
 @
 
-
 Now we can use \texttt{equilibrate()} to calculate the equilibrium
 activities of the proteins and \texttt{diagram()} to plot them. \texttt{normalize=TRUE}
 invokes the normalization of the chemical formulas of the proteins
@@ -678,13 +618,15 @@
 where the legend should be placed on the plot.
 
 \setkeys{Gin}{width=0.6\textwidth}
+
+\selectlanguage{english}%
 <<CSG_diagram,fig=T,width=4,height=4>>=
 e <- equilibrate(a, normalize=TRUE)
 diagram(e, legend.x="bottomleft", ylim=c(-6, -2))
 @
+
 \setkeys{Gin}{width=1.0\textwidth}
 
-
 Notably, the protein from the organism found at the highest temperatures
 is relatively stable at more reduced conditions.
 
@@ -700,15 +642,17 @@
 but the resulting predominance diagram would be identical.
 
 \setkeys{Gin}{width=0.6\textwidth}
+
+\selectlanguage{english}%
 <<PredominanceDiagram,fig=T,width=4,height=4>>=
 species(c("SLAP_ACEKI", "SLAP_GEOSE", "SLAP_BACLI", "SLAP_AERSA"))
 basis(c("NH3", "H2S"), c(-1, -10))
 a <- affinity(O2=c(-85, -70), H2O=c(-5, 0))
 diagram(a, normalize=TRUE)
 @
+
 \setkeys{Gin}{width=1.0\textwidth}
 
-
 Equilibrium predominances for proteins as a function of two chemical
 activities! If you don't like the colors in the plot, don't worry...
 the colors can be changed by using the \texttt{col} argument of \texttt{diagram()}.
@@ -733,7 +677,6 @@
 @
 
 
-
 \subsection{A mineral example}
 
 This example is modeled after a figure on p. 246 of \citet{BJH84}
@@ -741,6 +684,8 @@
 1000 bar.
 
 \setkeys{Gin}{width=0.6\textwidth}
+
+\selectlanguage{english}%
 <<Bowers,fig=T,width=4,height=4>>=
 basis(c("HCl","H2O","Ca+2","CO2","Mg+2","SiO2","O2","H+"),
   c(999,0,999,999,999,999,999,-7))
@@ -749,9 +694,9 @@
 a <- affinity("Mg+2"=c(-12,-4),"Ca+2"=c(-8,0),T=300,P=1000)
 diagram(a)
 @
+
 \setkeys{Gin}{width=1.0\textwidth}
 
-
 The 999's in the assignment of logarithms of activities of basis species
 could be any number -- these settings do not affect the outcome of
 the calculation. This is so because 1) $\mathrm{HCl}$, $\mathrm{CO_{2}}$
@@ -795,7 +740,6 @@
 example(diagram)
 @
 
-
 Or you can use the following to run \emph{all} of the examples provided
 in the documentation for the package. You will see a lot of text fly
 by on the screen, as well as a variety of plots. The examples will
@@ -805,7 +749,6 @@
 examples()
 @
 
-
 There are even more examples that can be accessed by \texttt{demo()}
 (or \texttt{demos()} to run all of them):
 
@@ -813,7 +756,6 @@
 demo("findit")
 @
 
-
 If you want to add to or modify the thermodynamic database, read the
 instructions at the top of the help page for \texttt{thermo}:
 
@@ -821,7 +763,6 @@
 help(thermo)
 @
 
-
 Have fun!
 
 
@@ -860,6 +801,8 @@
 $T$, and degree sign in the units).
 
 \setkeys{Gin}{width=0.5\textwidth}
+
+\selectlanguage{english}%
 <<amylaseplot, fig=TRUE, results=hide, width=5, height=5>>=
 basis("CHNOSe")
 basis(c("NH3", "H2S"), c(-6, -3))
@@ -879,9 +822,9 @@
 ltext <- c("soils [BKM60]", "yellowstone [SWMP05]", "iceland [SA02]")
 legend("bottomleft", legend=ltext, pch=c(20, 3, 17))
 @
+
 \setkeys{Gin}{width=1.0\textwidth}
 
-
 \clearpage
 
 
@@ -898,6 +841,8 @@
 current version of CHNOSZ.
 
 \setkeys{Gin}{width=0.7\textwidth}
+
+\selectlanguage{english}%
 <<yeastplot, fig=TRUE, results=hide, width=7, height=5>>=
 locations <- yeastgfp()
 gfp <- yeastgfp(locations)
@@ -917,9 +862,9 @@
 db <- describe.basis(ibasis=(1:6)[-5])
 legend("topright", legend=c(dp, db), bty="n")
 @
+
 \setkeys{Gin}{width=1.0\textwidth}
 
-
 Notable features include: proteins in the early Golgi, endoplasmic
 reticulum (ER) and vacuole are chemically the most stable relative
 to those in other locations in the cell; proteins in the vacuole are
@@ -949,6 +894,7 @@
 
 \begin{small}
 \setkeys{Gin}{width=1.0\textwidth}
+
 <<bufferplot, fig=TRUE, results=hide, width=8, height=3.5>>=
 layout(matrix(1:2, nrow=1), widths=c(2, 1))
 b.species <- c("Fe", "CO2", "H2O", "N2", "H2", "H2S", "SiO2")
@@ -978,10 +924,10 @@
 legend("topleft", legend = c(describe.property("P", 300), describe.basis(ibasis=c(2,4)),
   "minerals", "HCN", "formaldehyde"), lty=c(NA, NA, NA, 1, 2, 3), bg="white")
 @
+
 \setkeys{Gin}{width=1.0\textwidth}
 \end{small}
 
-
 \clearpage
 
 
@@ -996,6 +942,7 @@
 
 \begin{small}
 \setkeys{Gin}{width=0.35\textwidth}
+
 <<revisit, fig=T, results=hide, width=4, height=4>>=
 basis("CHNOS")
 species(c("isoleucine", "tyrosine", "glutamic acid", "methionine", "aspartic acid"))
@@ -1004,10 +951,10 @@
 r <- revisit(e)
 title(main=paste("CV minimum =", round(r$optimum, 2)))
 @
+
 \setkeys{Gin}{width=1.0\textwidth}
 \end{small}
 
-
 The \texttt{balance=1} in \texttt{equilibrate()} means the relative
 stabilities are calculated using the formation reactions written per
 mole of amino acid (not conserving e.g. $\mathrm{CO_{2}}$ which would
@@ -1018,6 +965,8 @@
 
 \begin{small}
 \setkeys{Gin}{width=0.6\textwidth}
+
+\selectlanguage{english}%
 <<revisit_alpha, fig=T, results=hide, width=6, height=4>>=
 basis(c("CO2", "O2"), c(r$x, r$y))
 a <- affinity()
@@ -1027,10 +976,10 @@
 plot.new()
 legend("topleft", describe.basis(basis()), bg="white")
 @
+
 \setkeys{Gin}{width=1.0\textwidth}
 \end{small}
 
-
 This hypothetical metastably equilibrated mixture has very little
 methionine and aspartic acid. Can we find where the relative abundances
 of the amino acids have a more even distribution?
@@ -1053,16 +1002,18 @@
 
 \begin{small}
 \setkeys{Gin}{width=0.4\textwidth}
+
+\selectlanguage{english}%
 <<findit, fig=T, results=hide, width=4, height=4>>=
 basis("CHNOS")
 species(c("isoleucine", "tyrosine", "glutamic acid", "methionine", "aspartic acid"))
 f <- findit(list(CO2=c(-5, 5), O2=c(-85, -65), H2S=c(-10, 5), H2O=c(-10, 0)), 
   niter=5, res=10, balance=1)
 @
+
 \setkeys{Gin}{width=1.0\textwidth}
 \end{small}
 
-
 After 5 iterations, what are the fractional equilibrium abundances
 of the amino acids? Note that, during its operation, \texttt{findit()}
 updates the activities of the basis species so we don't have to set
@@ -1070,6 +1021,8 @@
 
 \begin{small}
 \setkeys{Gin}{width=0.6\textwidth}
+
+\selectlanguage{english}%
 <<findit_alpha, fig=T, results=hide, width=6, height=4>>=
 a <- affinity()
 par(mfrow=c(1, 2))
@@ -1078,10 +1031,10 @@
 plot.new()
 legend("topleft", describe.basis(basis()), bg="white")
 @
+
 \setkeys{Gin}{width=1.0\textwidth}
 \end{small}
 
-
 We found a combination of chemical activities of basis species that
 lowered the variation of the equilibrium activities of the amino acids.
 Woohoo!
@@ -1111,7 +1064,6 @@
 sessionInfo()
 @
 
-
 \bibliographystyle{plainnat}
 \bibliography{vig}
 

Modified: pkg/CHNOSZ/vignettes/anintro.lyx
===================================================================
--- pkg/CHNOSZ/vignettes/anintro.lyx	2015-03-06 11:12:22 UTC (rev 79)
+++ pkg/CHNOSZ/vignettes/anintro.lyx	2015-03-10 16:00:18 UTC (rev 80)
@@ -1,5 +1,5 @@
-#LyX 2.0 created this file. For more info see http://www.lyx.org/
-\lyxformat 413
+#LyX 2.1 created this file. For more info see http://www.lyx.org/
+\lyxformat 474
 \begin_document
 \begin_header
 \textclass article
@@ -17,18 +17,18 @@
 \maintain_unincluded_children false
 \language english
 \language_package default
-\inputencoding auto
+\inputencoding default
 \fontencoding global
 \font_roman palatino
 \font_sans default
 \font_typewriter default
+\font_math auto
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
 \font_sf_scale 100
 \font_tt_scale 100
-
 \graphics default
 \default_output_format default
 \output_sync 0
@@ -51,15 +51,24 @@
 \pdf_quoted_options "citecolor=blue"
 \papersize letterpaper
 \use_geometry true
-\use_amsmath 1
-\use_esint 1
-\use_mhchem 1
-\use_mathdots 1
-\cite_engine natbib_authoryear
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine natbib
+\cite_engine_type authoryear
+\biblio_style plainnat
 \use_bibtopic false
 \use_indices false
 \paperorientation portrait
 \suppress_date false
+\justification true
 \use_refstyle 0
 \branch load
 \selected 1
@@ -110,16 +119,27 @@
  Dick
 \end_layout
 
-\begin_layout Chunk
-<<echo=FALSE>>=
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
+
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+echo=FALSE
 \end_layout
 
-\begin_layout Chunk
+\end_inset
+
 options(width=90)
 \end_layout
 
-\begin_layout Chunk
-@
+\end_inset
+
+
 \end_layout
 
 \begin_layout Section
@@ -254,7 +274,7 @@
  under reference (non-equilibrium) conditions, calculate the equilibrium
  chemical activities, and finally plot the results;
 \begin_inset Foot
-status collapsed
+status open
 
 \begin_layout Plain Layout
 
@@ -336,19 +356,27 @@
 \begin_inset Branch stuff
 status open
 
-\begin_layout Chunk
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
 
-<<install_CHNOSZ,eval=FALSE>>=
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+install_CHNOSZ,eval=FALSE
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
 install.packages("CHNOSZ")
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
-@
+
 \end_layout
 
 \end_inset
@@ -363,21 +391,29 @@
 
 \begin_layout Standard
 \begin_inset Branch stuff
-status collapsed
+status open
 
-\begin_layout Chunk
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
 
-<<library_CHNOSZ>>=
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+library_CHNOSZ
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
 library(CHNOSZ)
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
-@
+
 \end_layout
 
 \end_inset
@@ -398,19 +434,27 @@
 \begin_inset Branch stuff
 status open
 
-\begin_layout Chunk
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
 
-<<data_thermo>>=
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+data_thermo
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
 data(thermo)
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
-@
+
 \end_layout
 
 \end_inset
@@ -458,19 +502,27 @@
 \begin_inset Branch stuff
 status open
 
-\begin_layout Chunk
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
 
-<<info_ethylene>>=
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+info_ethylene
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
 info("ethylene")
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
-@
+
 \end_layout
 
 \end_inset
@@ -501,19 +553,27 @@
 \begin_inset Branch stuff
 status open
 
-\begin_layout Chunk
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
 
-<<info_88>>=
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+info_88
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
 info(88)
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
-@
+
 \end_layout
 
 \end_inset
@@ -529,19 +589,27 @@
 \begin_inset Branch stuff
 status open
 
-\begin_layout Chunk
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
 
-<<info_ethylene_gas>>=
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+info_ethylene_gas
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
 info("ethylene","gas")
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
-@
+
 \end_layout
 
 \end_inset
@@ -565,24 +633,32 @@
 \begin_inset Branch stuff
 status open
 
-\begin_layout Chunk
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
 
-<<info_acetic>>=
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+info_acetic
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
 aadata <- info(info("acetic acid"))
 \end_layout
 
-\begin_layout Chunk
+\begin_layout Plain Layout
 
 print(aadata)
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
-@
+
 \end_layout
 
 \end_inset
@@ -619,19 +695,27 @@
 \begin_inset Branch stuff
 status open
 
-\begin_layout Chunk
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
 
-<<summary_thermo>>=
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+summary_thermo
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
 summary(thermo)
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
-@
+
 \end_layout
 
 \end_inset
@@ -667,19 +751,27 @@
 \begin_inset Branch stuff
 status open
 
-\begin_layout Chunk
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
 
-<<browse.refs,eval=F>>=
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+browse.refs,eval=F
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
 browse.refs(88)
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
-@
+
 \end_layout
 
 \end_inset
@@ -729,19 +821,27 @@
 \begin_inset Branch stuff
 status open
 
-\begin_layout Chunk
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
 
-<<info_acid>>=
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+info_acid
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
 info("acid")
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
-@
+
 \end_layout
 
 \end_inset
@@ -797,19 +897,27 @@
 \begin_inset Branch stuff
 status open
 
-\begin_layout Chunk
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
 
-<<info_spaceacid>>=
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+info_spaceacid
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
 info(" acid")
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
-@
+
 \end_layout
 
 \end_inset
@@ -835,19 +943,27 @@
 \begin_inset Branch stuff
 status open
 
-\begin_layout Chunk
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
 
-<<info_OH>>=
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+info_OH
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
 info("(OH)")
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
-@
+
 \end_layout
 
 \end_inset
@@ -889,29 +1005,37 @@
 \begin_inset Branch stuff
 status open
 
-\begin_layout Chunk
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
 
-<<protein_LYSC>>=
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+protein_LYSC
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
 ip <- iprotein("LYSC_CHICK")
 \end_layout
 
-\begin_layout Chunk
+\begin_layout Plain Layout
 
 aa <- ip2aa(ip)
 \end_layout
 
-\begin_layout Chunk
+\begin_layout Plain Layout
 
 aa2eos(aa)
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
-@
+
 \end_layout
 
 \end_inset
@@ -943,24 +1067,32 @@
 \begin_inset Branch stuff
 status open
 
-\begin_layout Chunk
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
 
-<<formula_LYSC>>=
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+formula_LYSC
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
 pf <- protein.formula(aa)
 \end_layout
 
-\begin_layout Chunk
+\begin_layout Plain Layout
 
 as.chemical.formula(pf)
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
-@
+
 \end_layout
 
 \end_inset
@@ -1011,24 +1143,32 @@
 \begin_inset Branch stuff
 status open
 
-\begin_layout Chunk
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
 
-<<info_LYSC>>=
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+info_LYSC
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
 si <- info("LYSC_CHICK")
 \end_layout
 
-\begin_layout Chunk
+\begin_layout Plain Layout
 
 info(si)
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
-@
+
 \end_layout
 
 \end_inset
@@ -1107,19 +1247,27 @@
 \begin_inset Branch stuff
 status open
 
-\begin_layout Chunk
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
 
-<<subcrt_water>>=
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+subcrt_water
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
 subcrt("water")
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
-@
+
 \end_layout
 
 \end_inset
@@ -1204,19 +1352,27 @@
 \begin_inset Branch stuff
 status open
 
-\begin_layout Chunk
+\begin_layout Standard
+\begin_inset Flex Chunk
+status open
 
-<<subcrt_C2H5OH>>=
+\begin_layout Plain Layout
+
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+subcrt_C2H5OH
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
 subcrt(c("C2H5OH","O2","CO2","H2O"),c(-1,-3,2,3),T=37)
 \end_layout
 
-\begin_layout Chunk
+\end_inset
 
-@
+
 \end_layout
 
 \end_inset
@@ -1254,19 +1410,27 @@
 \begin_inset Branch stuff
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/chnosz -r 80


More information about the CHNOSZ-commits mailing list