Wrapper function to perform Sparse Generalised Canonical Correlation Analysis (sGCCA), a generalised approach for the integration of multiple datasets. For more details, see the help(sgcca)
from the RGCCA package.
wrapper.sgcca(X,
design = 1 - diag(length(X)),
penalty = NULL,
ncomp = 1,
keepX.constraint,
keepX,
scheme = "horst",
mode="canonical",
scale = TRUE,
bias = TRUE,
init = "svd.single",
tol = .Machine$double.eps,
verbose = FALSE,
max.iter=1000,
near.zero.var = FALSE)
a list of data sets (called 'blocks') matching on the same samples. Data in the list should be arranged in samples x variables. NA
s are not allowed.
numeric matrix of size (number of blocks in X) x (number of blocks in X) with values between 0 and 1. Each value indicates the strenght of the relationship to be modelled between two blocks using sGCCA; a value of 0 indicates no relationship, 1 is the maximum value. If Y
is provided instead of indY
, the design
matrix is changed to include relationships to Y
.
numeric vector of length the number of blocks in X
. Each penalty parameter will be applied on each block and takes the value between 0 (no variable selected) and 1 (all variables included).
the number of components to include in the model. Default to 1.
A list of same length as X. Each entry keepX.constraint[[i]] is a list containing which variables of X[[i]] are to be kept on each of the first PLS-components
A vector of same length as X. Each entry keepX[i] is the number of X[[i]]-variables kept in the model on the last components (once all keepX.constraint[[i]] are used).
Either "horst", "factorial" or "centroid" (Default: "horst").
character string. What type of algorithm to use, (partially) matching
one of "regression"
, "canonical"
, "invariant"
or "classic"
.
See Details.
boleean. If scale = TRUE, each block is standardized to zero means and unit variances (default: TRUE)
boleean. A logical value for biaised or unbiaised estimator of the var/cov (defaults to FALSE).
Mode of initialization use in the algorithm, either by Singular Value Decompostion of the product of each block of X with Y ("svd") or each block independently ("svd.single") . Default to "svd.single".
Convergence stopping value.
if set to TRUE
, reports progress on computing.
integer, the maximum number of iterations.
boolean, see the internal nearZeroVar
function (should be set to TRUE in particular for data with many zero values). Setting this argument to FALSE (when appropriate) will speed up the computations. Default value is FALSE
wrapper.sgcca
returns an object of class "sgcca"
, a list
that contains the following components:
the input data set (as a list).
the input design.
the sgcca components.
the loadings for each block data set (outer wieght vector).
the laodings, standardised.
the input penalty parameter.
the input schme.
the number of components included in the model for each block.
the convergence criterion.
Indicators of model quality based on the Average Variance Explained (AVE): AVE(for one block), AVE(outer model), AVE(inner model)..
list containing the names to be used for individuals and variables.
This wrapper function performs sGCCA (see RGCCA) with ncomp
components on each block data set.
A supervised or unsupervised model can be run. For a supervised model, the unmap
function should be used as an input data set.
More details can be found on the package RGCCA.
Note that this function is the same as block.spls
with different default arguments.
More details about the PLS modes in ?pls
.
Tenenhaus A. and Tenenhaus M., (2011), Regularized Generalized Canonical Correlation Analysis, Psychometrika, Vol. 76, Nr 2, pp 257-284.
Tenenhaus A., Phillipe C., Guillemot, V., Le Cao K-A., Grill J., Frouin, V. Variable Selection For Generalized Canonical Correlation Analysis. 2013. (in revision)
wrapper.sgcca
, plotIndiv
, plotVar
, wrapper.rgcca
and http://www.mixOmics.org for more details.
# NOT RUN {
data(nutrimouse)
# need to unmap the Y factor diet if you pretend this is not a classification pb.
# see also the function block.splsda for discriminant analysis where you dont
# need to unmap Y.
Y = unmap(nutrimouse$diet)
data = list(gene = nutrimouse$gene, lipid = nutrimouse$lipid, Y = Y)
# with this design, gene expression and lipids are connected to the diet factor
# design = matrix(c(0,0,1,
# 0,0,1,
# 1,1,0), ncol = 3, nrow = 3, byrow = TRUE)
# with this design, gene expression and lipids are connected to the diet factor
# and gene expression and lipids are also connected
design = matrix(c(0,1,1,
1,0,1,
1,1,0), ncol = 3, nrow = 3, byrow = TRUE)
#note: the penalty parameters will need to be tuned
wrap.result.sgcca = wrapper.sgcca(X = data, design = design, penalty = c(.3,.5, 1),
ncomp = 2,
scheme = "centroid", verbose = FALSE)
wrap.result.sgcca
#did the algo converge?
wrap.result.sgcca$crit # yes
# }
Run the code above in your browser using DataLab