Interactive demo · Statistical Methods for Modern Biology · Chapter 10

Graph-based two-sample tests: Friedman and Rafsky on the mouse microbiome

Each point is one of 344 stool samples from 12 mice in 2 litters (Holmes and Huber 2019, Section 10.6). A skeleton graph joins similar samples: the minimum spanning tree (MST), the k-nearest-neighbour graph or all pairs closer than a threshold. An edge is pure when its two samples carry the same label (mouse or litter). If the labels had nothing to do with the microbial composition, relabelling the samples at random would give about as many pure edges as observed. The histogram shows that permutation null; the red line is the observed count. Positions on the left are a force-directed layout of the minimum spanning tree of the chosen dissimilarity (computed once in R), only for display: the tests use the graph, not the picture.

Data

Dissimilarity

Skeleton graph

k
max

Labels tested

Permutations

Simulation (two 2-D normal samples)

shift Δ
n per group

Run

Scoreboard

Try these

Quantitative Jaccard is what phyloseq::distance(method = "jaccard") returns: 2B/(1 + B) with B the Bray-Curtis dissimilarity, an increasing function of B, so the MST and the k-NN graphs are the same for both. Binary Jaccard uses presence and absence only. The k-NN rule is that of the book's package: i and j are joined if either is among the k nearest of the other. Permutations use a seeded generator, so the same buttons give the same histogram.

In the lecture notes