featureSpectra: Extract (MS2) spectra associated with features

Description Usage Arguments Details Value Author(s)

View source: R/functions-XCMSnExp.R

Description

Return (MS2) spectra for all chromatographic peaks associated with the features in x (defined by featureDefinitions()).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
featureSpectra(
  x,
  msLevel = 2,
  expandRt = 0,
  expandMz = 0,
  ppm = 0,
  skipFilled = FALSE,
  return.type = c("MSpectra", "list"),
  ...
)

Arguments

x

XCMSnExp object with feature defitions available.

msLevel

integer(1) defining whether MS1 or MS2 spectra should be returned. Currently only msLevel = 2 is supported.

expandRt

numeric(1) to expand the retention time range of each peak by a constant value on each side.

expandMz

numeric(1) to expand the m/z range of each peak by a constant value on each side.

ppm

numeric(1) to expand the m/z range of each peak (on each side) by a value dependent on the peak's m/z.

skipFilled

logical(1) whether no spectra for filled-in peaks should be reported.

return.type

character(1) defining whether the result should be a MSpectra object or a simple list. See below for more information.

...

additional arguments to be passed along to chromPeakSpectra(), such as method.

Details

The function identifies all MS2 spectra with their precursor m/z within the m/z range of a chromatographic peak (i.e. >= mzmin and <= mzmax) of a feature and their retention time within the rt range of the same peak (>= rtmin and <= rtmax).

The optional parameter method allows to ensure that for each chromatographic peak in one sample only one MS2 spectrum is returned. See chromPeakSpectra() or the LC-MS/MS analysis vignette for more details.

Value

Which object is returned depends on the value of return.type:

Author(s)

Johannes Rainer


xcms documentation built on Nov. 8, 2020, 5:13 p.m.