cobra | R Documentation |
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.
cobra(X, expressionData, method = "pearson")
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 |
method |
: if pearson, the decomposition of the co-expression matrix is compouted. If pcorsh, COBRA decomposes the regularized partial co-expression Outputs: |
Inputs:
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)
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.