Skip to main content

Find peptides in protein sequences with the Aho-Corasick algorithm

Description

Searches all peptides at once with AhoCorasickTrie::AhoCorasickSearch(). Peptides that occur in no protein are dropped.

Usage

annotate_aho(peptides, fasta, peptide = "peptide_seq")

Arguments

peptides Peptide sequences: upper-case letters only, without whitespace or modifications. annotate_peptides() removes surrounding whitespace before it calls this function.
fasta A list of protein sequences with unique names, as returned by read_fasta().
peptide Name of the result column that holds the peptide sequences.

Details

The protein sequences are searched in upper case, with each character other than a letter, such as the stop codon * of a translated database or a blank, replaced by X. The offsets are those of the sequences in fasta.

Value

A data frame with one row per occurrence and the columns protein_id, peptide (named by the argument), offset (1-based start of the peptide) and protein_sequence (the sequence as searched); with 0 rows if no peptide occurs.

See Also

Other protein inference: annotate_peptides(), 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)
hits <- annotate_aho(peptides[1:20], fasta)
dim(hits)
[1] 20  4