View source: R/do_groupChromPeaks-functions.R
do_groupChromPeaks_density | R Documentation |
The do_groupChromPeaks_density
function performs chromatographic peak
grouping based on the density (distribution) of peaks, found in different
samples, along the retention time axis in slices of overlapping m/z ranges.
By default (with parameter ppm = 0
) these m/z ranges have all the same
(constant) size (depending on parameter binSize
). For values of ppm
larger than 0 the m/z bins (ranges or slices) will have increasing sizes
depending on the m/z value. This better models the m/z-dependent
measurement error/precision seen on some MS instruments.
do_groupChromPeaks_density(
peaks,
sampleGroups,
bw = 30,
minFraction = 0.5,
minSamples = 1,
binSize = 0.25,
maxFeatures = 50,
sleep = 0,
index = seq_len(nrow(peaks)),
ppm = 0
)
peaks |
A |
sampleGroups |
For |
bw |
For |
minFraction |
For |
minSamples |
For |
binSize |
For |
maxFeatures |
For |
sleep |
|
index |
An optional |
ppm |
For |
For overlapping slices along the mz dimension, the function calculates the density distribution of identified peaks along the retention time axis and groups peaks from the same or different samples that are close to each other. See (Smith 2006) for more details.
A data.frame
, each row representing a (mz-rt) feature (i.e. a peak group)
with columns:
"mzmed"
: median of the peaks' apex mz values.
"mzmin"
: smallest mz value of all peaks' apex within the feature.
"mzmax"
:largest mz value of all peaks' apex within the feature.
"rtmed"
: the median of the peaks' retention times.
"rtmin"
: the smallest retention time of the peaks in the group.
"rtmax"
: the largest retention time of the peaks in the group.
"npeaks"
: the total number of peaks assigned to the feature.
"peakidx"
: a list
with the indices of all peaks in a feature in the
peaks
input matrix.
Note that this number can be larger than the total number of samples, since multiple peaks from the same sample could be assigned to a feature.
The default settings might not be appropriate for all LC/GC-MS setups,
especially the bw
and binSize
parameter should be adjusted
accordingly.
Colin Smith, Johannes Rainer
Colin A. Smith, Elizabeth J. Want, Grace O'Maille, Ruben Abagyan and Gary Siuzdak. "XCMS: Processing Mass Spectrometry Data for Metabolite Profiling Using Nonlinear Peak Alignment, Matching, and Identification" Anal. Chem. 2006, 78:779-787.
Other core peak grouping algorithms:
do_groupChromPeaks_nearest()
,
do_groupPeaks_mzClust()
## Load the test file
library(xcms)
library(MsExperiment)
faahko_sub <- loadXcmsData("faahko_sub2")
## Disable parallel processing for this example
register(SerialParam())
## Extract the matrix with the identified peaks from the xcmsSet:
pks <- chromPeaks(faahko_sub)
## Perform the peak grouping with default settings:
res <- do_groupChromPeaks_density(pks, sampleGroups = rep(1, 3))
## The feature definitions:
head(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.