Description Usage Arguments Value Accessing data in xcmsRaw objects Author(s) See Also Examples
These functions enable user-friendly access of the data stored in an
xcmsRaw object.
1 2 3 4 5 6 7 8 9 |
(in alphabetic order)
intrange |
For |
mzrange |
For |
object |
An |
resMz |
A numeric of length 1 specifying the resolution along the M/Z range. Intensities along the M/Z dimension will be aggregated into bins of this size. |
rtrange |
For |
x |
An |
zeroIsNA |
Set 0 intensities to |
... |
Presently not used. |
Refer to the method and function description above for detailed information on the returned result object.
xcmsRaw objectsExtract retention time, mz and intensity values from the
xcmsRaw object. If none of the 3 parameters mzrange,
rtrange and intrange are specified the method
returns the full data. The method supports also definitions of
multiple m/z, rt or intensity ranges, i.e. if mzrange,
rtrange and/or intrange is a numeric two-column
matrix, each row specifying a range.
The method returns a numeric matrix with columns "time",
"mz" and "intensity" and rows depending on the input
arguments (or a matrix with nrow equals 0 if the specified
ranges do not match any data points). If mzrange,
rtrange or intrange is a matrix, the method returns
a list of matrices, each representing the subset defined by
one of the rows of the input matrix (matrices).
Extracts intensities from the two-dimensional area (slice) defined
by mzrange and rtrange and returns it as a
MSmap object (i.e. a matrix-like
two-dimensional representation of the slice). The intensities
along the M/Z range will be aggregated in bins of size
resMz.
Returns the sample (retention) time for each individual mz value
stored the xcmsRaw object. The length of the returned
numeric vector is thus equal to the number of available data
points. This is in contrast to the @scantime slot, which
stores only the discrete scan times.
Johannes Rainer.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ## Load the test data.
library(faahKO)
xset <- faahko
## Get the raw data for the first file
xraw <- getXcmsRaw(xset, 1)
## Get the scan time of the individual measured compounts.
head(scantimes(xraw))
## To get the unique scan times
head(xraw@scantime)
## Get the data matrix with retention time, mz and intensity
## for the defined retention time range.
datmat <- getData(xraw, rtrange=c(2509, 2530))
head(datmat)
## Subset also by mzrange.
datmat <- getData(xraw, rtrange=c(2509, 2530), mzrange=c(301, 302.003))
datmat
## Define 3 different ranges and extract the data subsets.
rtm <- rbind(c(2509, 2530),
c(2534, 2540),
c(2630, 2645))
mzm <- rbind(c(301, 302.003),
c(304, 305),
c(308, 308.3))
## Extracting the data we get a list of length 3, each list element
## representing the data subset defined by the corresponding rows in
## rtm and mzm.
getData(xraw, rtrange=rtm, mzrange=mzm)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.