Skip to main content

Plot the peptide coverage of a protein sequence

Description

Writes the protein sequence in rows of width residues. Each residue is a tile colored by the number of peptides that cover it; uncovered residues are gray.

Usage

plot_coverage(residues, protein_id, width = 50)

Arguments

residues A result of residue_coverage().
protein_id The protein to plot: one protein ID, a value of residues$protein_id.
width Residues per row: a positive whole number.

Value

A ggplot object; the y axis labels the position of the first residue of each row.

See Also

Other sequence coverage: residue_coverage(), sequence_coverage()

Examples

library("prozor")

file <- system.file("extdata/IDResults.txt.gz", package = "prozor")
peptides <- unique(utils::read.delim(file)$peptideSeq)
fasta_file <- system.file("p1000_db1_example/Annotation_canSeq.fasta.gz", package = "prozor")
annot <- annotate_peptides(peptides, read_fasta(fasta_file))
coverage <- sequence_coverage(annot)
best <- coverage$protein_id[which.max(coverage$coverage)]
plot_coverage(residue_coverage(annot), best)