gene_vars: Compute variance for each gene in a gene x sample matrix

View source: R/vg.R

gene_varsR Documentation

Compute variance for each gene in a gene x sample matrix

Description

This function uses mean(values ^ 2) - mean(values) ^ 2

Usage

gene_vars(dat, means = NULL, rescale = FALSE)

Arguments

dat

a matrix or dg[CT]Matrix of expression values with genes as rows and samples as columns.

means

(optional) a vector of means for each gene/row. If NULL (default), will be computed using gene_means().

rescale

a logical indicating whether or not to rescale using rescale_samples(). Default is FALSE.

Details

Results will differ from the var() function.

Value

a numeric vector of variance values for each gene


AllenInstitute/scrattch.hicat documentation built on Oct. 20, 2023, 6:55 a.m.