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) ofx.- xColor
Color for peaks of spectrum
x.- yLabel
Optional
character(1)with the label (name) ofy.- yColor
Color for peaks of spectrum
y.- matchSize
numeric(1)defining the size of the point that will be used to indicate peaks inxandywith matching m/z.- ppm
numeric(1)with the m/z relative acceptable difference (in ppm) for peaks to be considered matching (seecommon()for more details).- tolerance
numeric(1)with the absolute acceptable difference of m/z values for peaks to be considered matching (seecommon()for more details).
Examples
## Load example data.
library(MsDataHub)
fl <- PestMix1_DDA.mzML()
#> see ?MsDataHub and browseVignettes('MsDataHub') for documentation
#> loading from cache
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")