Skip to content

Commit

Permalink
Update for renamed function in canprot
Browse files Browse the repository at this point in the history
git-svn-id: svn://scm.r-forge.r-project.org/svnroot/chnosz/pkg/CHNOSZ@832 edb9625f-4e0d-4859-8d74-9fd3b1da38cb
  • Loading branch information
jedick committed Mar 16, 2024
1 parent 7a05c0a commit 29916e7
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 20 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Date: 2024-03-04
Date: 2024-03-16
Package: CHNOSZ
Version: 2.1.0-4
Version: 2.1.0-5
Title: Thermodynamic Calculations and Diagrams for Geochemistry
Authors@R: c(
person("Jeffrey", "Dick", , "[email protected]", role = c("aut", "cre"),
Expand Down
4 changes: 2 additions & 2 deletions inst/NEWS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
\newcommand{\Cp}{\ifelse{latex}{\eqn{C_P}}{\ifelse{html}{\out{<I>C<sub>P</sub></I>}}{Cp}}}
\newcommand{\DG0}{\ifelse{latex}{\eqn{{\Delta}G^{\circ}}}{\ifelse{html}{\out{&Delta;<I>G</I>&deg;}}{ΔG°}}}

\section{Changes in CHNOSZ version 2.1.0-3 (2024-03-02)}{
\section{Changes in CHNOSZ version 2.1.0-5 (2024-03-16)}{

\itemize{

\item Move \code{read.fasta()}, \code{count.aa()}, and \code{aasum()} to canprot package.
\item Move \code{read.fasta()}, \code{count.aa()}, and \code{aasum()} to canprot package with different names.

\item Remove \code{seq2aa()}.

Expand Down
4 changes: 0 additions & 4 deletions inst/TODO
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,3 @@ don't have to compile anything to install CHNOSZ updates).
- Re-enter data from PS01 and AP01 (original units in J not cal)

- subcrt(): Don't output properties in HKF region 4

[20220503]

- Don't use palply in read.fasta()
10 changes: 5 additions & 5 deletions inst/tinytest/test-add.protein.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ip2 <- add.protein(aa)
expect_equal(ip1, ip2, info = info)

info <- "Errors and messages occur in some circumstances"
expect_error(add.protein(canprot::count.aa("AAA")), "does not have the same columns as thermo\\(\\)\\$protein", info = info)
expect_error(add.protein(canprot::count_aa("AAA")), "does not have the same columns as thermo\\(\\)\\$protein", info = info)
expect_message(add.protein(pinfo(pinfo("CYC_BOVIN"))), "replaced 1 existing protein\\(s\\)", info = info)

info <- "group additivity for proteins gives expected values"
Expand All @@ -32,12 +32,12 @@ expect_equal(Cp, lprop$Cp, tolerance = 1e-5, info = info)
expect_equal(V, lprop$V, tolerance = 1e-4, info = info)
expect_equal(formula, lprop$formula, info = info)

info <- "read.fasta() identifies sequences correctly and gives amino acid compositions in the correct format"
info <- "read_fasta() identifies sequences correctly and gives amino acid compositions in the correct format"
ffile <- system.file("extdata/protein/rubisco.fasta", package = "CHNOSZ")
aa <- canprot::read.fasta(ffile)
expect_equal(aa[1, ], canprot::read.fasta(ffile, 1), info = info)
aa <- canprot::read_fasta(ffile)
expect_equal(aa[1, ], canprot::read_fasta(ffile, 1), info = info)
# Use unlist here so that different row names are not compared
aa8 <- canprot::read.fasta(ffile, 1:8)
aa8 <- canprot::read_fasta(ffile, 1:8)
expect_equal(unlist(aa[1:8, ]), unlist(aa8), info = info)
expect_message(ip1 <- add.protein(aa8), "added 8 new protein\\(s\\)", info = info)
expect_message(ip2 <- add.protein(aa8), "replaced 8 existing protein\\(s\\)", info = info)
Expand Down
2 changes: 1 addition & 1 deletion man/add.protein.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protein.formula(iprotein)
}

\seealso{
\code{\link[canprot]{read.fasta}} for reading amino acid compositions from FASTA files.
\code{\link[canprot]{read_fasta}} for reading amino acid compositions from FASTA files.

\code{\link{pinfo}} for protein-level functions (length, chemical formulas, reaction coefficients of basis species).
}
Expand Down
2 changes: 1 addition & 1 deletion man/rank.affinity.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Because balancing on a basis species (i.e., dividing by its reaction coefficient
datfile <- system.file("extdata/cpetc/rubisco.csv", package = "CHNOSZ")
fastafile <- system.file("extdata/protein/rubisco.fasta", package = "CHNOSZ")
dat <- read.csv(datfile)
aa <- canprot::read.fasta(fastafile)
aa <- canprot::read_fasta(fastafile)
groups <- sapply(c("A", "B", "E"), "==", dat$domain, simplify = FALSE)
names(groups) <- c("Archaea", "Bacteria", "Eukaryota")
ip <- add.protein(aa, as.residue = TRUE)
Expand Down
8 changes: 4 additions & 4 deletions vignettes/anintro.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ Calculations based on the formulas, such as the average oxidation state of carbo

Let's compare the `r zc` of Rubisco with optimal growth temperature of organisms, as shown in Figure 6a of @Dic14.
First we read a CSV file with the IDs of the proteins and the optimal growth temperatures (*T*<sub>opt</sub>); the midpoint of the range of *T*<sub>opt</sub> is used for plotting.
Then we use `canprot::read.fasta()` to read a FASTA file holding the amino acid sequences of the proteins; the function returns a data frame with the amino acid counts.
Then we use `canprot::read_fasta()` to read a FASTA file holding the amino acid sequences of the proteins; the function returns a data frame with the amino acid counts.
To put the proteins in the right order, the IDs in the CSV file are matched to the names of the proteins in the FASTA file.
Then, we calculate `r zc` from the formulas of the proteins.
Next, point symbols are assigned according to domain (Archaea, Bacteria, Eukaryota); numbers inside the symbols show the ordering of *T*<sub>opt</sub> in three temperature ranges (0--35 °C, 37.5--60 °C, and 65--100 °C).
Expand All @@ -1255,7 +1255,7 @@ file.copy("rubisco.svg", fig_path(".svg"))
# datfile <- system.file("extdata/cpetc/rubisco.csv", package = "CHNOSZ")
# fastafile <- system.file("extdata/protein/rubisco.fasta", package = "CHNOSZ")
# dat <- read.csv(datfile)
# aa <- canprot::read.fasta(fastafile)
# aa <- canprot::read_fasta(fastafile)
# Topt <- (dat$T1 + dat$T2) / 2
# idat <- match(dat$ID, substr(aa$protein, 4, 9))
# aa <- aa[idat, ]
Expand Down Expand Up @@ -1290,7 +1290,7 @@ file.copy("rubisco.svg", fig_path(".svg"))
datfile <- system.file("extdata/cpetc/rubisco.csv", package = "CHNOSZ")
fastafile <- system.file("extdata/protein/rubisco.fasta", package = "CHNOSZ")
dat <- read.csv(datfile)
aa <- canprot::read.fasta(fastafile)
aa <- canprot::read_fasta(fastafile)
Topt <- (dat$T1 + dat$T2) / 2
idat <- match(dat$ID, substr(aa$protein, 4, 9))
aa <- aa[idat, ]
Expand Down Expand Up @@ -1339,7 +1339,7 @@ lapply(c("CHNOS", "QEC"), function(thisbasis) {
By projecting the compositions of proteins into the `QEC` set of basis species, *n*<sub>`r o2`</sub> emerges as a strong indicator of oxidation state, while *n*<sub>`r h2o`</sub> is a relatively uncorrelated (i.e. independent) variable.
These independent variables make it easier to distinguish the effects of oxidation and hydration state in proteomic datasets [@DYT20].

- The [canprot](https://github.com/jedick/canprot) package has functions to calculate chemical metrics (*Z*<sub>C</sub>, *n*<sub>`r o2`</sub>, and *n*<sub>`r h2o`</sub>) directly from amino acid compositions of proteins, and to read amino acid compositions from FASTA files (`canprot::read.fasta()`).
- The [canprot](https://github.com/jedick/canprot) package has functions to calculate chemical metrics (*Z*<sub>C</sub>, *n*<sub>`r o2`</sub>, and *n*<sub>`r h2o`</sub>) directly from amino acid compositions of proteins, and to read amino acid compositions from FASTA files (`canprot::read_fasta()`).

## Normalization to residues

Expand Down
1 change: 0 additions & 1 deletion vignettes/mklinks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ sed -i 's/<code>?mosaic<\/code>/<code><a href="..\/html\/mosaic.html" style="bac
sed -i 's/<code>?buffer<\/code>/<code><a href="..\/html\/buffer.html" style="background-image:none;">?buffer<\/a><\/code>/g' anintro.html
sed -i 's/<code>?solubility<\/code>/<code><a href="..\/html\/solubility.html" style="background-image:none;">?solubility<\/a><\/code>/g' anintro.html
sed -i 's/<code>?ionize.aa<\/code>/<code><a href="..\/html\/ionize.aa.html" style="background-image:none;">?ionize.aa<\/a><\/code>/g' anintro.html
sed -i 's/<code>?count.aa<\/code>/<code><a href="..\/html\/util.fasta.html" style="background-image:none;">?count.aa<\/a><\/code>/g' anintro.html
sed -i 's/<code>?thermo<\/code>/<code><a href="..\/html\/thermo.html" style="background-image:none;">?thermo<\/a><\/code>/g' anintro.html
sed -i 's/<code>?hkf<\/code>/<code><a href="..\/html\/eos.html" style="background-image:none;">?hkf<\/a><\/code>/g' anintro.html
sed -i 's/<code>?cgl<\/code>/<code><a href="..\/html\/eos.html" style="background-image:none;">?cgl<\/a><\/code>/g' anintro.html
Expand Down

0 comments on commit 29916e7

Please sign in to comment.