Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

navMS

Navigate an MSnExp object


Description

Navigate an MSnExp object by moving to the next or previous spectrum.

Usage

navMS(i, object, msLevel, nav = c("nextMS", "prevMS"), ...)

nextMS(...)

prevMS(...)

Arguments

i

The name or index of the current spectrum

object

The MSnExp object

msLevel

The MS level of the next or previous spectrum. If missing (default), then the level of the current spectrum is used.

nav

One of "nextMS" or "prevMS", to obtain the next or previous spectrum of level msLevel.

...

Additional parameters. Currently ignored.

Value

An object of class Spectrum1 or Spectrum2, depending on the value of msLevel or NULL, of no spectrum is found.

Author(s)

Laurent Gatto

Examples

f <- msdata::proteomics(full.names = TRUE, pattern = "MS3")
x <- readMSData(f, centroided. = c(FALSE, TRUE, FALSE), mode = "onDisk")
(sp <- which(msLevel(x) == 3)[2]) ## 2nd MS3 spectrum
x[[sp]] ## curent MS3
MSnbase:::nextMS(sp, x) ## next MS3
MSnbase:::prevMS(sp, x) ## prev MS3
MSnbase:::prevMS(sp, x, 2L) ## prev MS2
MSnbase:::prevMS(sp, x, 1L) ## prev MS1

MSnbase

Base Functions and Classes for Mass Spectrometry and Proteomics

v2.16.1
Artistic-2.0
Authors
Laurent Gatto, Johannes Rainer and Sebastian Gibb with contributions from Guangchuang Yu, Samuel Wieczorek, Vasile-Cosmin Lazar, Vladislav Petyuk, Thomas Naake, Richie Cotton, Arne Smits, Martina Fisher, Ludger Goeminne, Adriaan Sticker and Lieven Clement.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.