Corrects retention time differences in peak_list using parametric time
warping as implemented in the ptw package.
Arguments
- peak_list
A
peak_listobject created byget_peaks, containing a nested list of peak tables where the first level is the sample, and the second level is the spectral wavelength. Every wavelength is described by a matrix where each row corresponds to a feature, and the columns contain information on that feature (e.g., retention time, peak width (FWHM), height, area, etc.)- mod_list
A list of
ptwmodels.- chrom_list
List of chromatograms from which the
ptwmodels are derived.- match_names
Logical. Whether to actively match the names of the
peak_listto the list of models (mod_list). Defaults toTRUE.
Value
The input list of peak tables is returned with extra columns containing the corrected retention times.
Details
Once an appropriate warping model has been established, corrected retention times can be predicted for each peak. These are stored in a separate column in the list of peak tables.
Note
This function is adapted from the correctPeaks function in the alsace
package by Ron Wehrens: https://github.com/rwehrens/alsace/blob/master/R/correctPeaks.R.
Examples
if (FALSE) { # interactive()
data(Sa_pr)
warp <- correct_rt(chrom_list = Sa_pr, lambdas = 210, what = "models")
pks <- get_peaks(Sa_pr, lambda = "210")
correct_peaks(pks, mod_list = warp, chrom_list = Sa_pr)
}
