R/greedy.R
greedy.Rd
given matrix (columns protein rows peptides), compute minimal protein set using greedy algorithm
greedy(pepprot)
pepprot | matrix as returned by prepareMatrix |
---|
list of peptide protein assignment
#library(prozor) data(protpepmetashort) colnames(protpepmetashort) #> [1] "peptideSeq" "lengthProtein" "proteinID" "peptideModSeq" #> [5] "precursorCharge" "m" "lengthPeptide" dim(unique(protpepmetashort[,4])) #> NULL xx = prepareMatrix(protpepmetashort, peptideID = "peptideModSeq") dim(xx) #> [1] 154 250 stopifnot(dim(xx)[1] == dim(unique(protpepmetashort[,4]))[1]) es = greedy(xx) stopifnot(length(unique(names(es))) == dim(unique(protpepmetashort[,4]))[1])