findChromPeaks: Chromatographic Peak Detection

findChromPeaksR Documentation

Chromatographic Peak Detection


The findChromPeaks method performs chromatographic peak detection on LC/GC-MS data. The peak detection algorithm can be selected, and configured, using the param argument.

Supported param objects are:

  • CentWaveParam(): chromatographic peak detection using the centWave algorithm.

  • CentWavePredIsoParam(): centWave with predicted isotopes. Peak detection uses a two-step centWave-based approach considering also feature isotopes.

  • MatchedFilterParam(): peak detection using the matched filter algorithm.

  • MassifquantParam(): peak detection using the Kalman filter-based massifquant method.

  • MSWParam(): single-spectrum non-chromatography MS data peak detection.

For specific examples see the help pages of the individual parameter classes listed above.


findChromPeaks(object, param, ...)

## S4 method for signature 'MsExperiment,Param'
  msLevel = 1L,
  chunkSize = 2L,
  BPPARAM = bpparam()

## S4 method for signature 'XcmsExperiment,Param'
  msLevel = 1L,
  chunkSize = 2L,
  add = FALSE,
  BPPARAM = bpparam()



The data object on which to perform the peak detection. Can be an OnDiskMSnExp(), XCMSnExp(), MChromatograms() or MsExperiment() object.


The parameter object selecting and configuring the algorithm.


Optional parameters.


integer(1) defining the MS level on which the chromatographic peak detection should be performed.


integer(1) for object being an MsExperiment or XcmsExperiment(): defines the number of files (samples) for which the full peaks data (m/z and intensity values) should be loaded into memory at the same time. Peak detection is then performed in parallel (per sample) on this subset of loaded data. This setting thus allows to balance between memory demand and speed (due to parallel processing) of the peak detection. Because parallel processing can only performed on the subset of data loaded currently into memory (in each iteration), the value for chunkSize should be match the defined parallel setting setup. Using a parallel processing setup using 4 CPUs (separate processes) but using ⁠chunkSize = ⁠1⁠will not perform any parallel processing, as only the data from one sample is loaded in memory at a time. On the other hand, setting⁠chunkSize⁠to the total number of samples in an experiment will load the full MS data into memory and will thus in most settings cause an out-of-memory error. By setting⁠chunkSize = -1⁠the peak detection will be performed separately, and in parallel, for each sample. This will however not work for all⁠Spectra' backends (see eventually Spectra() for details).


Parallel processing setup. Uses by default the system-wide default setup. See bpparam() for more details.


logical(1) (if object contains already chromatographic peaks, i.e. is either an XCMSnExp or XcmsExperiment) whether chromatographic peak detection results should be added to existing results. By default (add = FALSE) any additional findChromPeaks call on a result object will remove previous results.


Johannes Rainer

See Also

plotChromPeaks() to plot identified chromatographic peaks for one file.

refineChromPeaks() for methods to refine or clean identified chromatographic peaks.

manualChromPeaks() to manually add/define chromatographic peaks.

Other peak detection methods: findChromPeaks-centWave, findChromPeaks-centWaveWithPredIsoROIs, findChromPeaks-massifquant, findChromPeaks-matchedFilter, findPeaks-MSW

sneumann/xcms documentation built on June 5, 2024, 4:28 p.m.