specplot2 | R Documentation |
Plot an MS spectrum
specplot2( x, y, spectrum, norm = NULL, cx = 1, k = 10, fileName = "", yrange = NULL, xrange = NULL, maxi = NULL, labels = NULL, highlights = NULL, mar = c(3, 4, 6, 1), ylab = "Relative Intensity (%)", ylabshift = 2, parseLabels = F )
x |
mz coordinates |
y |
intensity coordinates |
spectrum |
matrix or data.frame, where the first column is m/z values, and the second column are intensity values |
norm |
normalize by |
cx |
font size |
k |
top k intensity peaks will be labeled automatically with their mz values |
fileName |
plot title |
yrange |
y axis range |
xrange |
x axis range |
maxi |
max intensity to be plotted on side. |
labels |
data.frame containing at least x and y coordinates, plus optional columns: label and color |
highlights |
matrix or data.frame, see |
mar |
margins passed to par() |
ylab |
y axis label |
ylabshift |
shift horizontal position of y axis label |
parseLabels |
if TRUE, the |
matrix or data.frame with at the first two columns
containing x and y coordinates of peaks to highlight.
If highlights
has an additional column called color
,
that column is expected to contain color values for the highlights.
If highlights
has an additional column called type
,
that column is expected to contain point type
values for the highlights,
as detailed in plot.default.
The first two columns of this data.frame will be assumed to be mz and intensity values, respectively.
If it only contains two columns, the first column values will be used as label text.
If a label
column is present, that column will be used as peak labels.
If a colors
column is present, that column will be used to define
the label color, otherwise it will be red.
Parsing labels can be used to include subscript and
superscript elements in peak labels, but requires careful preparation
of the strings to be passed to parse
plots a spectrum view in the current plotting device
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.