limma models log counts; edgeR and DESeq2 model the counts themselves, with a negative binomial distribution whose variance grows with the mean. CytePool implements edgeR 4’s quasi-likelihood pipeline and DESeq2’s analysis, each checked against the R package on the same data.
Normalization¶
Counts depend on how deeply each sample was sequenced and on its composition: a few very
highly expressed genes in one sample take reads from all others. Two corrections are
standard. edgeR multiplies each library size by a normalization factor, from the trimmed
mean of M values (tmm_factors; Robinson & Oshlack (2010)), the upper quartile
(upper_quartile_factors; Bullard et al. (2010)) or the relative log expression
(rle_factors; Anders & Huber (2010)). DESeq2 replaces library sizes by size factors, the
median of each sample’s ratios to the geometric mean of every gene
(median_ratio_size_factors; Anders & Huber (2010)). cpm and log_cpm give
counts per million, and filter_by_expression keeps genes with enough counts in
enough samples for the design Chen et al., 2016.
The negative binomial model¶
For the count of gene in sample ,
with the dispersion and the offset usually the log of the effective library size McCarthy et al., 2012. is the biological coefficient of variation. The coefficients minimize the deviance
which fit_negative_binomial_model finds for every gene, as edgeR’s glmFit does
(NegativeBinomialFit), and which negative_binomial_deviance and
negative_binomial_unit_deviance compute exactly Dunn & Smyth, 2018.
edgeR’s quasi-likelihood F-tests¶
The quasi-likelihood model gives each gene a second, gene-wise dispersion on top of a negative binomial dispersion shared by all genes Lund et al., 2012:
fit_quasi_likelihood follows edgeR 4’s defaults Chen et al., 2025:
is the Cox-Reid common dispersion of the most highly expressed genes (
common_dispersion): the maximum over of the summed adjusted profile log-likelihoods Cox & Reid, 1987McCarthy et al., 2012.Each gene’s quasi-dispersion is its deviance over its residual degrees of freedom, both adjusted for small counts: each unit deviance is approximated by a scaled chi-squared variable with the exact mean and variance of the unit deviance (
negative_binomial_unit_deviance_moments, which givesUnitDevianceMoments), where edgeR approximates them.The quasi-dispersions are moderated by empirical Bayes towards a trend in the average log CPM (
average_log_cpm), with limma’s estimator for unequal degrees of freedom (Empirical Bayes moderation).
The fit is a QuasiLikelihoodFit. quasi_likelihood_f_test fits the model
without the tested coefficients or contrasts, and divides the likelihood ratio statistic
by its degrees of freedom and by the posterior quasi-dispersion; its
QuasiLikelihoodTest has edgeR’s columns: log fold change, log CPM, F, p-value and
FDR. The edgeR User’s
Guide
(section 1.4) recommends these F-tests for bulk RNA-seq because they account for the
uncertainty of the dispersion estimates, which gives stricter error rate control.
DESeq2¶
DESeq2 models the same distribution on the log2 scale with size factors ,
, and shrinks the dispersions in four steps
Love et al., 2014, which deseq2_dispersions reproduces (DESeq2Dispersions):
gene-wise estimates, the maxima of the Cox-Reid adjusted likelihood;
a trend in the mean normalized count , , fitted by a gamma regression;
a normal prior on the log dispersions around the trend, with its variance from the spread of the gene-wise estimates;
maximum a posteriori estimates, keeping the gene-wise estimate of genes far above the trend (dispersion outliers).
fit_deseq2 fits every gene at those dispersions (DESeq2Fit).
deseq2_wald_test tests a coefficient or contrast by
against the normal distribution;
deseq2_likelihood_ratio_test tests a reduced design by the difference of the
deviances against a chi-squared distribution, which tests several coefficients at once,
such as every level of a factor or every time point. Both report DESeq2’s results()
columns (DESeq2Results), filter genes with low mean counts before adjusting the
p-values (independent filtering; Bourgon et al. (2010)) and remove the p-values of genes with an
influential outlier count (Cook’s distance; Cook (1977)).
What differs from the R packages¶
CytePool’s fits converge to the maximum where edgeR’s and DESeq2’s stop at a tolerance,
and its deviances and unit deviance moments are exact where edgeR approximates them; the
differences are reported, with their sizes, on the Validation page.
DESeq2’s replacement of outlier counts, shrunken fold changes (lfcShrink) and edgeR’s
legacy = TRUE methods are not implemented.
- Robinson, M. D., & Oshlack, A. (2010). A scaling normalization method for differential expression analysis of RNA-seq data. Genome Biology, 11(3), R25. 10.1186/gb-2010-11-3-r25
- Bullard, J. H., Purdom, E., Hansen, K. D., & Dudoit, S. (2010). Evaluation of statistical methods for normalization and differential expression in mRNA-Seq experiments. BMC Bioinformatics, 11(1), 94. 10.1186/1471-2105-11-94
- Anders, S., & Huber, W. (2010). Differential expression analysis for sequence count data. Genome Biology, 11(10), R106. 10.1186/gb-2010-11-10-r106
- Chen, Y., Lun, A. T. L., & Smyth, G. K. (2016). From reads to genes to pathways: differential expression analysis of RNA-Seq experiments using Rsubread and the edgeR quasi-likelihood pipeline. F1000Research, 5, 1438. 10.12688/f1000research.8987.2
- McCarthy, D. J., Chen, Y., & Smyth, G. K. (2012). Differential expression analysis of multifactor RNA-Seq experiments with respect to biological variation. Nucleic Acids Research, 40(10), 4288–4297. 10.1093/nar/gks042
- Dunn, P. K., & Smyth, G. K. (2018). Generalized Linear Models With Examples in R. Springer. 10.1007/978-1-4419-0118-7
- Lund, S. P., Nettleton, D., McCarthy, D. J., & Smyth, G. K. (2012). Detecting differential expression in RNA-sequence data using quasi-likelihood with shrunken dispersion estimates. Statistical Applications in Genetics and Molecular Biology, 11(5), Article 8. 10.1515/1544-6115.1826
- Chen, Y., Chen, L., Lun, A. T. L., Baldoni, P. L., & Smyth, G. K. (2025). edgeR v4: powerful differential analysis of sequencing data with expanded functionality and improved support for small counts and larger datasets. Nucleic Acids Research, 53(2), gkaf018. 10.1093/nar/gkaf018
- Cox, D. R., & Reid, N. (1987). Parameter orthogonality and approximate conditional inference. Journal of the Royal Statistical Society: Series B (Methodological), 49(1), 1–18. 10.1111/j.2517-6161.1987.tb01422.x
- Love, M. I., Huber, W., & Anders, S. (2014). Moderated estimation of fold change and dispersion for RNA-seq data with DESeq2. Genome Biology, 15(12), 550. 10.1186/s13059-014-0550-8
- Bourgon, R., Gentleman, R., & Huber, W. (2010). Independent filtering increases detection power for high-throughput experiments. Proceedings of the National Academy of Sciences, 107(21), 9546–9551. 10.1073/pnas.0914005107
- Cook, R. D. (1977). Detection of influential observation in linear regression. Technometrics, 19(1), 15–18. 10.1080/00401706.1977.10489493