plotlySpectraMirror: Interactive visualisation of a mirror plot

View source: R/plotlySpectraMirror.R

plotlySpectraMirrorR Documentation

Interactive visualisation of a mirror plot

Description

The plotlySpectraMirror function creates an interactive mirror plot comparing two spectra x and y with each other. Peaks with matching m/z values (considering ppm and tolerance) are indicated with a point which size can be specified with parameter matchSize.

See also plotSpectraMirror() for a non-interactive version of this plot.

Usage

plotlySpectraMirror(
  x,
  y,
  xLabel = "",
  xColor = "#737373",
  yLabel = "",
  yColor = "#737373",
  matchSize = 5,
  ppm = 20,
  tolerance = 0
)

Arguments

x

A Spectra() object of length 1.

y

A Spectra() object of length 1.

xLabel

Optional character(1) with the label (name) of x.

xColor

Color for peaks of spectrum x.

yLabel

Optional character(1) with the label (name) of y.

yColor

Color for peaks of spectrum y.

matchSize

numeric(1) defining the size of the point that will be used to indicate peaks in x and y with matching m/z.

ppm

numeric(1) with the m/z relative acceptable difference (in ppm) for peaks to be considered matching (see common() for more details).

tolerance

numeric(1) with the absolute acceptable difference of m/z values for peaks to be considered matching (see common() for more details).

Value

A plotly object

Author(s)

Johannes Rainer

Examples


## Load example data.
library(msdata)
fl <- system.file("TripleTOF-SWATH", "PestMix1_DDA.mzML", package = "msdata")
pest_ms2 <- filterMsLevel(Spectra(fl), 2L)

plotlySpectraMirror(pest_ms2[948], pest_ms2[950])

plotlySpectraMirror(pest_ms2[948], pest_ms2[959], xLabel = "query",
    yLabel = "target", xColor = "red", yColor = "blue")

rformassspectrometry/SpectraVis documentation built on April 4, 2022, 8:32 p.m.