Dr Cheng ZhangDigital Liver Group · translational systems medicine

Bioinformatics, step by step · Workshop

Module 4 · What kind of noise do counts have?

Video: T6 Counts are noisy: the negative binomial. Script: scripts/04_count_models.R

Goal. See, with simulations and with real data, why DESeq2 models counts with a negative binomial (NB) distribution, and what the dispersion α means.

Key formulas:

  • Poisson: variance = μ
  • Negative binomial: variance = μ + α μ². In R, rnbinom(n, mu = μ, size = 1/α).
  • For large μ, sd ÷ mean ≈ √α (the biological coefficient of variation).

Q4.1 Simulate 10,000 Poisson and NB (α = 0.1) counts with μ = 100. Do the sample variances match the formulas?

Q4.2 For α = 0.1, compute sd ÷ mean for μ = 10, 100 and 10,000. Compare with √α. When does the Poisson part stop mattering?

Q4.3 In the real data, plot the variance between replicates against the mean. What share of genes has a variance larger than the mean?

Q4.4 Run plotDispEsts(dds). What do the black, red and blue points show? What is the fitted dispersion for highly expressed genes, and what typical difference between replicates does that imply?

Q4.5 (theory) With two replicates per group, why can't we just use each gene's own dispersion estimate? What does DESeq2 assume, so that it can borrow information across genes?