Course · Lecture notes, demonstrations and code

Statistical Methods for Modern Biology

Mathematical foundations, demonstrations and code

A course that follows Susan Holmes and Wolfgang Huber's Modern Statistics for Modern Biology (Cambridge University Press, 2019) chapter by chapter, from generative models for counts, likelihood and Bayesian updating, through mixtures, clustering, multiple testing and multivariate analysis, to count data and generalized linear models, networks and phylogenetic trees, image data, supervised learning and the design of experiments.

TrungTin Nguyen · Teaching page · Homepage

What each chapter offers

Lecture notes that fill the gaps. The book is applied and often states a result and moves on. The notes follow it section by section, with its section and figure numbers, and write out the argument behind each such result in a "Filling the gap" box: 237 derivations in all, from the EM algorithm and the bootstrap to Benjamini-Hochberg false discovery rate control, the Eckart-Young theorem, the negative binomial GLM and Ripley's K function.

The book's figures, reproduced. The R code rebuilds 318 of the book's figures from its data, with one function per figure. Where we found a slip in the book, the notes say so and show the evidence.

Demonstrations on real data. 47 browser demonstrations run the methods on the book's data sets. The notes open each one at the case being discussed, each links back to the notes, and each reproduces the numbers of the R code.

Before you start

Prerequisites. A first course in probability and statistics, linear algebra (matrices, eigenvectors) and calculus. Some familiarity with R helps for the code but is not needed for the notes or the demonstrations.

The book. Holmes and Huber's book is freely readable online from its website, together with its data. Keep it open next to the notes: section, figure and exercise numbers match.

Chapters

Chapter 1

Generative Models for Discrete Data

Binomial, Poisson and multinomial models for counts, testing by simulating the null distribution, and the chi-square statistic.

6 figures reproduced · 10 gap-filling derivations · 8 exercises with solutions

Chapter 2

Statistical Modeling

Maximum likelihood and goodness of fit for counts, Bayesian updating with conjugate priors, Hardy-Weinberg equilibrium, and Markov chains for DNA sequences (CpG islands).

25 figures reproduced · 23 gap-filling derivations · 6 exercises with solutions

Chapter 3

Data visualization

The statistics behind the graphics: kernel density estimates, empirical CDFs and QQ plots, two-dimensional densities and hexagonal binning, heatmaps, colour spaces and transformations.

46 figures reproduced · 18 gap-filling derivations · 6 exercises with solutions

Chapter 4

Mixture Models

Finite mixtures and the EM algorithm, zero inflation, the empirical distribution and the bootstrap, the gamma-Poisson (negative binomial) model and variance-stabilising transformations.

25 figures reproduced · 20 gap-filling derivations · 5 exercises with solutions

Chapter 5

Clustering

Distances, k-means and PAM, hierarchical clustering, density-based clustering, choosing the number of clusters, and clustering mass cytometry data and sequencing reads.

26 figures reproduced · 20 gap-filling derivations · 11 exercises with solutions

Chapter 6

Testing

Tests and p-values, permutation tests, and multiple testing: family-wise error, Benjamini-Hochberg false discovery rate control, local fdr, independent filtering and hypothesis weighting.

20 figures reproduced · 17 gap-filling derivations · 7 exercises with solutions

Chapter 7

Multivariate Analysis

Centring and scaling, the singular value decomposition and the Eckart-Young theorem, principal component analysis, biplots, and when components are stable.

30 figures reproduced · 18 gap-filling derivations · 4 exercises with solutions

Chapter 8

High-Throughput Count Data and Generalized Linear Models

RNA-seq counts: size factors, the negative binomial generalized linear model, IRLS, Wald and likelihood ratio tests, dispersion shrinkage and variance-stabilising transformations.

16 figures reproduced · 22 gap-filling derivations · 3 exercises with solutions

Chapter 9

Multivariate methods for heterogeneous data

Multidimensional scaling, correspondence analysis, the horseshoe effect, t-SNE, the RV coefficient, canonical correlation and sparse CCA, and constrained ordination.

40 figures reproduced · 19 gap-filling derivations · 8 exercises with solutions

Chapter 10

Networks and Trees

Graphs and their Laplacians, network analyses, substitution models and phylogenetic trees (Jukes-Cantor, neighbour joining, Felsenstein's pruning), and the minimum-spanning-tree two-sample test.

27 figures reproduced · 22 gap-filling derivations · 9 exercises with solutions

Chapter 11

Image data

Images as arrays, filtering and convolution, thresholding and morphology, segmentation by watershed and Voronoi propagation, and spatial point patterns (Ripley's K and L, pair correlation).

29 figures reproduced · 18 gap-filling derivations · 6 exercises with solutions

Chapter 12

Supervised Learning

Discriminant analysis, logistic regression, overfitting and cross-validation, the curse of dimensionality, the bias-variance trade-off, ridge, lasso and elastic net, and support vector machines.

21 figures reproduced · 10 gap-filling derivations · 5 exercises with solutions

Chapter 13

Design of High Throughput Experiments and their Analyses

Experimental design: randomisation, blocking and pairing, power and sample size, replicates and pseudoreplication, the design effect, batch effects and regression to the mean.

7 figures reproduced · 20 gap-filling derivations · 6 exercises with solutions

Shared resources

R

Code that reproduces the figures

One script per chapter and one function per figure. Runs with R and the CRAN and Bioconductor packages the book uses.

Companion course

Bayesian and Probabilistic Machine Learning

The same format for Bishop's Pattern Recognition and Machine Learning: mixture models and EM, PCA and latent variables, approximate inference and sampling, in more mathematical depth.

Using the material in class

  1. Before the lecture, students read a section of the book and the matching section of the notes, with the derivations closed.
  2. In the lecture, run the book's analysis, then open the demonstration at the linked preset and change one setting to see what the method is sensitive to.
  3. In the tutorial, open the derivations one at a time and work through the exercises at the end of each chapter.
  4. For assignments, students change one choice in the R code (a transformation, a distance, a prior, a filter) and explain what changes in the figure and why.