BiCCA: Bidirectional Canonical Correlation Analysis (BiCCA)

Description Usage Arguments Value Author(s) Examples

View source: R/BiCCA.R

Description

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.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
BiCCA(
  X = NULL,
  Z0 = NULL,
  Y = NULL,
  num.X = 5,
  num.Y = 5,
  temp.path = NULL,
  num.iteration = 100,
  tolerance = 0.05,
  save = FALSE,
  bigMemory = FALSE,
  block.size = 1000,
  ncore = 1
)

Arguments

X

First matrix (M features by K samples)

Z0

Transition matrix (M features by L samples)

Y

Second matrix (N features by L samples)

num.X

Number of canonical vectors to calculate for pair (X, Z) [default 5]

num.Y

Number of canonical vectors to calculate for pair (Z, Y) [default 5]

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]

bigMemory

Use bigMemory mode, this will reduce memory usage when have > 30,000 sampless/features [default TRUE]

block.size

Sample/feature size for each block, only works when bigMemory is set to TRUE

ncore

Number of thread used [default 1]

Value

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 num.X factor)

* 'r' - contains the canonical correlation vectors for Z (sample level)(L samples by num.X factor)

* 's' - contains the canonical correlation vectors for Z (feature level)(M features by num.Y factor)

* 'v' - contains the canonical correlation vectors for Y (N features by num.Y factor)

* 'delta' - relative change ratio for frobenius norm of matrix Z during iteration

Author(s)

Jinzhuang Dou, Dou1@mdanderson.org jinzhuangdou198706@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
X <- simData$X
Y <- simData$Y
Z0 <- simData$Z0

out <- BiCCA(X=X, Z0=Z0, Y=Y, 
      num.X = 5, num.Y = 5, 
      num.iteration = 100, 
      temp.path = "./tp",
      tolerance = 0.05, 
      save = FALSE, 
      bigMemory = TRUE,
      block.size = 1000, 
      ncore = 1)

jinzhuangdou/SCCAT documentation built on July 8, 2020, 2:36 p.m.