plot_protein_coverage: Shows the peptide location(s) on the protein sequence

Description Usage Arguments Value Author(s) Examples

Description

Shows the peptide location(s) on the protein sequence.

Usage

1
2
3
4
    plot_protein_coverage(object, 
                          accession, 
                          
                          ...)

Arguments

object

An instance of class MSnID.

accession

(string) accession name.

...

Used for passing save_plot. If TRUE, then image is saved as a PNG file.

Value

if save_plot = FALSE, then returns ggplot2 object

Author(s)

Vladislav A Petyuk vladislav.petyuk@pnnl.gov

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
m <- MSnID(".")
mzids <- system.file("extdata","phospho.mzid.gz",package="MSnID")
m <- read_mzIDs(m, mzids)
fst_path <- system.file("extdata","for_phospho.fasta.gz",package="MSnID")
library(Biostrings)
fst <- readAAStringSet(fst_path)
# ensure names are the same format as accessions(m)
names(fst) <- sub("(^[^ ]*) .*$", "\1", names(fst))

# Creating sequences with repeats. This is just for the sake of 
# demonstration of the capability.
for(i in 2:4){
    fst[i] <- paste0(as.character(fst[i]),as.character(fst[i]))
}

# Appending reverse hits. Also, just for the demonstrating the capability.
mr <- mf <- apply_filter(m, "!isDecoy")
library(stringi)
mr$peptide <- stringi::stri_reverse(mr$peptide)
mr$accession <- paste0("XXX_", mr$accession)
mr$isDecoy <- TRUE
psms(m) <- rbind(psms(mr), psms(mf))

# the main call
m2 <- map_peptide_position(m, fst)
plot_protein_coverage(m2, "sp|Q9Y2W1|TR150_HUMAN", save_plot = FALSE)

# clean-up cache
unlink(".Rcache", recursive=TRUE)

vladpetyuk/MSnID documentation built on June 25, 2021, 6:35 a.m.