Learn R Programming

scITD (version 1.0.4)

colMeanVars: 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)

Value

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

Arguments

sY

sparse matrix Gene by cell matrix of counts

rowSel

numeric The selected rows (genes)

ncores

numeric The number of cores

Examples

Run this code
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