apply_filter {MSnID} | R Documentation

## 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"`.

### Details

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

### Value

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

### Author(s)

Vladislav A Petyuk vladislav.petyuk@pnnl.gov

### See Also

`MSnID` `evaluate_filter`

### Examples

    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)

[Package MSnID version 1.14.0 Index]