get_peaks | R Documentation |
Finds and fits peaks and extracts peak parameters from a list of chromatograms at the specified wavelengths.
get_peaks( chrom_list, lambdas, fit = c("egh", "gaussian", "raw"), sd.max = 50, max.iter = 100, time.units = c("min", "s", "ms"), ... )
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 ( |
sd.max |
Maximum width (standard deviation) for peaks. Defaults to 50. |
max.iter |
Maximum number of iterations for non-linear least squares
in |
time.units |
Units of |
... |
Additional arguments to |
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.
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").
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).
Ethan Bass
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.
find_peaks
, fit_peaks
data(Sa_pr) pks <- get_peaks(Sa_pr, lambdas = c('210'), sd.max=50, fit="egh")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.