powered by
Calculates column mean and variance. Adapted from pagoda2. https://github.com/kharchenkolab/pagoda2/blob/main/src/misc2.cpp
colMeanVars(sY, rowSel, ncores = 1L)
data.frame with columns of mean, variance, and number of observeatios for each gene across samples
sparse matrix Gene by cell matrix of counts
numeric The selected rows (genes)
numeric The number of cores
library(Matrix) donor_by_gene <- rbind(c(9,2,1,5), c(3,3,1,2)) donor_by_gene <- Matrix(donor_by_gene, sparse = TRUE) result <- colMeanVars(donor_by_gene, rowSel = NULL, ncores=1)
Run the code above in your browser using DataLab