Skip to main content

Annotate peptides with the proteins that contain them

Description

Finds every occurrence of each peptide in fasta with annotate_aho() and flags whether it is preceded by a tryptic cleavage site. Peptides that occur in no protein are dropped.

Usage

annotate_peptides(
  peptides,
  fasta,
  peptide = "peptide_seq",
  prefix = "(([RK])|(^)|(^M))",
  suffix = ""
)

Arguments

peptides A character vector of peptide sequences, or a data frame (or tibble) with the column named by peptide and any further columns, such as the charge state, which are kept. It must not have the columns protein_id, offset, protein_sequence, matched or peptide_length, which the result adds.
fasta A list of protein sequences with unique names, as returned by read_fasta().
peptide Name of the column with the peptide sequences.
prefix Regular expression the residues before a match must end with.
suffix Regular expression the residues after a match must start with.

Details

Each occurrence of a peptide in a protein is one row. matched is TRUE when the residues before that occurrence match prefix and the residues after it match suffix. With the defaults, matched means: preceded by K or R or the protein N-terminus (or by the Met at position 1). The end of the peptide is not checked, neither its last residue nor a following proline; pass a suffix to check the residues after it.

Whitespace around the peptide sequences, such as the “ of a file with Windows line endings, is removed before the search, and the result holds the trimmed sequences.

Value

A data frame with one row per row of peptides and protein occurrence: the columns of peptides, protein_id, offset (1-based start of the peptide), protein_sequence (as searched, see annotate_aho()), matched and peptide_length. With 0 rows and a warning if no peptide occurs in fasta.

See Also

Other protein inference: annotate_aho(), greedy_parsimony(), greedy_to_table(), pepprot, protpepmetashort

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")
fasta <- read_fasta(fasta_file)
annot <- annotate_peptides(peptides[1:20], fasta)
head(annot[, c("protein_id", "peptide_seq", "offset", "peptide_length", "matched")])
             protein_id              peptide_seq offset peptide_length matched
1 sp|P02765|FETUA_HUMAN AQLVPLPPSTYVEFTVSGTDCVAK    188             24    TRUE
2  sp|P06396|GELS_HUMAN   AQPVQVAEGSEPDGFWEALGGK    627             22    TRUE
3  sp|P01011|AACT_HUMAN      AVLDVFEEGTEASAATAVK    361             19    TRUE
4  sp|P02787|TRFE_HUMAN            CSTSSLLEACTFR    684             13    TRUE
5  sp|P01011|AACT_HUMAN                EIGELYLPK    307              9    TRUE
6 sp|P01767|HV353_HUMAN      EVQLVETGGGLIQPGGSLR     20             19   FALSE