pysinger
A pure-Python rewrite of the SINGER Bayesian ARG sampler.
Disclaimer
This project was set up mainly as an educational resource for myself to understand the SINGER algorithm by reimplementing it from scratch. All intellectual credit belongs to the original authors. For production use, the authoritative reference, and the optimised C++ implementation, please refer to the original repository:
Deng, Y., Nielsen, R. & Song, Y.S. Robust and accurate Bayesian inference of genome-wide genealogies for hundreds of genomes. Nature Genetics 57, 2124–2135 (2025). doi:10.1038/s41588-025-02317-9
- Overview
- Build SINGER yourself
- Step 1 — The Node class
- Step 2 — The Branch class
- Step 3 — The Tree class
- Step 4 — The Recombination class
- Step 5 — The Interval and IntervalInfo classes
- Step 6 — The ARG class
- Step 7 — The CoalescentCalculator
- Step 8 — Emission models
- Step 9 — The BSP (Branch Sequence Propagator)
- Step 10 — The TSP (Time Sequence Propagator)
- Step 11 — The Threader
- Step 12 — The Sampler
- Step 13 — VCF reader
- Step 14 — Fitch parsimony reconstruction
- Step 15 — tskit export
- Putting it all together
- Mathematical background
- Data structures
- Hidden Markov Models
- MCMC threading
- I/O and reconstruction
- API reference