MSnbase (version 1.20.7)

chromatogram-methods: Plots a chromatogram

Description

The method plot the chromatogram for various types in inputs (see below). Additional arguments are
y
One of "tic" (default) or "bpi" to plot the total ion current of base peak intensity chromatogram.

f
Optional and only when the input is a data.frame. Otherwise, it is extracted automatically from object. f is used to print the filename on the figure.

legend
A logical defining if the figure should be annotated.

plot
A logical defining if the plot should be rendered.

ms
A numeric defining what MS level spectra to use. Default is 1L.

...
Additional arguments passed to the plot function.

xcms::plotChrom provides a similar functionality.

Arguments

Value

The methods invisibly return the data.frame with the retention times (rt column) and intensities (either tic or bpi) used to generate the figure.

Methods

signature(object = "character")
Plots the chromatogram for the mass-spectrometry data stored in the object file. The file format must be support by mzR. See mzR::openMSfile for details.
signature(object = "mzRramp")
Plots the chromatogram for the mzRramp instance. See the mzR package for details.
signature(object = "data.frame")
Plots the chromatogram using the relevant columns from the data.frame instance, i.e retentionTime and totIonCurrent (for tic) and basePeakIntensity (for bpi). Such a data.frame would typically be generated by extracting the header from an mzRramp instance. See mzR::header for details.

Examples

Run this code
f <- system.file("lockmass/LockMass_test.mzXML", package = "msdata")
x <- chromatogram(f, main = "Source: mzXML file")
head(x)
dim(x)
x <- chromatogram(f, main = "Source: mzXML file",
                  ylim = c(0, 100))
## Not run: 
#     library("mzR")
#     ms <- openMSfile(f)
#     chromatogram(ms, main = "Source: mzRramp",
#                  col = "red")
#     hd <- header(ms)
#     chromatogram(hd, main = "Source: mzRramp header",
#                  lty = "dashed")
# 
#     library("RforProteomics")
#     f <- getPXD000001mzXML()
#     chromatogram(f)
#     grid()
#   ## End(Not run)

Run the code above in your browser using DataCamp Workspace