Find local extrema in NMR spectra (peak picking)

ppick(X, ppm, fil_p = 3, fil_n = 5, type = "max")

Arguments

X

num matrix, NMR matrix with spectra in rows

ppm

num vec, chemical shift matching to X

fil_p,

SG filter order

fil_n

num, SG filter length (must be odd)

type

str, return local extrema: maxima (max), minima (min), or both

Value

List of data frames for each spectrum. Each data frame has four columns: index in X col/ppm, ppm value, signal intensity and local extrema type (+1 for local min, -1 for local max). Number of rows match to all local extrema found within a spectrum.

Details

Function first smoothes the spectrum to reduce extrema related to noise fluctuations using a Savitzki-Golay (SG) filter. Local extrema are identified according to sign change of adjacent points.

See also

Author

torben.kimhofer@gmail.com

Examples

data(covid) peaks=ppick(X, ppm) # Plotting first spectrum in reagion 3.0 to 3.15 ppm spec(X[1,], ppm, shift=c(4.2, 5.3)) points(speaks[[1]]$ppm, speaks[[1]]$Int, col=factor(speaks[[1]]$type))
#> Error in points(speaks[[1]]$ppm, speaks[[1]]$Int, col = factor(speaks[[1]]$type)): object 'speaks' not found