getWaveletPeaks: Convert raw NMR spectra to peak data by using wavelets

Description Usage Arguments Value Author(s) Examples

View source: R/getWaveletPeaks.R

Description

This function converts phase corrected NMR spectra to peak data by using wavelet based peak detection (with the MassSpecWavelet package)

Usage

1
2
3
getWaveletPeaks(Y.spec, X.ppm, sample.labels = NULL, window.width = "small",
  window.split = 4, scales = seq(1, 16, 1), baselineThresh = 1000,
  SNR.Th = -1, nCPU = -1, include_nearbyPeaks = TRUE)

Arguments

Y.spec

The spectra in matrix format.

X.ppm

The x/ppm values of the spectra (in single vector or matrix format).

sample.labels

The sample labels (numeric), if not supplied these will simply be the sample numbers.

window.width

The width of the detection window for the wavelets. Because of the Fourier transform lengths of 512 ( window.width = 'small') of 1024 ( window.width = 'large') are preferable.

window.split

A positive, even and whole number indicating in how many parts the sliding window is split up. With every iteration the window slides one part further.

scales

The scales to be used in the wavelet based peak detection, see peakDetectionCWT.

baselineThresh

Peaks with a peakValue lower than this threshold will be removed (default = 1000).

SNR.Th

The Signal-to-noise threshold, see peakDetectionCWT.

nCPU

The amount of cpu's to be used for peak detection. If set to '-1' all available cores minus 1 will be used.

include_nearbyPeaks

If set to TRUE small peaks in the tails of larger ones will be included in the peak data, see peakDetectionCWT.

Value

The peaks detected with the wavelets.

Author(s)

Charlie Beirnaert, charlie.beirnaert@uantwerpen.be

Examples

1
2
3
4
5
6
7
8
## Not run: 
# This example takes ca. 50 seconds (with nCPU = 4) on a 2.5GHz machine
data(Winedata)
Y.spec = as.matrix(Winedata$spectra)
PPM.vector = as.numeric(Winedata$ppm)
DetectedPeaks <- getWaveletPeaks(X.ppm= PPM.vector, Y=Y.spec,  baselineThresh = 10,nCPU  = 4)

## End(Not run)

speaq2 documentation built on May 6, 2017, 4:09 a.m.