Skip to main content

CI DOI PyPI License: GPL v3 Python 3.10+ Matplotlib Plotly Bokeh Buy Me A Coffee pyLocusZoom logo

pyLocusZoom

Designed for publication-ready GWAS visualization with regional association plots, gene tracks, eQTL, PheWAS, fine-mapping, and forest plots.

Inspired by LocusZoom and locuszoomr.

Features

  1. Regional association plot:

    • Multi-species support: Built-in reference data for Canis lupus familiaris (CanFam3.1/CanFam4) and Felis catus (FelCat9), or optionally provide your own for any species
    • LD coloring: SNPs colored by linkage disequilibrium (R²) with lead variant
    • Gene tracks: Annotated gene/exon positions below the association plot
    • Recombination rate: Overlay across region (Canis lupus familiaris built-in, or user-provided)
    • SNP labels (matplotlib): Automatic labeling of top SNPs by p-value (RS IDs)
    • Hover tooltips (Plotly and Bokeh): Detailed SNP data on hover

    Example regional association plot with LD coloring, gene track, and recombination overlay Regional association plot with LD coloring, gene/exon track, recombination rate overlay (blue line), and top SNP labels.

  2. Stacked plots: Compare multiple GWAS/phenotypes vertically

  3. Miami plots: Mirrored Manhattan plots for comparing two GWAS datasets (discovery vs replication)

  4. Manhattan plots: Genome-wide association visualization with chromosome coloring

  5. QQ plots: Quantile-quantile plots with confidence bands and genomic inflation factor

  6. eQTL plot: Expression QTL data aligned with association plots and gene tracks

  7. Fine-mapping plots: Visualize SuSiE credible sets with posterior inclusion probabilities

  8. PheWAS plots: Phenome-wide association study visualization across multiple phenotypes

  9. Forest plots: Meta-analysis effect size visualization with confidence intervals

  10. LD heatmaps: Triangular heatmaps showing pairwise LD patterns, standalone or integrated below regional plots

  11. Colocalization plots: GWAS-eQTL scatter plots with LD coloring, correlation statistics, and effect direction visualization

  12. Multiple backends: matplotlib (publication-ready), plotly (interactive), bokeh (dashboard integration)

  13. Pandas and PySpark support: Works with both Pandas and PySpark DataFrames for large-scale genomics data

  14. Convenience data file loaders: Load and validate common GWAS, eQTL and fine-mapping file formats

  15. Automatic gene annotations: Fetch gene/exon data with caching, from UCSC for CanFam3.1, CanFam4 and FelCat9 and from the Ensembl REST API for human, mouse, rat and any other Ensembl species

Installation

pip install pylocuszoom

Or with uv:

uv add pylocuszoom

Or with conda (Bioconda):

conda install -c bioconda pylocuszoom

PySpark DataFrame support is an extra: pip install "pylocuszoom[spark]". LD colouring from a genotype fileset needs PLINK 1.9 on your PATH, or its location passed as plink_path.

Quick Start

from pylocuszoom import LDConfig, LocusZoomPlotter

# Initialize plotter (loads reference data for canine)
plotter = LocusZoomPlotter(species="canine", auto_genes=True)

# The region is passed directly; every other option lives on a config model
fig = plotter.plot(
    gwas_df,                        # DataFrame with chr, pos, p_value, rs columns
    chrom=1,
    start=1000000,
    end=2000000,
    ld=LDConfig(lead_pos=1500000),  # Highlight lead SNP
)
fig.savefig("regional_plot.png", dpi=150)

Pass backend="plotly" or backend="bokeh" to the plotter for an interactive figure with hover tooltips. The User Guide covers every plot type, the config models, the file loaders, the input column formats and species support.

Each figure below links to the User Guide section with its code.

Stacked regional plots

Compare several GWAS over one region, with a shared gene track. User Guide

Example stacked plot comparing two phenotypes Stacked plot comparing two phenotypes with LD coloring and shared gene track.

eQTL overlay

Expression QTL results in their own panel below the association plot. User Guide

Example eQTL overlay plot eQTL overlay with effect direction (up/down triangles) and magnitude binning.

Fine-mapping

