This Vignette describes how the greedy_parsimony() function can be used to infer proteins from peptide identifications using the Occam’s razor principle. The method tries to find a minimal set of proteins which can explain all the peptides identified.
Annotate peptide sequences with protein sequences from two FASTA files, one with reviewed entries only (sp) and the other with reviewed and TrEMBL entries (sp/tr).
matches <-data.frame(database =c("All", "Canonical"), matches =c(nrow(annotation_all), nrow(annotation_canonical)))ggplot(matches, aes(x = database, y = matches)) +geom_col(fill ="#0072B2") +geom_text(aes(label = matches), vjust =-0.3) +labs(x =NULL, y ="peptide protein matches")
Number of peptide protein matches for the All and Canonical database.
We can see that using the larger FASTA database reduces the proportion of proteotypic peptides. A proteotypic peptide is one which matches only a single protein.
We can now identify a minimal set of proteins explaining all the peptides observed for both databases. greedy_parsimony() takes a table with one row per peptide-protein match; a peptide observed as several precursors gives repeated rows, which count once.
precursors <-distinct(id_results, peptideModSeq, precursorCharge, peptideSeq)# peptide protein matches as points; rows and columns sorted by their number of matches,# proteotypic peptides (one protein) in redplot_matches <-function(annotation) { pairs <-distinct(annotation, peptide =factor(peptideSeq), protein =factor(protein_id)) peptide_matches <-tabulate(pairs$peptide, nlevels(pairs$peptide)) peptide_rank <-rank(-peptide_matches, ties.method ="first") protein_rank <-rank(-tabulate(pairs$protein, nlevels(pairs$protein)), ties.method ="first") matches <-data.frame(peptide = peptide_rank[pairs$peptide],protein = protein_rank[pairs$protein],proteotypic = peptide_matches[pairs$peptide] ==1 )ggplot(matches) +geom_point(aes(x = protein, y = peptide, colour = proteotypic), shape =15, size =0.5) +scale_colour_manual(name =NULL,values =c(`FALSE`="black", `TRUE`="red"),labels =c(`FALSE`="shared", `TRUE`="proteotypic") ) +scale_y_reverse() +labs(x ="proteins, most peptides first", y ="peptides, most proteins first")}
Protein Inference for database with TrEMBL identifiers
We see that the number of proteins needed to explain all the peptides is practically identical for both databases. Also in practice using a database with more entries does not lead to more identified proteins. On the contrary, it might even reduce the number of proteins identified.