BiCCA | R Documentation |
Assuming there are two matrices X (M features by K samples) and Y (N features by L samples), we want to find the correlation in feature and sample levels between X and Y. Standard CCA could not handle this case because it requires that there should be at least one dimension shared by two datasets. The BiCCA function introudces one transition matrix Z (M features by L samples) to bridge X with Y. The transition matrix Z is solved by maximalizing correlation between (X, Z) in sample level and correlation between (Z, Y) in feature level simultaneously. Then sample/feature level correlation can be obtained by applying standard CCA on (X, Z) and (Y, Z), respectively.
BiCCA( X = NULL, Z0 = NULL, Y = NULL, X.clst = NULL, Y.clst = NULL, parameter.optimize = FALSE, alpha = NULL, lambda = NULL, K = 5, temp.path = NULL, num.iteration = 100, tolerance = 0.01, save = FALSE, block.size = 5000 )
X |
First matrix (M features by K samples) |
Z0 |
Transition matrix (M features by L samples) |
Y |
Second matrix (N features by L samples) |
X.clst |
Cluster ID vector for the first matrix |
Y.clst |
Cluster ID vector for the second matrix |
alpha |
Couple coefficient to assign weight on initilized gene activity matrix Z0 [default 0.5]. alpha is set to [0 1). If alpha is set to 0, the initilized Z0 will not be involved after the 2nd iteration. |
lambda |
Couple coefficient to assign a weight factor to multi-objective function [default 0.5]. lambda is set to (0 1). If lambda is set to 0, the first modality will not be involved during the iteration process. If lambda is set to 1, the second modality will not be involved during the iteration process. In this case, biCCA will reduces to traditional CCA. |
K |
Number of canonical vectors to calculate in low-dimension space [default 10] |
temp.path |
Folder that is used to store temporary files. Only works when option save is set to be TRUE [default NULL] |
num.iteration |
Maximal number of iteration [default 100] |
tolerance |
Relative change ratio for frobenius norm of matrix Z during iteration [default 0.05] |
save |
Save the temporay files [default FALSE] |
block.size |
Sample/feature size for each block, only works when bigMemory is set to TRUE |
Returns the object with list:
* 'Z' - contains the estimated transition matrix (M features by L samples)
* 'u' - contains the canonical correlation vectors for X (K samples by K factor)
* 'r' - contains the canonical correlation vectors for Z (sample level)(L samples by K factor)
* 's' - contains the canonical correlation vectors for Z (feature level)(M features by K factor)
* 'v' - contains the canonical correlation vectors for Y (N features by K factor)
* 'delta' - relative change ratio for frobenius norm of matrix Z during iteration
Jinzhuang Dou, Dou1@mdanderson.org jinzhuangdou198706@gmail.com
X <- sim$X Y <- sim$Y Z0 <- sim$Z0 out <- BiCCA(X=X, Z0=Z0, Y=Y, K = 5, X.clst = sim$X_meta$Group, Y.clst = sim$Y_meta$Group, alpha = 0.5, lambda = 0.5, num.iteration = 100, temp.path = "./tp", tolerance = 0.01, save = TRUE, block.size = 500)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.