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.
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