PeakFilling: Peak filling of any missed peaks

View source: R/PeakFilling.R

PeakFillingR Documentation

Peak filling of any missed peaks

Description

This functions detects which samples (after grouping) are missing from every peak group and reanalyses the raw data to verify whether this peak is actually non-existent for this sample

Usage

PeakFilling(
  Y.grouped,
  Y.spec,
  max.index.shift = 10,
  window.width = "small",
  nCPU = -1,
  FilMethod = "new"
)

Arguments

Y.grouped

Peaks groups (output from the 'PeakGrouper' function).

Y.spec

The raw NMR spectra in matrix format.

max.index.shift

Maximal shift in index between a filled peak and the group it belongs to.

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.

nCPU

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

FilMethod

A more robust method for peak filling has been implemented. This is now the default. The former method can be used by specifying FilMethod == "old" however this will be deprecated.

Value

Returns a data frame with grouped peaks and possibly extra peaks obtained from the raw data (these peaks have SNR = NA).

Author(s)

Charlie Beirnaert, charlie.beirnaert@uantwerpen.be

Examples

subset <- GetWinedata.subset()
# to reduce the example time we only select spectra 1 & 2
subset.spectra = as.matrix(subset$Spectra)[1:2,] 
subset.ppm = as.numeric(subset$PPM)

test.peaks <- getWaveletPeaks(Y.spec=subset.spectra, 
                              X.ppm=subset.ppm,
                              nCPU = 1) # nCPU set to 1 for the vignette build

test.grouped <- PeakGrouper(Y.peaks = test.peaks)

test.filled <- PeakFilling(Y.grouped = test.grouped, 
                           Y.spec = subset.spectra,  
                           nCPU = 1) # nCPU set to 1 for the vignette build



speaq documentation built on May 23, 2022, 5:06 p.m.