Primeval
common models of human demography, implemented in Python with msprime
Install / Use
/learn @carjed/PrimevalREADME
primeval
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.
Quick Start
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.
Local Install
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.
Current Models
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!
Related Skills
node-connect
342.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
85.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
342.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
342.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
