Learn R Programming

MSnID (version 1.6.0)

apply_filter: Filters the MS/MS identifications

Description

Filter out peptide-to-spectrum MS/MS identifications.

Usage

apply_filter(msnidObj, filterObj)

Arguments

msnidObj
An instance of class "MSnID".
filterObj
Either an instance of MSnIDFilter class or a "character".

Value

Returns an instance of "MSnID" class with with peptide-to-spectrum matches that pass criteria defined in filterObj argument.

Details

filterObj argument evaluated to a "logical" for each entry of the MS/MS results table.

See Also

MSnID evaluate_filter

Examples

Run this code
data(c_elegans)

## Filtering using string:
msnidObj <- assess_termini(msnidObj, validCleavagePattern="[KR]\\.[^P]")
table(msnidObj$numIrregCleavages)
# getting rid of any other peptides except fully tryptic
msnidObj <- apply_filter(msnidObj, "numIrregCleavages == 0")
show(msnidObj)

## Filtering using filter object:
# first adding columns that will be used as filters
msnidObj$msmsScore <- -log10(msnidObj$`MS-GF:SpecEValue`)
msnidObj$mzError <- abs(msnidObj$experimentalMassToCharge - 
                        msnidObj$calculatedMassToCharge)
# setting up filter object
filtObj <- MSnIDFilter(msnidObj)
filtObj$msmsScore <- list(comparison=">", threshold=10.0)
filtObj$mzError <- list(comparison="<", threshold=0.1) # 0.1 Thomson
show(filtObj)
# applying filter and comparing MSnID object before and after
show(msnidObj)
msnidObj <- apply_filter(msnidObj, filtObj)
show(msnidObj)

Run the code above in your browser using DataLab