[CHNOSZ-commits] r134 - in pkg/CHNOSZ: . demo inst inst/extdata/fasta man tests/testthat

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Feb 5 12:43:21 CET 2017


Author: jedick
Date: 2017-02-05 12:43:21 +0100 (Sun, 05 Feb 2017)
New Revision: 134

Removed:
   pkg/CHNOSZ/inst/extdata/fasta/HTCC1062.faa.xz
Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/demo/revisit.R
   pkg/CHNOSZ/inst/NEWS
   pkg/CHNOSZ/man/extdata.Rd
   pkg/CHNOSZ/man/iprotein.Rd
   pkg/CHNOSZ/tests/testthat/test-util.program.R
Log:
remove HTCC1062.faa.xz


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2017-02-05 09:51:24 UTC (rev 133)
+++ pkg/CHNOSZ/DESCRIPTION	2017-02-05 11:43:21 UTC (rev 134)
@@ -1,6 +1,6 @@
 Date: 2017-02-05
 Package: CHNOSZ
-Version: 1.0.8-23
+Version: 1.0.8-24
 Title: Chemical Thermodynamics and Activity Diagrams
 Author: Jeffrey Dick
 Maintainer: Jeffrey Dick <j3ffdick at gmail.com>

Modified: pkg/CHNOSZ/demo/revisit.R
===================================================================
--- pkg/CHNOSZ/demo/revisit.R	2017-02-05 09:51:24 UTC (rev 133)
+++ pkg/CHNOSZ/demo/revisit.R	2017-02-05 11:43:21 UTC (rev 134)
@@ -1,13 +1,14 @@
 ## Demo for revisit(): CV of equilibrium activities of proteins in
-## Pelagibacter ubique.
-## Also shows use of grep.file(), read.fasta(), add.protein()
-f <- system.file("extdata/fasta/HTCC1062.faa.xz", package="CHNOSZ")
-# what proteins to select (set to "" for all proteins)
-w <- "ribosomal"
-# locate entries whose names contain w
-j <- grep.file(f, w)
-# get the amino acid compositions of these proteins
-aa <- read.fasta(f, j)
+## subcellular compartment of S. cerevisiae
+
+# get the proteins in the requested location
+loc <- "cell.periphery"
+y <- yeastgfp(loc)
+# get the amino acid compositions of the proteins
+aa <- more.aa(y$protein, "Sce")
+# don't use those with NA abundance or sequence
+ina <- is.na(y$abundance) | is.na(aa$chains)
+aa <- aa[!ina, ]
 # add these proteins to CHNOSZ's inventory
 ip <- add.protein(aa)
 # set up a the chemical system
@@ -19,21 +20,19 @@
 e <- equilibrate(a, loga.balance=0, normalize=TRUE)
 diagram(e, names=NULL)
 # make a title
-expr <- as.expression(substitute(x~y~"proteins in"~
-  italic("P. ubique"), list(x=length(j), y=w)))
+expr <- as.expression(substitute(x~loc~"proteins in"~
+  italic("S. cerevisiae"), list(x=length(ip), loc=loc)))
 mtitle(c("Equilibrium activities of", expr))
 # show the coefficient of variation
 revisit(e, "CV")
 mtitle(c("CV of equilibrium activities of", expr))
 # calculate affinities in logfO2-logaH2O space
-a <- affinity(O2=c(-85,-65), H2O=c(-10,0), iprotein=ip)
+a <- affinity(O2=c(-85, -65), H2O=c(-5, 5), iprotein=ip)
 # show the predominances
-diagram(a, normalize=TRUE, fill="heat")
+diagram(a, normalize=TRUE, fill="heat", format.names=FALSE)
 # calculate the equilibrium activities
 e <- equilibrate(a, loga.balance=0, normalize=TRUE)
 # show the coefficient of variation
 r <- revisit(e, "CV")
-stopifnot(r$ix==37)
-stopifnot(r$iy==53)
 mtitle(c("CV of equilibrium activities of", expr))
 par(opar)

