selectPeaks {RMassBank} | R Documentation

## Select peaks from aggregate table

### Description

Selects peaks from aggregate table according to different criteria.

### Usage

    selectPeaks(o, ...)

    ## S4 method for signature 'RmbSpectrum2'
    selectPeaks(o, filter, ..., enclos = parent.frame(2))

    ## S4 method for signature 'RmbSpectrum2List'
    selectPeaks(o, ..., enclos = parent.frame(2))

    ## S4 method for signature 'RmbSpectraSetList'
    selectPeaks(o, ..., enclos = parent.frame(2))

    ## S4 method for signature 'data.frame'
    selectPeaks(o, filter, ..., enclos = parent.frame(2))

    ## S4 method for signature 'msmsWorkspace'
    selectPeaks(o, ..., enclos = parent.frame(2))

    ## S4 method for signature 'RmbSpectrum2List,numeric,numeric'
    cleanElnoise(
      peaks,
      noise = getOption("RMassBank")$electronicNoise,
      width = getOption("RMassBank")$electronicNoiseWidth
    )

### Arguments

`o` | `msmsWorkspace` or aggregate `data.frame` from a workspace.
`...` | no additional parameters
`good` | if `TRUE`, include good (matched within filter criteria) peaks.
`bad` | if `TRUE`, include bad (not matched within filter criteria) peaks. Note: `good` and `bad` can be combined, both are returned in that case.
`cleaned` | if `TRUE`, return only peaks which passed the noise filter. Note: If the noise filter was not applied, the parameter has no effect. Also, a `noise` column is in any case added to the output, even if not present before.
`best` | if `TRUE`, only select the best match for each peak (i.e. the formula with smallest delta ppm). Otherwise multiple matches can be returned.

### Value

Peak dataframe according to the specified criteria.

### Methods (by class)

- `RmbSpectrum2`: A method to filter spectra to the specified peaks

- `RmbSpectrum2List`: A method to filter spectra to the specified peaks

- `RmbSpectraSetList`: A method to filter spectra to the specified peaks

- `data.frame`: A method to retrieve the specified peaks from the "aggregated" slot (a data.frame object) in an msmsWorkSpace

- `msmsWorkspace`: A method to retrieve the specified peaks from an msmsWorkSpace

- `peaks = RmbSpectrum2List,noise = numeric,width = numeric`: A method to filter spectra to the specified peaks

### Author(s)

stravsmi

[Package RMassBank version 3.0.0 Index]