SuSiE, FINEMAP, CAVIAR or PolyFun results, with credible sets coloured. User Guide

Example fine-mapping plot Fine-mapping visualization with PIP line and credible set coloring (CS1/CS2).

LD heatmaps

Triangular pairwise LD heatmaps, standalone or as a panel below a regional plot. User Guide

Example LD heatmap Triangular LD heatmap with R² values and lead SNP highlighted.

Example regional plot with LD heatmap Regional association plot with integrated LD heatmap panel below.

Colocalization

GWAS against eQTL significance, coloured by LD or by effect-direction agreement. User Guide

Example colocalization plot GWAS-eQTL colocalization scatter plot with LD coloring and correlation statistics.

PheWAS

One variant's associations across phenotypes, grouped by category. User Guide

Example PheWAS plot PheWAS plot showing associations across phenotype categories with significance threshold.

Forest plots

Effect sizes with confidence intervals across studies. User Guide

Example forest plot Forest plot with effect sizes, confidence intervals, and weight-proportional markers.

Miami plots

Two GWAS mirrored about a shared chromosome axis. User Guide

Example Miami plot Miami plot comparing discovery and replication GWAS with mirrored y-axes and region highlighting.

Manhattan plots

Genome-wide associations by chromosome, or by category. User Guide

Example Manhattan plot Manhattan plot showing genome-wide associations with chromosome coloring and significance threshold.

QQ plots

Observed against expected p-values, with a confidence band and λ. User Guide

Example QQ plot QQ plot with 95% confidence band and genomic inflation factor (λ).

Stacked Manhattan plots

Several GWAS on one chromosome axis. User Guide

Example stacked Manhattan plot Stacked Manhattan plots comparing three GWAS studies with shared chromosome axis.

Manhattan and QQ side by side

A one-figure GWAS summary. Every genome-wide plot takes a GenomeWideStyle for palette, point and font styling. User Guide

Example Manhattan and QQ side-by-side Combined Manhattan and QQ plot showing genome-wide associations and p-value distribution.

Documentation

Citation

If you use pyLocusZoom in your research, please cite it. GitHub's "Cite this repository" button reads CITATION.cff, and each GitHub release is archived on Zenodo with its own DOI. The concept DOI 10.5281/zenodo.22665975 always resolves to the latest version.

@software{denyer_pylocuszoom,
  author  = {Denyer, Michael},
  title   = {pyLocusZoom: Python library for multi-species GWAS visualization},
  url     = {https://github.com/michael-denyer/pyLocusZoom},
  doi     = {10.5281/zenodo.22665975},
  license = {GPL-3.0-or-later}
}

License

GPL-3.0-or-later

Metadata

Release files for pylocuszoom 5.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pylocuszoom 5.2.0
File Size Uploaded
pylocuszoom-5.2.0.tar.gz 9.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pylocuszoom 5.2.0
File Interpreter ABI Platform
pylocuszoom-5.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.2 MB

Release files / pylocuszoom-5.2.0.tar.gz

Download URL pylocuszoom-5.2.0.tar.gz
Size 9.1 MB
Tags Source
SHA-256 checksum
How to use checksums
227784a39a6dbab49e5bc48b3c7b393a2d35cb8e46c515bb24f243d0d1cd451b
BLAKE2b-256 checksum
How to use checksums
06b7c0400a1560acadff5bb3a1a4f0b0d88fe1dc17ccc5f5012635396cbb57d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release files / pylocuszoom-5.2.0-py3-none-any.whl

Download URL pylocuszoom-5.2.0-py3-none-any.whl
Size 195.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44bda187c57c70bfc2574594cd4617ef3dd242956039c418233de1cebc037ceb
BLAKE2b-256 checksum
How to use checksums
d23aa1006590968eb99ec0b63a12b1ac4b6a1acd280d2a2272553aa9d17f1c0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

5.2.0 This release

2 release files

5.1.0

2 release files

5.0.1

2 release files

5.0.0

2 release files

4.3.1

2 release files

4.3.0

2 release files

4.2.0

2 release files

4.1.0

2 release files

4.0.0

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.6.0

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.9

2 release files

1.3.8

2 release files

1.3.7

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.8.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page