fit_peaks | R Documentation |
Fit peak parameters using exponential-gaussian hybrid or gaussian function.
fit_peaks(
x,
lambda,
pos = NULL,
sd.max = 50,
fit = c("egh", "gaussian", "raw"),
max.iter = 1000,
estimate_purity = TRUE,
noise_threshold = 0.001,
...
)
x |
A chromatogram in matrix format. |
lambda |
Wavelength to fit peaks at. |
pos |
Locations of peaks in vector y. If NULL, |
sd.max |
Maximum width (standard deviation) for peaks. Defaults to 50. |
fit |
Function for peak fitting. (Currently exponential-gaussian hybrid
|
max.iter |
Maximum number of iterations to use in nonlinear least squares peak-fitting. (Defaults to 1000). |
estimate_purity |
Logical. Whether to estimate purity or not. Defaults to TRUE. |
noise_threshold |
Noise threshold. Input to |
... |
Additional arguments to |
Peak parameters are calculated by fitting the data
to a gaussian or exponential-gaussian hybrid curve using non-linear least
squares estimation as implemented in nlsLM
.
The area under the fitted curve is then estimated using trapezoidal
approximation.
The fit_peaks
function returns a matrix, whose columns contain
the following information about each peak:
rt |
Location of the peak maximum. |
start |
Start of peak (only included in table if |
end |
End of peak (only included in table if |
sd |
The standard deviation of the peak. |
tau |
|
FWHM |
The full width at half maximum. |
height |
Peak height. |
area |
Peak area. |
r.squared |
The R-squared value for linear fit of the model to the data. |
purity |
The spectral purity of peak as assessed by |
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
.
The fit_peaks
function is adapted from Dr. Robert
Morrison's
DuffyTools package
as well as code published in Ron Wehrens'
alsace package.
Ethan Bass
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. \Sexpr[results=rd]{tools:::Rd_expr_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, 26: 285-296. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/BF02268168")}.
find_peaks
, get_peaks
data(Sa_pr)
fit_peaks(Sa_pr[[1]], lambda = 220)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.