Aligns chromatograms using parametric time warping, as
implemented in ptw
, or variable penalty dynamic
time warping, as implemented in VPdtw
.
correct_rt(
chrom_list,
lambdas,
models = NULL,
reference = "best",
alg = c("ptw", "vpdtw"),
what = c("corrected.values", "models"),
init.coef = c(0, 1, 0),
n.traces = NULL,
n.zeros = 0,
scale = FALSE,
trwdth = 200,
plot = FALSE,
penalty = 5,
maxshift = 50,
verbose = FALSE,
...
)
A list of ptw
objects or a list of warped absorbance profiles,
depending on the value of the what
argument.
List of matrices containing concentration profiles.
Select wavelengths to use by name.
List of models to warp by.
Index of the sample that is to be considered the reference sample.
algorithm to use: parametric time warping (ptw
) or variable
penalty dynamic time warping (vpdtw
).
What to return: either the 'corrected.values' (useful for visual inspection) or the warping 'models' (for further programmatic use).
Starting values for the optimization.
Number of traces to use.
Number of zeros to add.
Logical. If true, scale chromatograms before warping.
width of the triangle in the WCC criterion.
Logical. Whether to plot alignment.
The penalty for VPdtw
is calculated by
dividing the dilation
by the number provided by this
argument. Thus, a lower number allows more warping to occur. Defaults to 5.
Integer. Maximum allowable shift for VPdtw
.
Whether to be verbose.
Optional arguments for the ptw
function.
The only argument that cannot be changed is warp.type
: this is always
equal to "global"
.
Ethan Bass
To use variable penalty dynamic time warping, the VPdtw
package must
be manually installed: install.packages('VPdtw')
.
Clifford, D., Stone, G., Montoliu, I., Rezzi, S., Martin, F. P., Guy, P., Bruce, S., & Kochhar, S. 2009. Alignment using variable penalty dynamic time warping. Analytical chemistry, 81(3):1000-1007. tools:::Rd_expr_doi("10.1021/ac802041e").
Clifford, D., & Stone, G. 2012. Variable Penalty Dynamic Time Warping Code for Aligning Mass Spectrometry Chromatograms in R. Journal of Statistical Software, 47(8):1-17. tools:::Rd_expr_doi("10.18637/jss.v047.i08").
Eilers, P.H.C. 2004. Parametric Time Warping. Anal. Chem., 76:404-411. tools:::Rd_expr_doi("10.1021/ac034800e").
Wehrens, R., Bloemberg, T.G., and Eilers P.H.C. 2015. Fast parametric time warping of peak lists. Bioinformatics, 31:3063-3065. tools:::Rd_expr_doi("10.1093/bioinformatics/btv299").
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. tools:::Rd_expr_doi("10.1007/s11306-014-0683-5")
ptw
, correct_peaks
,
VPdtw
if (FALSE) { # interactive()
data(Sa_pr)
warping.models <- correct_rt(Sa_pr, what = "models", lambdas=c("210"))
warp <- correct_rt(chrom_list = Sa_pr, models = warping.models)
}
Run the code above in your browser using DataLab