chromPeakChromatograms | R Documentation |
Extract an ion chromatogram (EIC) for each chromatographic peak in an
XcmsExperiment()
object. The result is returned as an XChromatograms()
of length equal to the number of chromatographic peaks (and one column).
chromPeakChromatograms(object, ...)
## S4 method for signature 'XcmsExperiment'
chromPeakChromatograms(
object,
expandRt = 0,
expandMz = 0,
aggregationFun = "max",
peaks = character(),
return.type = c("XChromatograms", "MChromatograms"),
...,
progressbar = TRUE
)
object |
An |
... |
currently ignored. |
expandRt |
|
expandMz |
|
aggregationFun |
|
peaks |
optional |
return.type |
|
progressbar |
|
Johannes Rainer
featureChromatograms()
to extract an EIC for each feature.
## Load a test data set with detected peaks
library(MSnbase)
library(xcms)
library(MsExperiment)
faahko_sub <- loadXcmsData("faahko_sub2")
## Get EICs for every detected chromatographic peak
chrs <- chromPeakChromatograms(faahko_sub)
chrs
## Order of EICs matches the order in chromPeaks
chromPeaks(faahko_sub) |> head()
## variable "sample_index" provides the index of the sample the EIC was
## extracted from
fData(chrs)$sample_index
## Get the EIC for selected peaks only.
pks <- rownames(chromPeaks(faahko_sub))[c(6, 12)]
pks
## Expand the data on retention time dimension by 15 seconds (on each side)
res <- chromPeakChromatograms(faahko_sub, peaks = pks, expandRt = 5)
plot(res[1, ])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.