Functions to filter out PSMs matching. The PSMs should be stored
in a PSM such as those produced by PSM().
filterPsmDecoy()filters out decoy PSMs, i.e. those annotated asisDecoy.
filterPsmRank()filters out PSMs of rank > 1.
filterPsmShared()filters out shared PSMs, i.e. those that match multiple proteins.
filterPsmFdr()filters out PSMs based on their FDR.
Usage
filterPSMs(
x,
decoy = psmVariables(x)["decoy"],
rank = psmVariables(x)["rank"],
protein = psmVariables(x)["protein"],
spectrum = psmVariables(x)["spectrum"],
peptide = psmVariables(x)["peptide"],
verbose = TRUE
)
filterPsmDecoy(x, decoy = psmVariables(x)["decoy"], verbose = TRUE)
filterPsmRank(x, rank = psmVariables(x)["rank"], verbose = TRUE)
filterPsmShared(
x,
protein = psmVariables(x)["protein"],
peptide = psmVariables(x)["peptide"],
verbose = TRUE
)
filterPsmFdr(x, FDR = 0.05, fdr = psmVariables(x)["fdr"], verbose = TRUE)Arguments
- x
An instance of class
PSM.- decoy
character(1)with the column name specifying whether entries match the decoy database or not. Default is thedecoyPSM variable as defined inpsmVariables(). The column should be alogicaland only PSMs holding aFALSEare retained. Filtering is ignored if set toNULLorNA.- rank
character(1)with the column name holding the rank of the PSM. Default is therankPSM variable as defined inpsmVariables(). This column should be anumericand only PSMs having rank equal to 1 are retained. Filtering is ignored if set toNULLorNA.- protein
character(1)with the column name holding the protein (groups) protein. Default is theproteinPSM variable as defined inpsmVariables(). Filtering is ignored if set toNULLorNA.- spectrum
character(1)with the name of the spectrum identifier column. Default is thespectrumPSM variable as defined inpsmVariables(). Filtering is ignored if set toNULLorNA.- peptide
character(1)with the name of the peptide identifier column. Default is thepeptidePSM variable as defined inpsmVariables(). Filtering is ignored if set toNULLorNA.- verbose
logical(1)setting the verbosity flag.- FDR
numeric(1)to be used to filter based on thefdrvariable. Default is 0.05.- fdr
character(1)variable name that defines that defines the spectrum FDR (or any similar/relevant metric that can be used for filtering). This value isn't set by default as it depends on the search engine and application. Default isNA.
Examples
f <- MsDataHub::TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01.20141210.mzid()
#> see ?MsDataHub and browseVignettes('MsDataHub') for documentation
#> loading from cache
id <- PSM(f)
filterPSMs(id)
#> Starting with 5802 PSMs:
#> Removed 2896 decoy hits.
#> Removed 155 PSMs with rank > 1.
#> Removed 85 shared peptides.
#> 2666 PSMs left.
#> PSM with 2666 rows and 35 columns.
#> names(35): sequence spectrumID ... subReplacementResidue subLocation
