Standard pre-processing of response matrices, consisting of a time axis and
a spectral axis (e.g. HPLC-DAD/UV data). For smooth data, like UV-VIS data,
the size of the matrix can be reduced by interpolation. By default,
the data are baseline-corrected in the time direction
(baseline.corr
) and smoothed in the
spectral dimension using cubic smoothing splines (smooth.spline
.
preprocess(
X,
dim1,
dim2,
remove.time.baseline = TRUE,
spec.smooth = TRUE,
maxI,
parallel,
interpolate_rows = TRUE,
interpolate_cols = TRUE,
mc.cores = 2,
...
)
The function returns the preprocessed data matrix, with row names and column names indicating the time points and wavelengths, respectively.
A numerical data matrix, or list of data matrices. Missing values are not allowed. If rownames or colnames attributes are used, they should be numerical and signify time points and wavelengths, respectively.
A new, usually shorter, set of time points (numerical). The range of these should not be outside the range of the original time points, otherwise the function stops with an error message.
A new, usually shorter, set of wavelengths (numerical). The range of these should not be outside the range of the original wavelengths, otherwise the function stops with an error message.
Logical, indicating whether baseline correction
should be done in the time direction, according to
baseline.corr
. Default is TRUE.
Logical, indicating whether smoothing should be done in
the spectral direction, according to
smooth.spline
. Default is TRUE.
if given, the maximum intensity in the matrix is set to this value.
Logical, indicating whether to use parallel processing. Defaults to TRUE (unless you're on Windows).
Logical. Whether to interpolate along dim1. Defaults to TRUE.
Logical. Whether to interpolate along dim2. Defaults to TRUE.
How many cores to use for parallel processing. Defaults to 2.
Further optional arguments to
baseline.corr
.
Ethan Bass
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:1:143-154. tools:::Rd_expr_doi("10.1007/s11306-014-0683-5").
if (FALSE) { # interactive()
data(Sa)
new.ts <- seq(10,18.66,by=.01) # choose time-points
new.lambdas <- seq(200, 318, by = 2) # choose wavelengths
Sa_pr <- preprocess(Sa[[1]], dim1 = new.ts, dim2 = new.lambdas)
}
Run the code above in your browser using DataLab