fit_peaks: Fit chromatographic peaks to an exponential-gaussian hybrid...

fit_peaksR Documentation

Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile

Description

Fit peak parameters using exponential-gaussian hybrid or gaussian function.

Usage

fit_peaks(
  y,
  pos = NULL,
  sd.max = 50,
  fit = c("egh", "gaussian", "raw"),
  max.iter = 1000,
  ...
)

Arguments

y

response (numerical vector)

pos

Locations of peaks in vector y. If NULL, find_peaks will run automatically to find peak positions.

sd.max

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

fit

Function for peak fitting. (Currently exponential-gaussian hybrid egh, gaussian and raw settings are supported). If raw is selected, trapezoidal integration will be performed on raw data without fitting a peak shape. Defaults to egh.)

max.iter

Maximum number of iterations to use in nonlinear least squares peak-fitting. (Defaults to 1000).

...

Additional arguments to find_peaks.

Details

Peak parameters are calculated using fit_peaks, which fits the data to a gaussian or exponential-gaussian hybrid curve using non-linear least squares estimation as implemented in nlsLM. Area under the fitted curve is estimated using trapezoidal estimation.

Value

Function fit_peaks returns a matrix, whose columns contain the following information:

rt

location of the maximum of the peak (x)

start

start of peak (only included in table if 'bounds==TRUE')

end

end of peak (only included in table if 'bounds==TRUE')

sd

width of the peak (x)

tau

tau parameter (only included in table if 'fit=="egh"')

FWHM

full width at half maximum (x)

height

height of the peak (y)

area

peak area

r.squared

r-squared value for linear fit of model to data.

Again, the first five elements (rt, start, end, sd and FWHM) are expressed as indices, so not in terms of the real retention times. The transformation to "real" time is done in function get_peaks.

Note

The fit_peaks function is adapted from Dr. Robert Morrison's DuffyTools package as well as code published in Ron Wehrens' alsace package.

Author(s)

Ethan Bass

References

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, get_peaks

Examples

data(Sa_pr)
fit_peaks(Sa_pr[[1]][,"220"])

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