NOTICE
A separate community-maintained library of standard simulation population genetic simulation models has been started at https://github.com/popgensims/stdpopsim. The demographic models here will eventually be merged into that repository.
primeval
is a small Python module with functions for performing coalescent simulations under various models of human demographic history, using the msprime reimplementation of Richard Hudson’s seminal ms
program.
The easiest way to use primeval
is with BinderHub. This will launch a cloud-based computing environment, with interactive Jupyter notebooks to run and explore the various coalescent models.
To use primeval
locally, simply clone this repository and ensure that the msprime
library is installed (we recommend installing with conda
, but pip
can also be used--see the msprime
documentation for additional instructions):
conda config --add channels conda-forge
conda install msprime
git clone https://github.com/carjed/primeval.git
cd primeval
Then, from within the Python console or a script, import the primeval.py
module:
# load module
from primeval import *
# Print debugging info for the Gutenkunst et al. (2009) model
gutenkunst_model(debug = True)
Alternatively, the interactive notebooks in this repository can be accessed locally if you have Jupyter installed on your system.
primeval currently includes functions for running coalescent simulations under the following models:
- Gutenkunst et al., 2009
- Fu et al., 2012
- Chen et al., 2015
- Pull requests for other models are welcome!