Title: | Visualising and Exploring Spectra Data |
---|---|
Description: | This package defines a set of helper function to visualise and explore mass spectrometry data stored as Spectra objects. |
Authors: | Laurent Gatto [aut, cre] , Johannes Rainer [aut] |
Maintainer: | Laurent Gatto <[email protected]> |
License: | Artistic-2.0 |
Version: | 0.3.0 |
Built: | 2024-11-20 05:52:54 UTC |
Source: | https://github.com/rformassspectrometry/SpectraVis |
The browseSpectra()
function opens a simple shiny application
that allows to browse trough the individual scans of a Spectra
object. The title of the scans contains the MS level, the
retention time, if available the precursor m/z and precursor
charge and a peptides sequence (as defined in the sequence
spectra variable) and the index of the scan. If a scans has a
sequence (as defined in the sequence
spectra variable), the
matching fragments (as defined by PSMatch::calculateFragments()
are
labelled, otherwise the most intense peaks (as defined as those
that have an intensity as high as half the highest peak) are
labelled with their m/z.
See ?SpectraVis
for an example.
browseSpectra(object)
browseSpectra(object)
object |
A non-empty instance of class |
An object that represents the app.
Laurent Gatto
The plotlySpectra()
function displays a single spectrum stored
in a Spectra
object using the plotly::plot_ly()
function.
See ?SpectraVis
for an example.
plotlySpectra(object)
plotlySpectra(object)
object |
A instance of class |
A plotly
object.
Laurent Gatto, Johannes Rainer
library(msdata) fl <- system.file("TripleTOF-SWATH", "PestMix1_DDA.mzML", package = "msdata") pest_ms2 <- filterMsLevel(Spectra(fl), 2L) plotlySpectra(pest_ms2[950])
library(msdata) fl <- system.file("TripleTOF-SWATH", "PestMix1_DDA.mzML", package = "msdata") pest_ms2 <- filterMsLevel(Spectra(fl), 2L) plotlySpectra(pest_ms2[950])
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 )
plotlySpectraMirror( x, y, xLabel = "", xColor = "#737373", yLabel = "", yColor = "#737373", matchSize = 5, ppm = 20, tolerance = 0 )
x |
A |
y |
A |
xLabel |
Optional |
xColor |
Color for peaks of spectrum |
yLabel |
Optional |
yColor |
Color for peaks of spectrum |
matchSize |
|
ppm |
|
tolerance |
|
A plotly
object
Johannes Rainer
## 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")
## 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")
This package defines a set of helper function to visualise and explore mass spectrometry data stored as Spectra objects.
plotlySpectra: Interactive visualisation of a single spectrum.
browseSpectra: Browse spectra in a Spectra object.
f <- msdata::proteomics(pattern = "MS3TMT10", full.names = TRUE) sp <- Spectra(f) sp if (interactive()) browseSpectra(sp) ## Use Ctrl+C to interrupt R and stop the application if (interactive()) plotlySpectra(sp[1])
f <- msdata::proteomics(pattern = "MS3TMT10", full.names = TRUE) sp <- Spectra(f) sp if (interactive()) browseSpectra(sp) ## Use Ctrl+C to interrupt R and stop the application if (interactive()) plotlySpectra(sp[1])