groupFeatures-abundance-correlation {xcms} | R Documentation

## Compounding/feature grouping based on similarity of abundances across samples

### Description

Features from the same originating compound are expected to have similar intensities across samples. This method this groups features based on similarity of abundances (i.e. feature values) across samples. See also `AbundanceSimilarityParam()` for additional information and details.

This help page lists parameters specific for `xcms` result objects (i.e. the `XCMSnExp()` object). Documentation of the parameters for the similarity calculation is available in the `AbundanceSimilarityParam()` help page in the `MsFeatures` package.

### Usage

    ## S4 method for signature 'XCMSnExp,AbundanceSimilarityParam'
    groupFeatures(
      object,
      param,
      msLevel = 1L,
      method = c("medret", "maxint", "sum"),
      value = "into",
      intensity = "into",
      filled = TRUE,
      ...
    )

### Arguments

`object` | `XCMSnExp()` object containing also correspondence results.
`param` | `AbudanceSimilarityParam` object with the settings for the method. See `AbundanceSimilarityParam()` for details on the grouping method and its parameters.
`msLevel` | `integer(1)` defining the MS level on which the features should be grouped.
`method` | `character(1)` passed to the `featureValues` call. See `featureValues()` for details. Defaults to `method = "medret"`.
`value` | `character(1)` passed to the `featureValues` call. See `featureValues()` for details. Defaults to `value = "into"`.
`intensity` | `character(1)` passed to the `featureValues` call. See `featureValues()` for details. Defaults to `intensity = "into"`.
`filled` | `logical(1)` whether filled-in values should be included in the correlation analysis. Defaults to `filled = TRUE`.
`...` | additional parameters passed to the `groupFeatures` method for `matrix`.

### Value

input `XCMSnExp` with feature group definitions added to a column `"feature_group"` in its `featureDefinitions` data frame.

### Author(s)

Johannes Rainer

### See Also

feature-grouping for a general overview.

Other feature grouping methods: `groupFeatures-eic-similarity`, `groupFeatures-similar-rtime`

### Examples

    library(MsFeatures)
    ## 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())

    ## Group chromatographic peaks across samples
    xodg <- groupChromPeaks(faahko_sub, param = PeakDensityParam(sampleGroups = rep(1, 3)))

    ## Group features based on correlation of feature values (integrated
    ## peak area) across samples. Note that there are many missing values
    ## in the feature value which influence grouping of features in the present
    ## data set.
    xodg_grp <- groupFeatures(xodg,
        param = AbundanceSimilarityParam(threshold = 0.8))
    table(featureDefinitions(xodg_grp)$feature_group)

    ## Group based on the maximal peak intensity per feature
    xodg_grp <- groupFeatures(xodg,
        param = AbundanceSimilarityParam(threshold = 0.8, value = "maxo"))
    table(featureDefinitions(xodg_grp)$feature_group)

[Package xcms version 3.16.1 Index]