getCorM | R Documentation |
Efficiently computes a column-wise correlation matrix for a given input matrix. Supports Pearson and Spearman correlations, with optional weighting for features.
getCorM(method, x, w, nCores)
method |
A character string specifying the correlation
metric to use. Currently supported options are:
- |
x |
A numeric matrix where each column represents a sample. |
w |
(Optional) A numeric vector of weights for each feature (row) in
|
nCores |
The number of cores to use for parallel processing. |
A correlation matrix of the same dimensions as the number of columns in 'x'. The values represent the pairwise correlations between samples (columns) based on the chosen method and optional weights.
library(scater)
library(splatter)
sce <- splatSimulate(group.prob = rep(1, 5)/5, sparsify = FALSE,
batchCells=100, nGenes=1000, method = "groups", verbose = FALSE,
dropout.type = "experiment")
sce <- logNormCounts(sce)
cores <- 2
logX <- as.matrix(logcounts(sce))
w <- rowVars_fast(logX, cores)
corMat <- getCorM("spearman", logcounts(sce), w, cores)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.