A small, curated collection of standalone population-genomics scripts for
non-model / wildlife genomics. Each topic is a self-contained module you can run
on its own — no workflow engine, no shared framework to learn. Every module ships
its code, a README.md, a theory write-up (theory.md) with primary references,
and a tiny bundled example so you can smoke-test it without cluster data.
These are consolidated, cleaned-up rebuilds of scripts accumulated across several projects. For a fully reproducible Snakemake pipeline version of the diversity statistics, see the separate
popgen-toolkitproject.
| module | what it does | languages | needs |
|---|---|---|---|
coverage_plot |
genome-wide depth & breadth from BAMs, per-sample and per-chromosome plots | bash + python | samtools |
angsd_het |
per-individual heterozygosity from BAMs via ANGSD SAF → realSFS (low-coverage safe) | bash + python | angsd, samtools |
het_snp_density |
per-individual heterozygous SNP density in windows, per-individual × chromosome heatmap | bash + R | bcftools |
gprofiler |
gene-set over-representation analysis with g:Profiler (+ positions→genes helper) | python | gprofiler-official |
One conda environment covers every module:
conda env create -f environment.yml # or: mamba env create -f environment.yml
conda activate popgen-scriptsIndividual modules only need a subset (see each module's README); the single env is provided for convenience.
Each module has a runnable smoke test on bundled toy data:
cd het_snp_density && bash example/make_example.sh && \
bash snp_density.sh -v example/toy.vcf -o example/toy.snpden.txtSee the per-module READMEs for full usage. Method background and citations are in
each theory.md; all references are collected in references.bib.
- Standalone & parameterized — every script takes CLI arguments (argparse / getopts); no hardcoded paths. Bash wraps the genomics tools, Python handles logic and matplotlib plots, R handles the ggplot heatmap.
- Correct normalization — diversity/heterozygosity metrics are normalized by
callable sites, not by raw window length (see the
theory.mdfiles). - Theory is a deliverable — a method is not "done" without its theory write-up and verified primary references.
MIT — see LICENSE.