[CHNOSZ-commits] r730 - in pkg/CHNOSZ: . R demo inst man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Jun 20 07:41:11 CEST 2022
Author: jedick
Date: 2022-06-20 07:41:11 +0200 (Mon, 20 Jun 2022)
New Revision: 730
Modified:
pkg/CHNOSZ/DESCRIPTION
pkg/CHNOSZ/NAMESPACE
pkg/CHNOSZ/R/add.protein.R
pkg/CHNOSZ/demo/rank_affinity.R
pkg/CHNOSZ/inst/NEWS.Rd
pkg/CHNOSZ/man/add.protein.Rd
Log:
Remove aasum()
Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION 2022-06-20 05:20:16 UTC (rev 729)
+++ pkg/CHNOSZ/DESCRIPTION 2022-06-20 05:41:11 UTC (rev 730)
@@ -1,6 +1,6 @@
Date: 2022-06-20
Package: CHNOSZ
-Version: 1.9.9-22
+Version: 1.9.9-23
Title: Thermodynamic Calculations and Diagrams for Geochemistry
Authors at R: c(
person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"),
Modified: pkg/CHNOSZ/NAMESPACE
===================================================================
--- pkg/CHNOSZ/NAMESPACE 2022-06-20 05:20:16 UTC (rev 729)
+++ pkg/CHNOSZ/NAMESPACE 2022-06-20 05:41:11 UTC (rev 730)
@@ -25,7 +25,7 @@
"getrank", "parent", "sciname", "allparents", "getnodes", "getnames",
"protein.OBIGT", "which.pmax",
"equil.boltzmann", "equil.reaction", "find.tp",
- "ionize.aa", "MP90.cp", "aasum",
+ "ionize.aa", "MP90.cp",
"qqr", "RMSD", "CVRMSD", "spearman", "DGmix", "DDGmix", "DGtr",
"ratlab",
# demos
Modified: pkg/CHNOSZ/R/add.protein.R
===================================================================
--- pkg/CHNOSZ/R/add.protein.R 2022-06-20 05:20:16 UTC (rev 729)
+++ pkg/CHNOSZ/R/add.protein.R 2022-06-20 05:41:11 UTC (rev 730)
@@ -4,7 +4,6 @@
# add.protein - add amino acid counts to thermo()$protein (returns iprotein)
# seq2aa - calculate amino acid counts from a sequence
-# aasum - combine amino acid counts (sum, average, or weighted sum by abundance)
seq2aa <- function(protein, sequence) {
# remove newlines and whitespace
@@ -22,38 +21,6 @@
return(aa)
}
-aasum <- function(aa, abundance=1, average=FALSE, protein=NULL, organism=NULL) {
- # returns the sum of the amino acid counts in aa,
- # multiplied by the abundances of the proteins
- abundance <- rep(abundance, length.out=nrow(aa))
- # drop any NA rows or abundances
- ina.aa <- is.na(aa$chains)
- ina.ab <- is.na(abundance)
- ina <- ina.aa | ina.ab
- if(any(ina)) {
- aa <- aa[!ina, ]
- abundance <- abundance[!ina]
- message("aasum: dropped ", sum(ina), " proteins with NA composition and/or abundance")
- }
- # we don't know how to deal with different numbers of polypeptide chains
- if(!all(aa$chains==aa$chains[1])) stop("different numbers of polypeptide chains")
- # multiply
- aa[, 6:25] <- aa[, 6:25] * abundance
- # sum
- out <- aa[1, ]
- out[, 5:25] <- colSums(aa[, 5:25])
- # average if told to do so
- if(average) {
- # polypeptide chains by number of proteins, residues by frequence
- out[, 5] <- out[, 5]/nrow(aa)
- out[, 6:25] <- out[, 6:25]/sum(abundance)
- }
- # add protein and organism names if given
- if(!is.null(protein)) out$protein <- protein
- if(!is.null(organism)) out$organism <- organism
- return(out)
-}
-
add.protein <- function(aa, as.residue = FALSE) {
# Add a properly constructed data frame of
# amino acid counts to thermo()$protein
Modified: pkg/CHNOSZ/demo/rank_affinity.R
===================================================================
--- pkg/CHNOSZ/demo/rank_affinity.R 2022-06-20 05:20:16 UTC (rev 729)
+++ pkg/CHNOSZ/demo/rank_affinity.R 2022-06-20 05:41:11 UTC (rev 730)
@@ -5,12 +5,13 @@
library(CHNOSZ)
# Experimental data are from Tai et al. (2005)
+# https://doi.org/10.1074/jbc.M410573200
file <- system.file("extdata/protein/TBD+05.csv", package = "CHNOSZ")
dat <- read.csv(file, row.names = 1, check.names = FALSE)
-# The activities of ammonium and sulfate used here
-# are similar to the non-growth-limiting concentrations
-# used by Boer et al. (2003)
+# The activities of ammonium and sulfate are similar to the
+# non-growth-limiting concentrations used by Boer et al. (2003)
+# https://doi.org/10.1074/jbc.M209759200
basis(c("glucose", "H2O", "NH4+", "oxygen", "SO4-2", "H+"),
c(-1, 0, -1.3, 999, -1.4, -7))
Modified: pkg/CHNOSZ/inst/NEWS.Rd
===================================================================
--- pkg/CHNOSZ/inst/NEWS.Rd 2022-06-20 05:20:16 UTC (rev 729)
+++ pkg/CHNOSZ/inst/NEWS.Rd 2022-06-20 05:41:11 UTC (rev 730)
@@ -100,6 +100,8 @@
\item \code{EOSregress()} and the associated demo and vignette have been
removed.
+ \item Remove \code{aasum()}.
+
}
}
Modified: pkg/CHNOSZ/man/add.protein.Rd
===================================================================
--- pkg/CHNOSZ/man/add.protein.Rd 2022-06-20 05:20:16 UTC (rev 729)
+++ pkg/CHNOSZ/man/add.protein.Rd 2022-06-20 05:41:11 UTC (rev 730)
@@ -2,7 +2,6 @@
\name{add.protein}
\alias{add.protein}
\alias{seq2aa}
-\alias{aasum}
\title{Amino Acid Compositions of Proteins}
\description{
Functions to get amino acid compositions and add them to protein list for use by other functions.
@@ -11,7 +10,6 @@
\usage{
add.protein(aa, as.residue = FALSE)
seq2aa(protein, sequence)
- aasum(aa, abundance = 1, average = FALSE, protein = NULL, organism = NULL)
}
\arguments{
@@ -19,9 +17,6 @@
\item{as.residue}{logical, normalize by protein length?}
\item{protein}{character, name of protein; numeric, indices of proteins (rownumbers of \code{\link{thermo}$protein})}
\item{sequence}{character, protein sequence}
- \item{abundance}{numeric, abundances of proteins}
- \item{average}{logical, return the weighted average of amino acid counts?}
- \item{organism}{character, name of organism}
}
\details{
@@ -34,11 +29,6 @@
\code{seq2aa} returns a data frame of amino acid composition, in the format of \code{thermo()$protein}, corresponding to the provided \code{sequence}.
Here, the \code{protein} argument indicates the name of the protein with an underscore (e.g. \samp{LYSC_CHICK}).
-\code{aasum} returns a data frame representing the sum of amino acid compositions in the rows of the input \code{aa} data frame.
-The amino acid compositions are multiplied by the indicated \code{abundance}; that argument is recycled to match the number of rows of \code{aa}.
-If \code{average} is TRUE the final sum is divided by the number of input compositions.
-The name used in the output is taken from the first row of \code{aa} or from \code{protein} and \code{organism} if they are specified.
-
Given amino acid compositions returned by the \code{*aa} functions described above, \code{add.protein} adds them to \code{thermo()$protein} for use by other functions in CHNOSZ.
Set \code{as.residue} to TRUE to normalize by protein length; each input amino acid composition is divided by the corresponding number of residues, with the result that the sum of amino acid frequencies for each protein is 1.
The amino acid compositions of proteins in \code{aa} with the same name as one in \code{thermo()$protein} are replaced.
More information about the CHNOSZ-commits
mailing list