navMS: Navigate an 'MSnExp' object

Description Usage Arguments Value Author(s) Examples

View source: R/nav.R

Description

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

Usage

1
2
3
4
5
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

1
2
3
4
5
6
7
8
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 documentation built on Jan. 23, 2021, 2 a.m.