filterPeaksMultiplicity: Multiplicity filtering: Removes peaks which occur only once...

Description Usage Arguments Value Author(s) Examples

View source: R/leMsMs.r


For every compound, every peak (with annotated formula) is compared across all spectra. Peaks whose formula occurs only once for all collision energies / spectra types, are discarded. This eliminates "stochastic formula hits" of pure electronic noise peaks efficiently from the spectra. Note that in the author's experimental setup two spectra were recorded at every collision energy, and therefore every peak-formula should appear at least twice if it is real, even if it is by chance a fragment which appears on only one collision energy setting. The function was not tested in a different setup. Therefore, use with a bit of caution.


filterPeaksMultiplicity(peaks, formulacol, recalcBest = TRUE)



An aggregate peak data.frame containing all peaks to be analyzed; with at least the columns cpdID, scan, mzFound and one column for the formula specified with the formulacol parameter.


Which column the assigned formula is stored in. (Needed to separately process "formula" and "reanalyzed.formula" multiplicites.)


Whether the best formula for each peak should be re-determined. This is necessary for results from the ordinary analyzeMsMs analysis which allows multiple potential formulas per peak - the old best match could potentially have been dropped because of multiplicity filtering. For results from reanalyzeFailpeak this is not necessary, since only one potential formula is assigned in this case.


The peak table is returned, enriched with columns:

  • formulaMultiplicityThe # of occurrences of this formula in the spectra of its compounds.


Michael Stravs, EAWAG <>


## Not run: 
		peaksFiltered <- filterPeaksMultiplicity(peaksMatched(w), 
			"formula", TRUE)
		peaksOK <- subset(peaksFiltered, formulaMultiplicity > 1)

## End(Not run)

RMassBank documentation built on May 20, 2017, 9:31 p.m.
Search within the RMassBank package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.