findChromPeaks,Chromatogram,CentWaveParam-method {xcms}R Documentation

centWave-based peak detection in purely chromatographic data

Description

findChromPeaks on a Chromatogram or Chromatograms object with a CentWaveParam parameter object performs centWave-based peak detection on purely chromatographic data. See centWave for details on the method and CentWaveParam for details on the parameter class. Note that not all settings from the CentWaveParam will be used. See peaksWithCentWave() for the arguments used for peak detection on purely chromatographic data.

Usage

## S4 method for signature 'Chromatogram,CentWaveParam'
findChromPeaks(object, param, ...)

Arguments

object

a Chromatogram or Chromatograms object.

param

a CentWaveParam object specifying the settings for the peak detection. See peaksWithCentWave() for the description of arguments used for peak detection.

...

currently ignored.

Value

If called on a Chromatogram object, the method returns a matrix with the identified peaks. See peaksWithCentWave() for details on the matrix content.

Author(s)

Johannes Rainer

See Also

peaksWithCentWave() for the downstream function and centWave for details on the method.

Examples


od <- readMSData(system.file("cdf/KO/ko15.CDF", package = "faahKO"),
    mode = "onDisk")

## Extract chromatographic data for a small m/z range
chr <- chromatogram(od, mz = c(272.1, 272.3))[1, 1]

## Identify peaks with default settings
pks <- findChromPeaks(chr, CentWaveParam())
pks

## Plot the identified peaks
plot(chr, type = "h")
rect(xleft = pks[, "rtmin"], xright = pks[, "rtmax"],
    ybottom = rep(0, nrow(pks)), ytop = pks[, "maxo"], col = "#ff000020")

## Modify the settings
cwp <- CentWaveParam(snthresh = 5, peakwidth = c(10, 60))
pks <- findChromPeaks(chr, cwp)
pks

plot(chr, type = "h")
rect(xleft = pks[, "rtmin"], xright = pks[, "rtmax"],
    ybottom = rep(0, nrow(pks)), ytop = pks[, "maxo"], col = "#00ff0020")

[Package xcms version 3.4.4 Index]