Description Usage Arguments Details Value Author(s) Examples
One of the inherent drawbacks of the MCR-ALS method is that in the vast majority of cases there is no one unique set of components describing the data, a situation known as "rotational ambiguity". This implies that in some cases a spectrum of a chemical compound can be described by a linear combination of two ALS components. This can sometimes be recognised by looking at elution profiles. In addition, in cases where the number of components is too large, some components may only describe noise or very small and irrelevant features. The functions clarified here allow one to find which components only correspond with minor features, to remove components, and to merge components.
1 2 3 4 5 | smallComps(obj, Ithresh)
removeComps(obj, toRemove, ...)
combineComps(obj, compList, weights, ...)
suggestCompCombis(obj, indices, Ithresh = 0, corthresh = 0.9,
clusterHeight = 0.6)
|
obj |
The R object containing the als model |
Ithresh |
Intensity cutoff: all components with a maximal intensity (in the elution profiles) below this value will be termed "small". |
toRemove |
The indices of the components to remove from the ALS
model. A new call to |
... |
Additional arguments to |
compList |
A list indicating which components need to be
combined. Using |
weights |
Weights for the components to be combined. If not provided, equal weights will be assumed. |
indices |
A list indicating in which (groups of) samples correlations will be calculated. See details. |
corthresh |
Correlation threshold: components with elution profiles showing a higher correlation than this threshold may be candidates for merging. |
clusterHeight |
Similarity threshold at which to cut the dendrogram (see details). |
Function suggestCompCombis
checks correlations in
elution profiles that could point to a situation where one chemical
compound is described by two or more ALS components. For every sample
in which this correlation is higher than the threshold, a "hit" will
be recorded for these two components. After checking all samples and
all combinations, the hit matrix will be used as a similarity measure
in a hierarchical clustering. The dendrogram will be cut at a specific
height, leading to groups of components, sometimes containing more
than one element. In such a case, these components could be considered
for merging.
If injections of pure standards are present, they probably should not be used in isolation to check for coelution; rather, suggestions for combined components can be validated looking at the elution profiles of the standards.
Functions removeComps
and combineComps
return
ALS
objects with fewer components than the original
object. Function smallComps
returns a list of two elements:
smallComps |
the indices of the small components |
maxCvalues |
the maximal values found in the concentration profiles across all samples for each of the components. |
Ron Wehrens
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | data(tea)
new.lambdas <- seq(260, 500, by = 2)
tea <- lapply(tea.raw, preprocess)
tea.split <- splitTimeWindow(tea, c(12, 14), overlap = 10)
Xl <- tea.split[[3]]
Xl.opa <- opa(Xl, 10)
Xl.als <- doALS(Xl, Xl.opa)
smallC <- smallComps(Xl.als, 5)
smallC
Xl.als2 <- removeComps(Xl.als, smallC$smallC)
summary(Xl.als)
summary(Xl.als2)
## smaller models, but with a higher fit error...
## another way to decrease the number of components, this example
## not particularly deep, just to show how it can be done:
Xl.als3 <- combineComps(Xl.als, list(1, 2, 3:4, 5, c(6, 10), 6, 7:9))
summary(Xl.als3)
|
Loading required package: ALS
Loading required package: nnls
Loading required package: Iso
Iso 0.0-17
Loading required package: ptw
There were 50 or more warnings (use warnings() to see the first 50)
$smallComps
Component 5 Component 6 Component 8
5 6 8
$maxCvalues
Component 1 Component 2 Component 3 Component 4 Component 5 Component 6
5.655070 353.613378 437.364245 19.930027 4.284987 3.054079
Component 7 Component 8 Component 9 Component 10
6.727300 3.909809 8.156879 17.170391
ALS object fitting 5 samples with 10 components.
Each data matrix contains 209 wavelengths and 30 timepoints
RMS fit error: 0.02231
LOF: 0.19%
R2: 1
ALS object fitting 5 samples with 7 components.
Each data matrix contains 209 wavelengths and 30 timepoints
RMS fit error: 0.05161
LOF: 0.44%
R2: 0.99998
Warning messages:
1: In xx/sqrt(crossprod(xx)) :
Recycling array of length 1 in vector-array arithmetic is deprecated.
Use c() or as.vector() instead.
2: In xx/sqrt(crossprod(xx)) :
Recycling array of length 1 in vector-array arithmetic is deprecated.
Use c() or as.vector() instead.
3: In xx/sqrt(crossprod(xx)) :
Recycling array of length 1 in vector-array arithmetic is deprecated.
Use c() or as.vector() instead.
4: In xx/sqrt(crossprod(xx)) :
Recycling array of length 1 in vector-array arithmetic is deprecated.
Use c() or as.vector() instead.
5: In xx/sqrt(crossprod(xx)) :
Recycling array of length 1 in vector-array arithmetic is deprecated.
Use c() or as.vector() instead.
6: In xx/sqrt(crossprod(xx)) :
Recycling array of length 1 in vector-array arithmetic is deprecated.
Use c() or as.vector() instead.
7: In xx/sqrt(crossprod(xx)) :
Recycling array of length 1 in vector-array arithmetic is deprecated.
Use c() or as.vector() instead.
ALS object fitting 5 samples with 7 components.
Each data matrix contains 209 wavelengths and 30 timepoints
RMS fit error: 0.05241
LOF: 0.45%
R2: 0.99998
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.