View source: R/chromPeakArea.R
chromPeakArea | R Documentation |
Extract the peak area (defined by the m/z and retention time range) of
chromatographic peaks. The chromatographic peaks can be defined by their ID
(i.e. rownames of the chromPeaks
matrix) or by m/z and a retention times.
The function identifies first chromatographic peaks in x
that match the
input parameters mz
and rt
or peakId
and then defines the m/z and rt
range based on the "mzmin"
, "mzmax"
, "rtmin"
and "rtmax"
of these.
If m/z and rt ranges are provided, by default only chromatographic peaks are
considered that have their apex within the region. That can be changed by
using a different value for type
.
As a result a matrix
is returned with columns "mzmin"
, "mzmax"
,
"rtmin"
and "rtmax"
defining the lower and upper boundaries of the
region of the peaks. Each row in this matrix represent the result for one
element in the input parameter specifying the peaks of interest (e.g. mz
,
rt
or peakId
).
chromPeakArea(
x,
mz = numeric(),
rt = numeric(),
diffRt = 40,
ppm = 50,
peakId = character(),
type = c("apex_within", "any", "within")
)
x |
|
mz |
|
rt |
|
diffRt |
|
ppm |
|
peakId |
|
type |
|
matrix
with columnd "mzmin"
, "mzmax"
, "rtmin"
, "rtmax"
with the m/z and retention time ranges calculated on all chromatographic
peaks in x
matching mz
and rt
. Each row representing the result for
each value in mz
and rt
.
Johannes Rainer
library(faahKO)
fls <- c(system.file('cdf/KO/ko15.CDF', package = "faahKO"),
system.file('cdf/KO/ko16.CDF', package = "faahKO"),
system.file('cdf/WT/wt19.CDF', package = "faahKO"))
od <- readMSData(fls, mode = "onDisk")
xod <- findChromPeaks(
od, param = CentWaveParam(noise = 10000, snthresh = 40,
prefilter = c(3, 10000)))
chromPeakArea(xod, rt = c(2500, 2700), diffRt = 100,
mz = cbind(c(400, 300), c(500, 400)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.