Description Usage Arguments Author(s) Examples
The highlightChromPeaks
function adds chromatographic
peak definitions to an existing plot, such as one created by the
plot
method on a Chromatogram
or
Chromatograms
object.
1 2 3 4 |
x |
For |
rt |
For |
mz |
|
peakIds |
|
border |
colors to be used to color the border of the rectangles/peaks.
Has to be equal to the number of samples in |
lwd |
|
col |
For |
type |
the plotting type. See |
whichPeaks |
|
... |
additional parameters to the |
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 | ## Read some files from the faahKO package.
library(xcms)
library(faahKO)
faahko_3_files <- c(system.file('cdf/KO/ko16.CDF', package = "faahKO"),
system.file('cdf/KO/ko18.CDF', package = "faahKO"))
od <- readMSData(faahko_3_files, mode = "onDisk")
## Peak detection using the 'matchedFilter' method. Note that we are using a
## larger binSize to reduce the runtime of the example.
xod <- findChromPeaks(od, param = MatchedFilterParam(binSize = 0.3, snthresh = 20))
## Extract the ion chromatogram for one chromatographic peak in the data.
chrs <- chromatogram(xod, rt = c(2700, 2900), mz = 335)
plot(chrs)
## Extract chromatographic peaks for the mz/rt range (if any).
chromPeaks(xod, rt = c(2700, 2900), mz = 335)
## Highlight the chromatographic peaks in the area
## Show the peak definition with a rectangle
highlightChromPeaks(xod, rt = c(2700, 2900), mz = 335)
## Color the actual peak
highlightChromPeaks(xod, rt = c(2700, 2900), mz = 335,
col = c("#ff000020", "#00ff0020"), type = "polygon")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.