filterMultiplicity {RMassBank} | R Documentation

## filterMultiplicity

### Description

Multiplicity filtering: Removes peaks which occur only once in a n-spectra set.

### Usage

    filterMultiplicity(w, archivename=NA, mode="pH", recalcBest = TRUE,
    		multiplicityFilter = getOption("RMassBank")$multiplicityFilter)

### Arguments

`w` | Workspace containing the data to be processed (aggregate table and `RmbSpectraSet` objects)
`archivename` | The archive name, used for generation of archivename_Failpeaks.csv
`mode` | Mode of ion analysis
`recalcBest` | Boolean, whether to recalculate the formula multiplicity after the first multiplicity filtering step. Sometimes, setting this to FALSE can be a solution if you have many compounds with e.g. fluorine atoms, which often have multiple assigned formulas per peak and might occasionally lose peaks because of that.
`multiplicityFilter` | Threshold for the multiplicity filter. If set to 1, no filtering will apply (minimum 1 occurrence of peak). 2 equals minimum 2 occurrences etc.

### Details

This function executes multiplicity filtering for a set of spectra using the workhorse function `filterPeaksMultiplicity` (see details there) and retrieves problematic filtered peaks (peaks which are of high intensity but were discarded, because either no formula was assigned or it was not present at least 2x), using the workhorse function `problematicPeaks`. The results are returned in a format ready for further processing with `mbWorkflow`.

### Value

A list object with values:

`peaksOK` | Peaks with >1-fold formula multiplicity from the "normal" peak analysis.
`peaksReanOK` | Peaks with >1-fold formula multiplicity from peak reanalysis.
`peaksFiltered` | All peaks with annotated formula multiplicity from first analysis.
`peaksFilteredReanalysis` | All peaks with annotated formula multiplicity from peak reanalysis.
`peaksProblematic` | Peaks with high intensity which do not match inclusion criteria -> possible false negatives. The list will be exported into archivename_failpeaks.csv.

### Author(s)

Michael Stravs

### See Also

`filterPeaksMultiplicity`,`problematicPeaks`

### Examples

    ## Not run:
        refilteredRcSpecs <- filterMultiplicity(
    			w, "myarchive", "pH")

    ## End(Not run)

[Package RMassBank version 2.10.1 Index]