Description Usage Arguments Value Note References See Also Examples
This is an implementation of alternating least squares
multivariate curve resolution (MCRALS). Given a dataset in matrix
form d1
, the dataset is decomposed as d1=C %*% t(S)
where the columns of C
and S
represent components
contributing to the data in each of the 2ways that the matrix is
resolved. In forming the decomposition, the components in each way
many be constrained with e.g., nonnegativity, unimodality,
selectivity, normalization of S
and closure of C
. Note
that if more than one dataset is to be analyzed simultaneously, then
the matrix S
is assumed to be the same for every dataset in the
bilinear decomposition of each dataset into matrices C
and
S
.
1 2 3 4 5 6 
CList 
list with the same length as 
PsiList 
list of datasets, where each dataset is a matrix of dimension

S 
matrix with 
WList 
An optional list with the same length as 
thresh 
numeric value that defaults to .001; if

maxiter 
The maximum number of iterations to perform (where an
iteration is optimization of either 
forcemaxiter 
Logical indicating whether 
optS1st 
logical indicating whether the first constrained least
squares regression should estimate 
x 
optional vector of labels for the rows of 
x2 
optional vector of labels for the rows of 
baseline 
logical indicating whether a baseline component is
present; if 
fixed 
list with the same length as 
nonnegS 
logical indicating whether the components (columns) of
the matrix 
nonnegC 
logical indicating whether the components (columns) of
the matrix 
uniC 
logical indicating whether unimodality constraints should be
applied to the columns of 
uniS 
logical indicating whether unimodality constraints should be
applied to the columns of 
normS 
numeric indicating whether the spectra are normalized; if

closureC 
list; if the length is zero, then no closure constraints are applied. If the length is not zero, it should be equal to the number of datasets in the analysis, and contain numeric vectors consisting of the desired value of the sum of each row of the concentration matrix. 
A list with components:
CList 
A list with the same length as the number of datasets,
containing the optimized matrix 
S 
The matrix 
rss 
The residual sum of squares at termination. 
resid 
A list with the same length as the number of datasets, containing the residual matrix for each dataset 
iter 
The number of iterations performed before termination. 
This function was used to solve problems described in
van Stokkum IHM, Mullen KM, Mihaleva VV. Global analysis of multiple gas chromatographymass spectrometry (GS/MS) data sets: A method for resolution of coeluting components with comparison to MCRALS. Chemometrics and Intelligent Laboratory Systems 2009; 95(2): 150163.
in conjunction with the package TIMP. For the code to reproduce
the examples in this paper, see examples_chemo.zip included in the
inst
directory of the package source code. .
Garrido M, Rius FX, Larrechi MS. Multivariate curve resolution alternating least squares (MCRALS) applied to spectroscopic data from monitoring chemical reactions processes. Journal Analytical and Bioanalytical Chemistry 2008; 390:20592066.
Jonsson P, Johansson A, Gullberg J, Trygg J, A J, Grung B, Marklund S, Sjostrom M, Antti H, Moritz T. Highthroughput data analysis for detecting and identifying differences between samples in GC/MSbased metabolomic analyses. Analytical Chemistry 2005; 77:56355642.
Tauler R. Multivariate curve resolution applied to second order data. Chemometrics and Intelligent Laboratory Systems 1995; 30:133146.
Tauler R, Smilde A, Kowalski B. Selectivity, local rank, threeway data analysis and ambiguity in multivariate curve resolution. Journal of Chemometrics 1995; 9:3158.
matchFactor
,multiex
,multiex1
,
plotS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31  ## load 2 matrix datasets into variables d1 and d2
## load starting values for elution profiles
## into variables Cstart1 and Cstart2
## load time labels as x, m/z values as x2
data(multiex)
## starting values for elution profiles
matplot(x,Cstart1,type="l")
matplot(x,Cstart2,type="l",add=TRUE)
## using MCRALS, improve estimates for mass spectra S and the two
## matrices of elution profiles
## apply unimodality constraints to the elution profile estimates
## note that the starting estimates for S just contain a dummy matrix
test0 < als(CList=list(Cstart1,Cstart2),S=matrix(1,nrow=400,ncol=2),
PsiList=list(d1,d2), x=x, x2=x2, uniC=TRUE, normS=0)
## plot the estimated mass spectra
plotS(test0$S,x2)
## the known mass spectra are contained in the variable S
## can compare the matching factor of each estimated spectrum to
## that in S
matchFactor(S[,1],test0$S[,1])
matchFactor(S[,2],test0$S[,2])
## plot the estimated elution profiles
## this shows the relative abundance of the 2nd component is low
matplot(x,test0$CList[[1]],type="l")
matplot(x,test0$CList[[2]],type="l",add=TRUE)

Loading required package: nnls
Loading required package: Iso
Iso 0.017
Initial RSS 3.039967e+13
Iteration (opt. S): 1, RSS: 1.330703e+12, RD: 0.9562264
Iteration (opt. C): 2, RSS: 153488187, RD: 0.9998847
Iteration (opt. S): 3, RSS: 102433454, RD: 0.3326297
Iteration (opt. C): 4, RSS: 102351694, RD: 0.0007981757
Initial RSS / Final RSS = 3.039967e+13 / 102351694 = 297011.9
[,1]
[1,] 0.9999994
[,1]
[1,] 0.9999917
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.