HapNet: a new Python package for automated population-aware haplotype network analysis and visualization
Abstract
Haplotype networks are widely used in population genetics and phylogeography to visualize genealogical relationships among DNA sequences and to infer population structure, historical connectivity, and demographic processes. Existing software for haplotype network construction relies primarily on interactive graphical interfaces, which limits reproducibility, automation, and integration into modern bioinformatic workflows. Here, I introduce HapNet, an open-source Python package that enables automated construction, visualization, and summarization of haplotype networks directly from aligned FASTA files. HapNet is the first Python-native package designed specifically for automated, population-aware haplotype network construction and visualization from aligned FASTA files. HapNet implements a minimum-spanning-tree approach based on Hamming distances among haplotypes and incorporates population metadata encoded in sequence headers to produce population-aware network visualizations in which shared haplotypes are represented as pie charts and node sizes scale with haplotype frequency. In addition to a publication-ready network, HapNet generates machine-readable tabular output describing haplotype composition, population membership, and shared versus private haplotypes, facilitating downstream statistical analysis and reproducibility. Here, HapNets utility is demonstrated using mitochondrial DNA sequences from the shell-boring polychaete worm Polydora neocaeca, illustrating how the software reveals patterns of population connectivity and haplotype sharing. HapNet provides a reproducible, scriptable alternative to existing graphical tools and is freely available via the Python Package Index and GitHub.
02 /Specification & Classification
Click any tag to browse matching papers- Citations
- 0
- Assay
- Research Focus
- Approach
Reproducibility ledger
Nobody has reported trying to reproduce this paper yet. Did you replicate an experiment or run the code? Your report saves the next lab a week.
Sign in to file a reproducibility report.
Related papers
- HaploThread: A Scalable Integrated Desktop Platform for Constructing and Visualizing Haplotype Networks for Large-sample Sequences
Bo Xu, Lun Li, … Shuhui Song·bioRxiv·Jul 6, 2025
- Haplotype and Population Structure Inference using Neural Networks in Whole-Genome Sequencing Data
Jonas Meisner, Anders Albrechtsen·bioRxiv·Dec 28, 2020
- McAN: an ultrafast haplotype network construction algorithm
Lun Li, Bo Xu, … Shuhui Song·bioRxiv·Jul 23, 2022
- HaploBlocker: Creation of subgroup specific haplotype blocks and libraries
Torsten Pook, Martin Schlather, … Henner Simianer·GeneticsPeer-reviewed·May 31, 2019
- Inferring Phylogenetic Networks Using PhyloNet
D. Wen, Y. Yun, … L. Nakhleh·bioRxiv·Dec 22, 2017
- Haplotracker: a web application for simple and accurate mitochondrial haplogrouping using short DNA fragments
Kijeong Kim, Yoonyeong Kim, … Kyung‐Yong Kim·bioRxiv·Apr 23, 2020