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.
plotlySpectraMirror(
x,
y,
xLabel = "",
xColor = "#737373",
yLabel = "",
yColor = "#737373",
matchSize = 5,
ppm = 20,
tolerance = 0
)A Spectra() object of length 1.
A Spectra() object of length 1.
Optional character(1) with the label (name) of x.
Color for peaks of spectrum x.
Optional character(1) with the label (name) of y.
Color for peaks of spectrum y.
numeric(1) defining the size of the point that will be
used to indicate peaks in x and y with matching m/z.
numeric(1) with the m/z relative acceptable difference (in
ppm) for peaks to be considered matching (see common() for more
details).
numeric(1) with the absolute acceptable difference of
m/z values for peaks to be considered matching (see common() for more
details).
A plotly object
## 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")