Skip to contents

Description: COBRA decomposes a (partial) gene co-expression matrix as a linear combination of covariate-specific components. It can be applied for batch correction, differential co-expression analysis controlling for variables, and to understand the impact of variables of interest to the observed co-expression.

Usage

cobra(X, expressionData, standardize = T)

Arguments

X

: design matrix of size (n, q), n = number of samples, q = number of covariates

expressionData

: gene expression as a matrix of size (g, n), g = number of genes

standardize

: boolean flag to standardize the gene expression as a pre-processing step

Outputs:

Value

psi : impact of each covariate on the eigenvalues as a matrix of size (q, n)

Q : eigenvectors corresponding to non-zero eigenvalues as a matrix of size (g, n)

D : non-zero eigenvalues as a list of length n

G : (standardized) gene expression as a matrix of size (g, n)

Details

Inputs:

Examples


g <- 100 # number of genes
n <- 10 # number of samples
q <- 2 # number of covariates
X <- X <- cbind(rep(1, n), rbinom(n, 1, 0.5))
expressionData=matrix(rnorm(g*n, 1, 1), ncol = n, nrow = g)

# Run COBRA algorithm
cobra_output <- cobra(X, expressionData)