What it simulates
ipcoal simulates gene genealogies and DNA variants along a species tree under the multispecies coalescent. It builds on msprime for the simulation and adds a species-tree interface, per-locus genealogy tables and tools for phylogenetic analysis. You give it a species tree with branch lengths in generations, an effective population size, the number of samples per tip, the number of loci and sites, and mutation and recombination rates.
It returns the local gene tree for every stretch of sequence between recombination breakpoints, plus the SNPs that fell on them. The key assumption is that gene trees can differ from the species tree through incomplete lineage sorting: two lineages that fail to coalesce inside a short branch may coalesce deeper, in a different order. The recipe's helper script uses one Ne for every branch. Loci are unlinked from each other and recombine only inside a locus.
When to use it
Use ipcoal to ask how often gene trees disagree with the species tree for a given Ne and branch length. It also generates test data for species-tree and gene-tree inference methods, and for checking a phylogenetic pipeline against a known truth.
- Use msprime when you have one population or a custom demography and want a VCF with full control over the model.
- Use stdpopsim for published models of a real species.
Run it in your browser
ipcoal has no browser version on biosimhub. Use the install route below.
Install it yourself
The conda command resolves for ipcoal 0.5.0:
micromamba create -n ipcoal -c conda-forge ipcoal=0.5.0
The ipcoal docs also list pip install ipcoal. A minimal run in Python, without the recipe's helper script:
import ipcoal, toytree
tree = toytree.tree("((A:200000,B:200000):200000,(C:200000,D:200000):200000);")
model = ipcoal.Model(tree, Ne=100_000, nsamples=2, mut=1e-8, recomb=1e-9,
seed_trees=1, seed_mutations=1)
model.sim_loci(nloci=3, nsites=1000)
print(model.df[["locus", "start", "end", "nsnps"]])
In the recipe's 0.5.0 image, locus 0 split into 5 genealogy segments with 3, 11, 9, 3 and 0 SNPs. The table model.df has one row per segment.