colMeanVars: Calculates column mean and variance. Adapted from pagoda2....

View source: R/RcppExports.R

colMeanVarsR Documentation

Calculates column mean and variance. Adapted from pagoda2. https://github.com/kharchenkolab/pagoda2/blob/main/src/misc2.cpp

Description

Calculates column mean and variance. Adapted from pagoda2. https://github.com/kharchenkolab/pagoda2/blob/main/src/misc2.cpp

Usage

colMeanVars(sY, rowSel, ncores = 1L)

Arguments

sY

sparse matrix Gene by cell matrix of counts

rowSel

numeric The selected rows (genes)

ncores

numeric The number of cores

Value

data.frame with columns of mean, variance, and number of observeatios for each gene across samples

Examples

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)

scITD documentation built on Sept. 8, 2023, 5:11 p.m.