getSample.rtmsSpectrum {rtms}R 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

Examples

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

[Package rtms version 0.2.0 Index]