Learn R Programming

scran (version 1.0.3)

Distance-to-median: Compute the distance-to-median statistic

Description

Compute the distance-to-median statistic for the CV2 residuals of all genes

Usage

DM(mean, cv2, win.size=50)

Arguments

mean
A numeric vector of average counts for each gene.
cv2
A numeric vector of squared coefficients of variation for each gene.
win.size
An integer scalar specifying the window size for median-based smoothing.

Value

A numeric vector of DM statistics for all genes.

Details

This function will compute the distance-to-median (DM) statistic described by Kolodziejczyk et al. (2015). Briefly, a median-based trend is fitted to the log-transformed cv2 against the log-transformed mean. The DM is defined as the residual from the trend for each gene. This statistic is a measure of the relative variability of each gene, after accounting for the empirical mean-variance relationship. Highly variable genes can then be identified as those with high DM values.

References

Kolodziejczyk AA, Kim JK, Tsang JCH et al. (2015). Single cell RNA-sequencing of pluripotent states unlocks modular transcriptional variation. Cell Stem Cell 17(4), 471--85.

Examples

Run this code
ngenes <- 10000
means <- exp(runif(ngenes, 2, 8))
cv2 <- rgamma(ngenes, 5, 5)
dm.stat <- DM(means, cv2)

Run the code above in your browser using DataLab