Skip to content

Commit

Permalink
Rebuild vignettes in inst/doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jedick committed Mar 4, 2024
1 parent 602fa52 commit 86d8f1c
Show file tree
Hide file tree
Showing 14 changed files with 483 additions and 58 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-03
Date: 2024-03-04
Package: canprot
Version: 1.1.2-30
Version: 1.1.2-31
Title: Chemical Analysis of Proteins
Authors@R: c(
person("Jeffrey", "Dick", email = "[email protected]", role = c("aut", "cre"),
Expand Down
12 changes: 11 additions & 1 deletion R/read.fasta.R
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,23 @@ count.aa <- function(sequence, start = NULL, stop = NULL, type = "protein") {
aasum <- function(AAcomp, abundance = 1, average = FALSE) {
# Recycle abundance values into same length as number of proteins
abundance <- rep(abundance, length.out = nrow(AAcomp))
# Find columns with names for the amino acids and "chains"
# Find columns with names for the amino acids and 'chains'
# (number of polypeptide chains)
AA_names <- c(
"Ala", "Cys", "Asp", "Glu", "Phe", "Gly", "His", "Ile", "Lys", "Leu",
"Met", "Asn", "Pro", "Gln", "Arg", "Ser", "Thr", "Val", "Trp", "Tyr",
"chains"
)
isAA <- tolower(colnames(AAcomp)) %in% tolower(AA_names)
# Remove proteins with NA amino acid composition or abundance
ina.aa <- is.na(rowSums(AAcomp[, isAA]))
ina.ab <- is.na(abundance)
ina <- ina.aa | ina.ab
if (any(ina)) {
AAcomp <- AAcomp[!ina, ]
abundance <- abundance[!ina]
message("aasum: dropped ", sum(ina), " proteins with NA amino acid composition and/or abundance")
}
# Multiply amino acid counts by protein abundance
AAcomp[, isAA] <- AAcomp[, isAA] * abundance
# Sum amino acid counts
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ demo("canprot")
<img src="inst/images/canprot.png" alt="Zc and pI for human proteins in subcellular locations" title="canprot demo" width="600px" />

These plots show carbon oxidation state (*Z*<sub>C</sub>) and isoelectric point (pI) for human proteins in different subcellular locations.
The localization data is from Table S6 of [Thul et al. (2017)](10.1126/science.aal3321) (*A subcellular map of the human proteome*), filtered to include proteins that have both a validated location and only one predicted location.
The localization data is from Table S6 of [Thul et al. (2017)](https://doi.org/10.1126/science.aal3321) (*A subcellular map of the human proteome*), filtered to include proteins that have both a validated location and only one annotated location.
2 changes: 1 addition & 1 deletion inst/NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CHANGES IN canprot 1.1.2-29 (2024-03-03)
CHANGES IN canprot 1.1.2-30 (2024-03-03)
----------------------------------------

- Objects in cplab are now `quote()`-ed instead of `expression()`s for easier
Expand Down
Loading

0 comments on commit 86d8f1c

Please sign in to comment.