Package 'SpectraVis'

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

Help Index


Browse spectra in a Spectra object

Description

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.

Usage

browseSpectra(object)

Arguments

object

A non-empty instance of class Spectra.

Value

An object that represents the app.

Author(s)

Laurent Gatto


Interactive visualisation of a single spectrum

Description

The plotlySpectra() function displays a single spectrum stored in a Spectra object using the plotly::plot_ly() function.

See ?SpectraVis for an example.

Usage

plotlySpectra(object)

Arguments

object

A instance of class Spectra of length 1.

Value

A plotly object.

Author(s)

Laurent Gatto, Johannes Rainer

Examples

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

plotlySpectra(pest_ms2[950])

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")

SpectraVis: 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.

SpectraVis functions

  • plotlySpectra: Interactive visualisation of a single spectrum.

  • browseSpectra: Browse spectra in a Spectra object.

Examples

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])