Tree Space
Display the topologies of 3-taxa tree sampled from MCMC under Kingman’s coalescent model.
3 Taxa
There are 3 different topologies in this tree space:
T=0, where the tree is(A,B),C;T=1, where the tree is(A,C),B;T=2, where the tree is(B,C),A.
We define the tree interval k1 is the root height minus internal node height, and k2 is the internal node height. Both k1 and k2 are simulated by Kingman’s coalescent model using MCMC, where the probability of genealogies in a population is:
P(k1, k2, T | Ne) = (1/Ne) * e(-k1/Ne) * (1/Ne) * e(-3*k2/Ne)
Assuming Ne = 1, then the above equation is simplified to:
P(k1, k2, T) = e-k1 * e(-3*k2)
The proposal during MCMC sampling makes the equal probability change k1 and k2 using the random walk algorithm, where the jump size w is default to 1. When k1 is smaller than 0, there will be an equal probability to change the tree from this topology to any of another two topologies.
The animation of 10,000 samples is available from below.
More animations with different jump size w are available under the folder note in the repository.
Code
The python 3 source code is available from the Jupyter Notebook file TreeSpace3Taxa.ipynb
Diagnose
- MovieWriter ffmpeg unavailable:
brew install ffmpeg
ffmpeg