plotSpectra | R Documentation |
plotSpectra
plots a contrast between the reference spectra and the median spectra of a
given metabolite in the library. plotAllRIdev
saves the plots of the median-reference
spectra comparisons of all the metabolites in the reference library into a PDF file.
plotSpectra(Lib, peaks, libID = 1, type = c("ht", "ss", "diff"))
plotAllSpectra(Lib, peaks, type = "ht", pdfFile, width = 8, height = 8, ...)
Lib |
A |
peaks |
A |
libID |
A numeric vector providing the indices of the metabolites to plot. |
type |
The type of the plot. Options are |
pdfFile |
A file name where the plot will be saved. Only |
width , height |
The width and height of the plots in inches. Only |
... |
Further options passed to |
The median spectra is obtained by computing the median intensity of every ion across the samples. The median and the reference spectra values are scaled to vary between 0 and 999 in order to make them comparable.
Alvaro Cuadros-Inostroza, Matthew Hannah, Henning Redestig
tsLib
, tsMSdata
,pdf
require(TargetSearchData)
data(TSExample)
# get RI file path
RI.path <- tsd_data_path()
# update RI file path
RIpath(sampleDescription) <- RI.path
peakData <- peakFind(sampleDescription, refLibrary, corRI)
# Plot a comparison RI deviation of metabolite "Valine"
grep("Valine", libName(refLibrary)) # answer: 3
plotSpectra(refLibrary, peakData, libID = 3, type = "ht")
# Plot the spectra "side by side"
plotSpectra(refLibrary, peakData, libID = 3, type = "ss")
# Plot the spectra difference
plotSpectra(refLibrary, peakData, libID = 3, type = "diff")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.