CleanPeaksParam {xcms} | R Documentation

## Remove chromatographic peaks with too large rt width

### Description

Remove chromatographic peaks with a retention time range larger than the provided maximal acceptable width (`maxPeakwidth`).

### Usage

    CleanPeaksParam(maxPeakwidth = 10)

    ## S4 method for signature 'XCMSnExp,CleanPeaksParam'
    refineChromPeaks(object, param = CleanPeaksParam(), msLevel = 1L)

### Arguments

`maxPeakwidth` | for `CleanPeaksParam`: `numeric(1)` defining the maximal allowed peak width (in retention time).
`object` | XCMSnExp object with identified chromatographic peaks.
`param` | `CleanPeaksParam` object defining the settings for the method.
`msLevel` | `integer` defining for which MS level(s) the chromatographic peaks should be cleaned.

### Value

`XCMSnExp` object with chromatographic peaks exceeding the specified maximal retention time width being removed.

### Note

`refineChromPeaks` methods will always remove feature definitions, because a call to this method can change or remove identified chromatographic peaks, which may be part of features.

### Author(s)

Johannes Rainer

### See Also

Other chromatographic peak refinement methods: `FilterIntensityParam`, `MergeNeighboringPeaksParam`

### Examples

    ## Load a test data set with detected peaks
    data(faahko_sub)
    ## Update the path to the files for the local system
    dirname(faahko_sub) <- system.file("cdf/KO", package = "faahKO")

    ## Disable parallel processing for this example
    register(SerialParam())

    ## Distribution of chromatographic peak widths
    quantile(chromPeaks(faahko_sub)[, "rtmax"] - chromPeaks(faahko_sub)[, "rtmin"])

    ## Remove all chromatographic peaks with a width larger 60 seconds
    data <- refineChromPeaks(faahko_sub, param = CleanPeaksParam(60))

    quantile(chromPeaks(data)[, "rtmax"] - chromPeaks(data)[, "rtmin"])

[Package xcms version 3.16.1 Index]