View source: R/functions-XCMSnExp.R
featureChromatograms | R Documentation |
Extract ion chromatograms for features in an XCMSnExp object. The function returns for each feature its extracted ion chromatogram and all associated peaks with it.
By default only chromatographic peaks associated with a feature are included
for an extracted ion chromatogram. Setting include = "all"
(instead of
the default include = "feature_only"
) will return all chromatographic peaks
identified in the m/z - rt data slice of a feature (and eventually also other
features within that region).
featureChromatograms(x, expandRt = 0, aggregationFun = "max", features,
include = c("feature_only", "all"), filled = FALSE, ...)
x |
|
expandRt |
|
aggregationFun |
|
features |
|
include |
|
filled |
|
... |
optional arguments to be passed along to the |
XChromatograms()
object.
Johannes Rainer
library(xcms)
library(faahKO)
faahko_3_files <- c(system.file('cdf/KO/ko15.CDF', package = "faahKO"),
system.file('cdf/KO/ko16.CDF', package = "faahKO"),
system.file('cdf/KO/ko18.CDF', package = "faahKO"))
## Do a simple and fast preprocessing on a subset of the test data
od <- filterRt(readMSData(faahko_3_files, mode = "onDisk"), c(250, 3000))
od <- findChromPeaks(od, param = CentWaveParam(peakwidth = c(30, 80),
noise = 1000))
od <- adjustRtime(od, param = ObiwarpParam(binSize = 0.6))
od <- groupChromPeaks(od,
param = PeakDensityParam(minFraction = 0.8, sampleGroups = rep(1, 3)))
## Extract ion chromatograms for each feature
chrs <- featureChromatograms(od)
## Plot the XIC for the first feature using different colors for each file
par(mfrow = c(1, 2))
plot(chrs[1, ], col = c("red", "green", "blue"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.