getSampleFromSpectrum: Extract a sample from an RTMS spectrum object

View source: R/rtmsSpectrum.R

getSample.rtmsSpectrumR Documentation

Extract a sample from an RTMS spectrum object

Description

Extracts a sample object of class rtmsSample from a single spectrum object of class rtmsSample usin g a list of peaks

Usage

## S3 method for class 'rtmsSpectrum'
getSample(x, peaks, ...)

getSampleFromSpectrum(spectrum, peaks, freqSpacing = TRUE, threshold = NULL)

Arguments

x

The spectrum object

peaks

A list of peak objects of class rtmsPeak

...

Additional parameters

spectrum

A full spectrum of class rtmsSpectrum

freqSpacing

If TRUE (the default), local maxima (estimated via quadratic interpolation) are calculated in inverse m/z (or frequency) space, as in FTMS spectra. If FALSE, maxima are calculated directy in m/z space

threshold

If NULL, all local maxima will be returned for each subsample; if set to particular value, only those maxima above that threshold will be returned.

Value

An RTMS sample object of class rtmsSample

Functions

  • getSample(rtmsSpectrum): The S3 method getSample for objects of class rtmsSpectrum; calls getSampleFromSpectrum

Examples

peaks <- rtmsPeakList(c(1516.83,1530.84),peakWidth=0.2,windowWidth = c(5,10))
names(peaks) <- c("Product","Substrate")
sample <- getSample(exampleSpectrum,peaks)

rtms documentation built on June 7, 2023, 5:59 p.m.