Learn R Programming

edgeR (version 3.10.5)

equalizeLibSizes: 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=NULL, common.lib.size)

Arguments

object
DGEList object
dispersion
numeric vector of dispersion parameters. By default, is extracted from object or, if object contains no dispersion information, is set to 0.05.
common.lib.size
numeric scalar, the library size to normalize to; default is the geometric mean of the original effective library sizes

Value

pseudo.counts
numeric matrix of normalized pseudo-counts
common.lib.size
normalized library size

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.

The output pseudo-counts are the counts that would have theoretically arisen had the effective library sizes been equal for all samples. The pseudo-counts are computed in such as way as to preserve fold-change differences beween the groups defined by object$samples$group as well as biological variability within each group. Consequently, the results will depend on how the groups are defined.

Note that the column sums of the pseudo.counts matrix will not generally be equal, because the effective library sizes are not necessarily the same as actual library sizes and because the normalized pseudo counts are not equal to expected counts.

References

Robinson MD and Smyth GK (2008). Small-sample estimation of negative binomial dispersion, with applications to SAGE data. Biostatistics, 9, 321-332. http://biostatistics.oxfordjournals.org/content/9/2/321

See Also

q2qnbinom

Examples

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

Run the code above in your browser using DataLab