get_peaks: Get peak list.

View source: R/get_peaks.R

get_peaksR Documentation

Get peak list.

Description

Finds and fits peaks and extracts peak parameters from a list of chromatograms at the specified wavelengths.

Usage

get_peaks(
  chrom_list,
  lambdas,
  fit = c("egh", "gaussian", "raw"),
  sd.max = 50,
  max.iter = 100,
  time.units = c("min", "s", "ms"),
  ...
)

Arguments

chrom_list

A list of profile matrices, each of the same dimensions (timepoints x wavelengths).

lambdas

Character vector of wavelengths to find peaks at.

fit

What type of fit to use. Current options are exponential-gaussian hybrid (egh), gaussian or raw. The raw setting performs trapezoidal integration directly on the raw data without fitting a peak shape.

sd.max

Maximum width (standard deviation) for peaks. Defaults to 50.

max.iter

Maximum number of iterations for non-linear least squares in fit_peaks.

time.units

Units of sd, FWHM, area, and tau (if applicable). Options are minutes "min", seconds ("s", or milliseconds "ms".

...

Additional arguments to find_peaks.

Details

Peaks are located by finding zero-crossings in the smoothed first derivative of the specified chromatographic traces (function find_peaks). At the given positions, an exponential-gaussian hybrid (or regular gaussian) function is fit to the signal using fit_peaks). The area is then calculated using a trapezoidal approximation.

The sd, FWHM, tau, and area are returned in units determined by time.units. By defaults the units are in minutes.

Value

The result is an S3 object of class peak_list, containing a nested list of data.frames containing information about the peaks fitted for each chromatogram at each specified wavelength. The data.frame includes information about the retention time (rt), start and end of each peak, as well as the standard deviation (sd), tau (if egh is selected), full width at half maximum (FWHM), height, area, and r.squared (coefficient of determination). (*Note:* This last parameter is determined from a linear model of the fitted peak values to the raw data. This approach is not really statistically valid but it can be useful as a rough metric for "goodness-of-fit").

Note

The function is adapted from the getAllPeaks function authored by Ron Wehrens (though the underlying algorithms for peak identification and peak-fitting are not the same).

Author(s)

Ethan Bass

References

Wehrens, R., Carvalho, E., Fraser, P.D. 2015. Metabolite profiling in LC–DAD using multivariate curve resolution: the alsace package for R. Metabolomics 11:143-154. doi: 10.1007/s11306-014-0683-5

#' Lan, K. & Jorgenson, J. W. 2001. A hybrid of exponential and gaussian functions as a simple model of asymmetric chromatographic peaks. Journal of Chromatography A 915:1-13. doi: 10.1016/S0021-9673(01)00594-5.

Naish, P. J. & Hartwell, S. 1988. Exponentially Modified Gaussian functions - A good model for chromatographic peaks in isocratic HPLC? Chromatographia, /bold26: 285-296. doi: 10.1007/BF02268168.

See Also

find_peaks, fit_peaks

Examples


data(Sa_pr)
pks <- get_peaks(Sa_pr, lambdas = c('210'), sd.max=50, fit="egh")


chromatographR documentation built on Aug. 24, 2022, 9:06 a.m.