Skip to contents

Plot MS2 Spectra

Usage

# S3 method for class 'data.frame'
plot_ms2(
  spectrum1,
  spectrum2,
  spectrum1_name = "spectrum1",
  spectrum2_name = "spectrum2",
  range.mz,
  ppm.tol = 30,
  mz.ppm.thr = 400,
  xlab = "Mass to charge ratio (m/z)",
  ylab = "Relative intensity",
  col1 = "red",
  col2 = "black",
  title.size = 15,
  lab.size = 15,
  axis.text.size = 15,
  legend.title.size = 15,
  legend.text.size = 15,
  interactive_plot = FALSE
)

# S3 method for class 'matrix'
plot_ms2(
  spectrum1,
  spectrum2,
  spectrum1_name = "spectrum1",
  spectrum2_name = "spectrum2",
  range.mz,
  ppm.tol = 30,
  mz.ppm.thr = 400,
  xlab = "Mass to charge ratio (m/z)",
  ylab = "Relative intensity",
  col1 = "red",
  col2 = "black",
  title.size = 15,
  lab.size = 15,
  axis.text.size = 15,
  legend.title.size = 15,
  legend.text.size = 15,
  interactive_plot = FALSE
)

plot_ms2(
  spectrum1,
  spectrum2,
  spectrum1_name = "spectrum1",
  spectrum2_name = "spectrum2",
  range.mz,
  ppm.tol = 30,
  mz.ppm.thr = 400,
  xlab = "Mass to charge ratio (m/z)",
  ylab = "Relative intensity",
  col1 = "red",
  col2 = "black",
  title.size = 15,
  lab.size = 15,
  axis.text.size = 15,
  legend.title.size = 15,
  legend.text.size = 15,
  interactive_plot = FALSE
)

Arguments

spectrum1

An ms2_data object.

spectrum2

An optional second ms2_data object for comparison.

spectrum1_name

Label for the first spectrum.

spectrum2_name

Label for the second spectrum.

range.mz

m/z plotting range.

ppm.tol

PPM tolerance for matching peaks.

mz.ppm.thr

m/z threshold used with ppm matching.

xlab

X-axis label.

ylab

Y-axis label.

col1

Color for the first spectrum.

col2

Color for the second spectrum.

title.size

Title text size.

lab.size

Axis label text size.

axis.text.size

Axis tick text size.

legend.title.size

Legend title text size.

legend.text.size

Legend text size.

interactive_plot

Whether to create an interactive plot.