extract_feature_intensity: Extract intensities of specific features from a single...

Description Usage Arguments Value Examples

View source: R/extract_feature_intensity.R

Description

For each of the given features local maxima will be identified in a region of 2ppm around the theoretical mz value using the algorithm implemented in the function locate.peaks. The intensity value at the local maximum with maximal intenstity within 1ppm will be extracted. If no peak could be detected, the intensity at the closest measured mz value is used.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
extract_feature_intensity(
  spectrum.file,
  scanrange = c(1, 1),
  info.features,
  ppm = 10,
  num.pts = 5,
  oneside.min = 1,
  verbose = TRUE,
  res.dir = NULL
)

Arguments

spectrum.file

Character. Name of mzML file to read.

scanrange

Numeric vector of length 2. Scan range to read (see xcmsRaw).

info.features

data.frame with information about features (e.g. as generated by the function chem_formula_2_adducts).

ppm

Numeric. Resolution of mass spectrometer.

num.pts

Numeric. Minimum number of points needed to search for a peak (see locate.peaks).

oneside.min

Numeric. Minimum number of points needed on each side of the local maximum (see locate.peaks).

verbose

Logical. Print out additional information.

res.dir

Character. Name of directory where result is saved as RDS object (using the basename of the spectrum file). If NULL, a data.frame with the results will be returned.

Value

if res.dir = NULL, data frame with information for each feature:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data("info.features")
res.dir = tempdir()
mzml.file = system.file("extdata",
                        "20121015b__002__07__ME.mzML",
                        package = "preprocessHighResMS")

extract_feature_intensity(spectrum.file = mzml.file,
                          scanrange = c(1, 2),
                          info.features = info.features,
                          ppm = 20,
                          res.dir = res.dir)

szymczak-lab/preprocessHighResMS documentation built on Oct. 6, 2020, 12:50 a.m.