This method 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.

# S4 method for 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.

See also

feature-grouping for a general overview.

Other feature grouping methods: groupFeatures-eic-correlation, groupFeatures-similar-rtime

Author

Johannes Rainer

Examples

## Performing a quick preprocessing of a test data set. library(faahKO) fls <- c(system.file('cdf/KO/ko15.CDF', package = "faahKO"), system.file('cdf/KO/ko16.CDF', package = "faahKO"), system.file('cdf/WT/wt19.CDF', package = "faahKO")) od <- readMSData(fls, mode = "onDisk")
#> Polarity can not be extracted from netCDF files, please set manually the polarity with the 'polarity' method.
xod <- findChromPeaks( od, param = CentWaveParam(noise = 10000, snthresh = 40, prefilter = c(3, 10000)))
#> Detecting mass traces at 25 ppm ...
#> OK
#> Detecting chromatographic peaks in 937 regions of interest ...
#> OK: 87 found.
#> Detecting mass traces at 25 ppm ...
#> OK
#> Detecting chromatographic peaks in 1025 regions of interest ...
#> OK: 100 found.
#> Detecting mass traces at 25 ppm ...
#> OK
#> Detecting chromatographic peaks in 623 regions of interest ...
#> OK: 71 found.
pdp <- PeakDensityParam(sampleGroups = c(1, 1, 2)) xodg <- groupChromPeaks(xod, param = pdp)
#> Processing 2867 mz slices ...
#> OK
## 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)
#> #> FG.001 FG.002 FG.003 FG.004 FG.005 FG.006 FG.007 FG.008 FG.009 FG.010 FG.011 #> 1 9 13 5 4 7 1 1 1 1 1 #> FG.012 FG.013 FG.014 FG.015 FG.016 FG.017 FG.018 FG.019 FG.020 FG.021 FG.022 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.023 FG.024 FG.025 FG.026 FG.027 FG.028 FG.029 FG.030 FG.031 FG.032 FG.033 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.034 FG.035 FG.036 FG.037 FG.038 FG.039 FG.040 FG.041 FG.042 FG.043 FG.044 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.045 FG.046 FG.047 FG.048 FG.049 FG.050 FG.051 FG.052 FG.053 FG.054 FG.055 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.056 FG.057 FG.058 FG.059 FG.060 FG.061 FG.062 FG.063 FG.064 FG.065 FG.066 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.067 FG.068 FG.069 FG.070 FG.071 FG.072 FG.073 FG.074 FG.075 FG.076 FG.077 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.078 FG.079 FG.080 FG.081 FG.082 FG.083 FG.084 FG.085 FG.086 FG.087 FG.088 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.089 FG.090 FG.091 FG.092 FG.093 FG.094 FG.095 FG.096 FG.097 FG.098 FG.099 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.100 FG.101 FG.102 FG.103 FG.104 FG.105 FG.106 FG.107 FG.108 FG.109 FG.110 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.111 FG.112 FG.113 FG.114 FG.115 FG.116 FG.117 FG.118 FG.119 FG.120 FG.121 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.122 FG.123 #> 1 1
## 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)
#> #> FG.001 FG.002 FG.003 FG.004 FG.005 FG.006 FG.007 FG.008 FG.009 FG.010 FG.011 #> 1 9 13 5 4 7 1 1 1 1 1 #> FG.012 FG.013 FG.014 FG.015 FG.016 FG.017 FG.018 FG.019 FG.020 FG.021 FG.022 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.023 FG.024 FG.025 FG.026 FG.027 FG.028 FG.029 FG.030 FG.031 FG.032 FG.033 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.034 FG.035 FG.036 FG.037 FG.038 FG.039 FG.040 FG.041 FG.042 FG.043 FG.044 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.045 FG.046 FG.047 FG.048 FG.049 FG.050 FG.051 FG.052 FG.053 FG.054 FG.055 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.056 FG.057 FG.058 FG.059 FG.060 FG.061 FG.062 FG.063 FG.064 FG.065 FG.066 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.067 FG.068 FG.069 FG.070 FG.071 FG.072 FG.073 FG.074 FG.075 FG.076 FG.077 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.078 FG.079 FG.080 FG.081 FG.082 FG.083 FG.084 FG.085 FG.086 FG.087 FG.088 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.089 FG.090 FG.091 FG.092 FG.093 FG.094 FG.095 FG.096 FG.097 FG.098 FG.099 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.100 FG.101 FG.102 FG.103 FG.104 FG.105 FG.106 FG.107 FG.108 FG.109 FG.110 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.111 FG.112 FG.113 FG.114 FG.115 FG.116 FG.117 FG.118 FG.119 FG.120 FG.121 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.122 FG.123 #> 1 1