computeDropouts | R Documentation |
This function imputes dropout values (zeros) in a count matrix using either a fast numerical solver or a slower linear equations solver.
computeDropouts(consMtx, logX, dropIds, fastSolver = TRUE, nCores)
consMtx |
A numeric matrix representing the processed consensus matrix obtained from clustering analysis. |
logX |
A (sparse or dense) numeric matrix representing the transpose of a log-normalized gene expression matrix. Rows correspond to cells, and columns correspond to genes. |
dropIds |
A numeric vector containing the row/col indices of the dropouts to be imputed. |
fastSolver |
A logical value indicating whether to use the fast solver (default) or the slow solver. |
nCores |
An integer specifying the number of cores to use for parallel processing (if applicable). |
An imputed log-transformed count matrix (same dimensions as 'logX').
library(scater)
library(BiocParallel)
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)
v <- doSVD(corMat, nCores=cores)
BPPARAM = MulticoreParam(cores)
consMtx <- runKM(logX, v, BPPARAM=bpparam())
dropIds <- findDropouts(logX, consMtx)
impLogX <- computeDropouts(consMtx, logX, dropIds, nCores=cores)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.