How to use coalestr
#
We can use coalestr
to evaluate the genetic diversity of a parasite population. There are three stages to this process:
Creating a
Population
by specifying its history of transmission parameters.Running
get_coalescent
to perform a Markov chain simulation of coalescence times.Running
get_diversity
to evaluate nucleotide diversity and haplotype homozygosity using the simulated coalescence times.
We can create a subpopulation by specifying the metapopulation within which it is embedded and by giving the rate of migration from the metapopulation into the subpopulation.
We can analyse a time series by specifying a set of observation times. At each observation time we sample two alleles from the population and perform a simulation of their times to coalescence.
If you want to use coalestr
for your own applications outside this website, you can install it from PyPI or view the source code on GitHub.