Sign in
Evolutionary BiologyMitochondrial DNA Part A
Peer-reviewed journal article

HapNet: a new Python package for automated population-aware haplotype network analysis and visualization

Andrew A. DavinackiD

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.

PDFDOI

02 /Specification & Classification

Click any tag to browse matching papers

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.

Similarity Map
SelectedSame fieldCross-field
THISXu '25Meisner '20Li '22Pook '19Wen '17Kim '20
72% semantic matchBioinformatics
Bo Xu, Lun Li, Cuiping Li+3 more·bioRxiv·Jul 6, 2025