groupFeatures-similar-rtime | R Documentation |
Group features based on similar retention time. This method is supposed to be
used as an initial crude grouping of features based on the median retention
time of all their chromatographic peaks. All features with a difference in
their retention time which is <=
parameter diffRt
of the parameter object
are grouped together. If a column "feature_group"
is found in
featureDefinitions()
this is further sub-grouped by this method.
See MsFeatures::SimilarRtimeParam()
in MsFeatures
for more details.
## S4 method for signature 'XcmsResult,SimilarRtimeParam'
groupFeatures(object, param, msLevel = 1L, ...)
object |
|
param |
|
msLevel |
|
... |
passed to the |
the input object with feature groups added (i.e. in column
"feature_group"
of its featureDefinitions
data frame.
Johannes Rainer
Other feature grouping methods:
groupFeatures-abundance-correlation
,
groupFeatures-eic-similarity
library(MsFeatures)
library(MsExperiment)
## Load a test data set with detected peaks
faahko_sub <- loadXcmsData("faahko_sub2")
## 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 similar retention time (i.e. difference <= 2 seconds)
xodg_grp <- groupFeatures(xodg, param = SimilarRtimeParam(diffRt = 2))
## Feature grouping get added to the featureDefinitions in column "feature_group"
head(featureDefinitions(xodg_grp)$feature_group)
table(featureDefinitions(xodg_grp)$feature_group)
length(unique(featureDefinitions(xodg_grp)$feature_group))
## Using an alternative groupiing method that creates larger groups
xodg_grp <- groupFeatures(xodg,
param = SimilarRtimeParam(diffRt = 2, groupFun = MsCoreUtils::group))
length(unique(featureDefinitions(xodg_grp)$feature_group))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.