DOI: 10.1093/bioadv/vbag173 ISSN: 2635-0041

pygenoscape: a Python package for spatial interpolation and visualization of genetic distance landscapes

Andrew A Davinack, Rylie A Seaberg

Abstract

Motivation

Spatial genetic structure is central to population genetics and phylogeography, but many approaches rely on discrete population models or summary statistics that can obscure continuous geographic patterns.

Results

We developed pygenoscape, an open-source Python package for transforming pairwise genetic distance data into continuous spatial representations of genetic turnover. The package accepts precomputed genetic distance matrices or aligned nucleotide sequence data and combine distance embedding, geographic projection, spatial interpolation, and interactive visualization in a reproducible command-line workflow. We demonstrate its utility using genome-wide data from the invasive bumblebee Bombus terrestris and mitochondrial sequence data from the marine polychaete Hydroides dianthus. In both empirical examples, pygenoscape recovered spatial patterns consistent with previous population genetic analyses, including weak spatial structure in B. terrestris and stronger phylogeographic turnover in H. dianthus. Simulation-based validation further showed that the method reconstructs known spatial genetic patterns, including gradual isolation-by-distance and localized barrier scenarios.

Availability and implementation

pygenoscape is freely available at https://github.com/parasiteguy/pygenoscape under the MIT License and can be installed from PyPI using pip install pygenoscape.

More from our Archive