specplot2: specplot2

specplot2R Documentation

specplot2

Description

Plot an MS spectrum

Usage

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
)

Arguments

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 details

mar

margins passed to par()

ylab

y axis label

ylabshift

shift horizontal position of y axis label

parseLabels

if TRUE, the label column in labels will be parsed (using parse)

Details

highlights

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.

labels

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.

parseLabels

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

Value

plots a spectrum view in the current plotting device


mjhelf/Mosaic documentation built on April 28, 2022, 11:32 a.m.