Modified: pkg/CHNOSZ/inst/NEWS
===================================================================
--- pkg/CHNOSZ/inst/NEWS	2017-02-05 09:51:24 UTC (rev 133)
+++ pkg/CHNOSZ/inst/NEWS	2017-02-05 11:43:21 UTC (rev 134)
@@ -1,4 +1,4 @@
-CHANGES IN CHNOSZ 1.0.8-23 (2017-02-05)
+CHANGES IN CHNOSZ 1.0.8-24 (2017-02-05)
 ---------------------------------------
 
 - Add "AA" as a keyword for preset species in basis() (cysteine,
@@ -47,6 +47,8 @@
 
 - Add '...' argument to thermo.plot.new() (extra arguments for par()).
 
+- Remove HTCC1062.faa.xz.
+
 CHANGES IN CHNOSZ 1.0.8 (2016-05-28)
 ------------------------------------
 

Deleted: pkg/CHNOSZ/inst/extdata/fasta/HTCC1062.faa.xz
===================================================================
(Binary files differ)

Modified: pkg/CHNOSZ/man/extdata.Rd
===================================================================
--- pkg/CHNOSZ/man/extdata.Rd	2017-02-05 09:51:24 UTC (rev 133)
+++ pkg/CHNOSZ/man/extdata.Rd	2017-02-05 11:43:21 UTC (rev 134)
@@ -39,7 +39,6 @@
 
   Files in \code{fasta} contain protein sequences:
   \itemize{
-    \item \code{HTCC1062.faa.xz} is a FASTA file of 1354 protein sequences in the organism \emph{Pelagibacter ubique} HTCC1062 downloaded from the NCBI RefSeq collection on 2009-04-12. The search term was Protein: txid335992[Organism:noexp] AND "refseq"[Filter]. See \code{\link{util.fasta}} and \code{\link{revisit}} for examples that use this file.
     \item \code{EF-Tu.aln} consists of aligned sequences (394 amino acids) of elongation factor Tu (EF-Tu). The sequences correspond to those taken from UniProtKB for ECOLI (\emph{Escherichia coli}), THETH (\emph{Thermus thermophilus}) and THEMA (\emph{Thermotoga maritima}), and reconstructed ancestral sequences taken from Gaucher et al., 2003 (maximum likelihood bacterial stem and mesophilic bacterial stem, and alternative bacterial stem). See the \sQuote{formation} vignette for an example that uses this file.
   }
 

Modified: pkg/CHNOSZ/man/iprotein.Rd
===================================================================
--- pkg/CHNOSZ/man/iprotein.Rd	2017-02-05 09:51:24 UTC (rev 133)
+++ pkg/CHNOSZ/man/iprotein.Rd	2017-02-05 11:43:21 UTC (rev 134)
@@ -87,33 +87,6 @@
 stopifnot(as.chemical.formula(protein.formula(ip))=="C41H69N11O18")
 # we can also calculate a formula without using add.protein
 as.chemical.formula(protein.formula(seq2aa("pentapeptide_test", "ANLSG")))
-
-# read a fasta file, calculate H/C and O/C for all proteins
-# and averages by polypeptide chain, residue and mass
-ffile <- system.file("extdata/fasta/HTCC1062.faa.xz", package="CHNOSZ")
-aa <- read.fasta(ffile)
-pf <- as.data.frame(protein.formula(aa))
-plot(pf$H/pf$C, pf$O/pf$C, pch=NA)
-points(pf$H/pf$C, pf$O/pf$C, pch=20, cex=0.5, col="grey")
-# average composition per polypeptide chain
-chainaa <- aasum(aa, average=TRUE)
-chainpf <- as.data.frame(protein.formula(chainaa))
-points(chainpf$H/chainpf$C, chainpf$O/chainpf$C, pch=15, col="red")
-# average by amino acid residue
-pl <- protein.length(aa)
-resaa <- aasum(aa, abundance=pl, average=TRUE)
-respf <- as.data.frame(protein.formula(resaa))
-points(respf$H/respf$C, respf$O/respf$C, pch=16, col="red")
-# average by mass
-pm <- mass(pf)
-massaa <- aasum(aa, abundance=pm, average=TRUE)
-masspf <- as.data.frame(protein.formula(massaa))
-points(masspf$H/masspf$C, masspf$O/masspf$C, pch=17, col="red")
-# add a legend and title
-legend("topright", pch=c(20, 15, 16, 17), col=c("grey", rep("red", 3)),
-  legend=c("protein", "chain average", "residue average", "mass average"))
-title(main=paste("O/C vs H/C for HTCC1062 proteins\n",
-  "n =", nrow(aa)))
 }
 
 \seealso{

Modified: pkg/CHNOSZ/tests/testthat/test-util.program.R
===================================================================
--- pkg/CHNOSZ/tests/testthat/test-util.program.R	2017-02-05 09:51:24 UTC (rev 133)
+++ pkg/CHNOSZ/tests/testthat/test-util.program.R	2017-02-05 11:43:21 UTC (rev 134)
@@ -14,15 +14,16 @@
 
 test_that("other functions are calling palply() properly", {
   if(min(getOption("mc.cores"), 2) > 1 & parallel::detectCores() > 1) {
-    ff <- system.file("extdata/fasta/HTCC1062.faa.xz", package="CHNOSZ")
-    expect_message(aa <- read.fasta(ff), "read.fasta running 1354 calculations")
-    # ^^^ also messaged: count.aa running 1354 calculations
-    ip <- add.protein(aa)
+    # CHNOSZ no longer has a large FASTA file to test this with 20170205
+    #ff <- system.file("extdata/fasta/HTCC1062.faa.xz", package="CHNOSZ")
+    #expect_message(aa <- read.fasta(ff), "read.fasta running 1354 calculations")
+    ip <- 1:nrow(thermo$protein)
     basis("CHNOS")
-    expect_message(a <- affinity(O2=c(-90, -60, 1000), iprotein=ip), "affinity running 1354 calculations")
+    expect_message(a <- affinity(iprotein=rep(ip, 3)), "affinity running 1359 calculations")
+    expect_message(e <- equilibrate(a, normalize=TRUE), "equil.boltzmann running 1359 calculations")
+    # test reaction method
+    species(c("CO2", "acetic acid"))
+    a <- affinity(O2=c(-90, -60, 1000))
     expect_message(e <- equilibrate(a), "equil.reaction running 1000 calculations")
-    expect_message(e <- equilibrate(a, normalize=TRUE), "equil.boltzmann running 1354 calculations")
-    # ^^^ above message repeated 2x
   }
 })
-



More information about the CHNOSZ-commits mailing list