equalizeLibSizes {edgeR}R Documentation

Equalize Library Sizes by Quantile-to-Quantile Normalization

Description

Adjusts counts so that the effective library sizes are equal, preserving fold-changes between groups and preserving biological variability within each group.

Usage

equalizeLibSizes(object, dispersion=0, common.lib.size)

Arguments

object

DGEList object

dispersion

numeric scalar or vector of dispersion parameters; if a scalar, then a common dispersion parameter is used for all tags

common.lib.size

numeric scalar, the library size to normalize to; default is the geometric mean of the original effective library sizes

Details

Thus function implements the quantile-quantile normalization method of Robinson and Smyth (2008). It computes normalized counts, or pseudo-counts, used by exactTest and estimateCommonDisp.

Note that the output common library size is a theoretical quantity. The column sums of the normalized counts, while to be exactly equal, nor are they intended to be. However, the expected counts for each tag are equal under the null hypothesis of no differential expression.

Value

A list with components

pseudo.counts

numeric matrix of normalized pseudo-counts

common.lib.size

normalized library size

Author(s)

Mark Robinson, Davis McCarthy, Gordon Smyth

References

Robinson MD and Smyth GK (2008). Small-sample estimation of negative binomial dispersion, with applications to SAGE data. Biostatistics, 9, 321-332.

See Also

q2qnbinom

Examples

ngenes <- 1000
nlibs <- 2
counts <- matrix(0,ngenes,nlibs)
colnames(counts) <- c("Sample1","Sample2")
counts[,1] <- rpois(ngenes,lambda=10)
counts[,2] <- rpois(ngenes,lambda=20)
summary(counts)
y <- DGEList(counts=counts)
out <- equalizeLibSizes(y)
summary(out$pseudo.counts)

[Package edgeR version 3.4.2 Index]