wrapper.sgcca: mixOmics wrapper for Sparse Generalised Canonical Correlation...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/wrapper.sgcca.R

Description

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.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
	
wrapper.sgcca(X,
design = 1 - diag(length(X)),
penalty = NULL,
ncomp = 1,
keepX,
scheme = "horst",
mode="canonical",
scale = TRUE,
init = "svd.single",
tol = .Machine$double.eps,
max.iter=1000,
near.zero.var = FALSE,
all.outputs = TRUE)

Arguments

X

a list of data sets (called 'blocks') matching on the same samples. Data in the list should be arranged in samples x variables. NAs are not allowed.

design

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.

penalty

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).

ncomp

the number of components to include in the model. Default to 1.

keepX

A vector of same length as X. Each entry keepX[i] is the number of X[[i]]-variables kept in the model.

scheme

Either "horst", "factorial" or "centroid" (Default: "horst").

mode

character string. What type of algorithm to use, (partially) matching one of "regression", "canonical", "invariant" or "classic". See Details.

scale

boleean. If scale = TRUE, each block is standardized to zero means and unit variances (default: TRUE)

init

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".

tol

Convergence stopping value.

max.iter

integer, the maximum number of iterations.

near.zero.var

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

all.outputs

boolean. Computation can be faster when some specific (and non-essential) outputs are not calculated. Default = TRUE.

Details

This wrapper function performs sGCCA (see RGCCA) with 1, … ,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.

Value

wrapper.sgcca returns an object of class "sgcca", a list that contains the following components:

data

the input data set (as a list).

design

the input design.

variates

the sgcca components.

loadings

the loadings for each block data set (outer wieght vector).

loadings.star

the laodings, standardised.

penalty

the input penalty parameter.

scheme

the input schme.

ncomp

the number of components included in the model for each block.

crit

the convergence criterion.

AVE

Indicators of model quality based on the Average Variance Explained (AVE): AVE(for one block), AVE(outer model), AVE(inner model)..

names

list containing the names to be used for individuals and variables.

More details can be found in the references.

Author(s)

Arthur Tenenhaus, Vincent Guillemot and Kim-Anh Lê Cao.

References

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., Lê Cao K-A., Grill J., Frouin, V. Variable Selection For Generalized Canonical Correlation Analysis. 2013. (in revision)

See Also

wrapper.sgcca, plotIndiv, plotVar, wrapper.rgcca and http://www.mixOmics.org for more details.

Examples

 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
## 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")
wrap.result.sgcca
#did the algo converge?
wrap.result.sgcca$crit  # yes

## End(Not run)

Example output

Loading required package: MASS
Loading required package: lattice
Loading required package: ggplot2

Loaded mixOmics 6.2.0

Visit http://www.mixOmics.org for more details about our methods.
Any bug reports or comments? Notify us at mixomics at math.univ-toulouse.fr or https://bitbucket.org/klecao/package-mixomics/issues

Thank you for using mixOmics!
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE 
3: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 

Call:
 wrapper.sgcca(X = data, design = design, penalty = c(0.3, 0.5, 1), ncomp = 2, scheme = "centroid") 

 sGCCA with 2 components on block 1 named gene 
 sGCCA with 2 components on block 2 named lipid 
 sGCCA with 2 components on block 3 named Y 

 Dimension of block 1 is  40 120 
 Dimension of block 2 is  40 21 
 Dimension of block 3 is  40 5 

 Selection of 15 17 variables on each of the sGCCA components on the block 1 
 Selection of 7 7 variables on each of the sGCCA components on the block 2 
 Selection of 5 5 variables on each of the sGCCA components on the block 3 

 Main numerical outputs: 
 -------------------- 
 loading vectors: see object$loadings 
 variates: see object$variates 
 variable names: see object$names 

 Functions to visualise samples: 
 -------------------- 
 plotIndiv, plotArrow 

 Functions to visualise variables: 
 -------------------- 
 plotVar, plotLoadings, network

 Other functions: 
 -------------------- 
 selectVar 
[[1]]
 [1]  9.736265 14.049702 14.567438 14.912354 15.097442 15.153714 15.165594
 [8] 15.168647 15.169410 15.169594 15.169638 15.169648 15.169650 15.169651
[15] 15.169651 15.169651 15.169651 15.169651 15.169651 15.169651 15.169651
[22] 15.169651 15.169651 15.169651 15.169651 15.169651 15.169651 15.169651

[[2]]
 [1] 13.86290 14.30810 14.35909 14.37165 14.37542 14.37654 14.37683 14.37690
 [9] 14.37691 14.37692 14.37692 14.37692 14.37692 14.37692 14.37692 14.37692
[17] 14.37692 14.37692 14.37692 14.37692 14.37692 14.37692 14.37692 14.37692

mixOmics documentation built on June 1, 2018, 5:06 p.m.