Description Usage Arguments Details Value Author(s) See Also Examples
Plot peak RI of the quant mass of a given metabolite across samples.
This function can be used to visualize the elution time of a metabolite
in the RI and RT dimension, and in combination with the function
sampleRI
for fine tunning.
1 2 3 |
samples |
A |
Lib |
A |
libID |
An index (integer or character) value representing the respective metabolite in
the reference library |
dev |
The allowed retention index (RI) deviation or |
mz |
A list of m/z values to search or |
RI |
The expected retention index or |
method |
A character vector used to decided what peak should be chosen in case there are
ambiguous peaks. If |
useRI |
Logical. Should the RI or RT be displayed in the y-axis? |
main |
The title for the plot. If |
col |
A color vector (length > 2) to show different levels of peak intensity. |
int_range |
A length-two vector. The limits of the intensity for the color key. Note the the intensity is expressed in log10. Eg, a value of 2 represents a intensity of 100. |
cex_range |
The 'cex' range value of the points. lower-intense peaks are represented as points of smaller size. |
key_width |
The width in cm of the area allocated for the color key. |
This function uses internally FindAllPeaks
, so the same rules apply,
i.e., the parameters dev
, mz
, and RI
have preference over
the settings of the metabolite indexed by libID
.
In the plot, the x-axis are samples as defined by the object samples
. The
y-axis is retention index (RI) as shown on the left-hand-size. On the right-hand-size
y-axis the approximate retention time (RT) is shown. This is because the RT varies
across samples, therefore it is averaged for displays purposes. If useRI==FALSE
,
then the RT is displayed on the left hand size and the RI is averaged and shown on
the left. Note that in either case, the RI is used for searching.
The point size is proportional to the log10 of the peak intensity. Their size is
controlled by the parameters int_range
and cex_range
. By default,
intensities of 100 (log10 => 2) or lower are shown with cex=0.7
, while intensities
greater than 1000000 (log10 => 6) as displaued with cex=6
. This also affects the
scaling of the color key.
The best peaks, selected acording to method
, are shown with a black border,
while the other are shown with no border and slightly transparent.
The output is the RI of the best peaks or invisible. Note that if no peak is found, then no plot is drawn.
Returns invisible or a numeric vector with the corresponding RI of the best peak chosen by
method
.
Alvaro Cuadros-Inostroza, Matthew Hannah, Henning Redestig
FindAllPeaks
, sampleRI
, ImportSamples
, ImportLibrary
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | def.par <- par(no.readonly = TRUE) # save parameters for resetting
# load pre-calculated example data files and objects
require(TargetSearchData)
data(TSExample)
# get and set the RI file path
RIpath(sampleDescription) <- file.path(find.package("TargetSearchData"), "gc-ms-data")
# search all peaks of Valine (GC.3) and selective masses. Retention index
ri <- plotPeakRI(sampleDescription, refLibrary, 'GC.3')
# increase deviation, change m/z to search, change colors and title
main <- 'Valine'
cols <- c('red', 'blue', 'green')
ri <- plotPeakRI(sampleDescription, refLibrary, 'GC.3', dev=4000, mz=144,
main=main, col=cols)
# plot by RT instead. Note the RI is still returned
ri <- plotPeakRI(sampleDescription, refLibrary, 'GC.3', useRI=FALSE)
par(def.par) # reset to default
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.