extractMsData,OnDiskMSnExp-method {xcms} | R Documentation |
data.frame
containing MS dataExtract a data.frame
of retention time, mz and intensity
values from each file/sample in the provided rt-mz range (or for the full
data range if rt
and mz
are not defined).
## S4 method for signature 'OnDiskMSnExp' extractMsData(object, rt, mz, msLevel = 1L) ## S4 method for signature 'XCMSnExp' extractMsData(object, rt, mz, msLevel = 1L, adjustedRtime = hasAdjustedRtime(object))
object |
A |
rt |
|
mz |
|
msLevel |
|
adjustedRtime |
(for |
A list
of length equal to the number of samples/files in
object
. Each element being a data.frame
with columns
"rt"
, "mz"
and "i"
with the retention time, mz and
intensity tuples of a file. If no data is available for the mz-rt range
in a file a data.frame
with 0 rows is returned for that file.
Johannes Rainer
XCMSnExp
for the data object.
plotMsData
to plot the data for a single file.
## Read some files from the test data package. library(faahKO) library(xcms) fls <- dir(system.file("cdf/KO", package = "faahKO"), recursive = TRUE, full.names = TRUE) raw_data <- readMSData(fls[1:2], mode = "onDisk") ## Read the full MS data for a defined mz-rt region. res <- extractMsData(raw_data, mz = c(300, 320), rt = c(2700, 2900)) ## We've got one data.frame per file length(res) ## With number of rows: nrow(res[[1]]) head(res[[1]])