Find a minimal protein set with a greedy algorithm
Description
Repeatedly assigns all unexplained peptides of the protein that explains the most of them. Proteins that explain exactly the same unexplained peptides are reported together, separated by ;. The groups are formed on the peptides that remain in each round: proteins B (peptides p1, p5, p6) and C (p2, p5, p6) form the group “B;C” for p5 and p6 after protein A has taken p1 and p2.
A data frame (or tibble) with one row per peptide-protein match, e.g. from annotate_peptides(): the protein IDs in the column protein_id and the peptide IDs in the column named by peptide (character or factor columns, without NA; unused factor levels are ignored).
peptide
Name of the column with the peptide IDs. For precursors, add a column such as paste(peptide_seq, precursor_charge, sep = “.”) and pass its name.
Details
Proteins are ranked by the number of distinct peptides they explain; a peptide-protein pair that occurs in several rows counts once. Of the proteins that tie, the one first in the order of the IDs is taken first. The IDs of a character column are in C-locale order, as by sort(method = “radix”), whatever the locale: upper case before lower case; those of a factor column in the level order.
Value
A named character vector with one element per distinct peptide ID, named by the peptide ID: the protein, or ;-separated protein group, it is assigned to. The elements are in the order in which the groups are chosen, and the peptides of a group, like the proteins of a group, in the order of the IDs.
See Also
Other protein inference: annotate_aho(), annotate_peptides(), greedy_to_table(), pepprot, protpepmetashort
Examples
library("prozor")data(protpepmetashort)groups <-greedy_parsimony(protpepmetashort, peptide ="peptide_mod_seq")# every modified peptide is assigned to exactly one protein groupstopifnot(setequal(names(groups), protpepmetashort$peptide_mod_seq))head(groups)