Skip to main content

A simple plotting library for making genomic tracks

Project description

PlotNado

Tests

PlotNado is a lightweight Python package for building genome browser-style figures with a modern, chainable API.

[!NOTE] This version of PlotNado is independent and does not require CoolBox.

Install

pip install plotnado

For development from source:

git clone https://github.com/alsmith151/plotnado
cd plotnado
pip install -e .[dev,docs]

# required developer setup: run local quality hooks before every commit
pip install pre-commit
pre-commit install

Developer workflow (important)

  • Do not edit autogenerated typing surfaces directly:
    • plotnado/figure.pyi
    • auto-generated overload blocks in plotnado/figure.py (# BEGIN/END AUTO-GENERATED OVERLOAD)
  • Make API changes in the source Pydantic models first (track models/aesthetics/labels), then regenerate artifacts:
python scripts/generate_figure_overloads.py
python scripts/generate_figure_stub.py
  • Always run pre-commit before pushing:
pre-commit run --all-files

Quick Start

from plotnado import GenomicFigure
import numpy as np
import pandas as pd

bins = np.arange(1_000_000, 1_100_000, 1_000)
signal = pd.DataFrame({
    "chrom": "chr1",
    "start": bins,
    "end": bins + 1_000,
    "value": 5 + 2 * np.sin(np.linspace(0, 6, len(bins))),
})

fig = GenomicFigure()
fig.scalebar()
fig.axis()
fig.genes("hg38")
fig.bigwig(signal, title="Synthetic signal", style="fill", color="#1f77b4")
fig.save("quickstart.png", "chr1:1,010,000-1,080,000")

GenomicFigure() now uses publication-style defaults automatically. Use GenomicFigure(theme=None) to opt out.

Examples

  • Start with python examples/basic_figure.py
  • Then run python examples/advanced_features.py
  • Full curated suite: python examples/run_examples.py
  • Additional focused examples live in:
    • examples/quickstart/
    • examples/tracks/
    • examples/recipes/

All scripts write outputs to examples/output/.

Key Features

  • Chainable GenomicFigure API for fast composition.
  • Alias-based track creation (fig.add_track("bigwig", ...)).
  • Track option introspection at runtime.
  • Built-in themes, autocolor, autoscale, and highlight overlays.
  • Broad track support: BigWig, BED, narrowPeak, genes, axis, scalebar, links, OverlayTrack, cooler-based matrix tracks.

Discover Track Options

from plotnado import GenomicFigure, BigWigTrack

GenomicFigure.available_track_aliases()
GenomicFigure.track_options("bigwig")
GenomicFigure.track_options_markdown("bigwig")
BigWigTrack.options_markdown()

Documentation

  • Docs home: docs/index.md
  • Quick start: docs/quickstart.md
  • Track catalog + options: docs/track_catalog.md
  • API and generated references: docs/api_reference.md

Build docs locally:

pip install -e .[docs]
mkdocs build --strict
mkdocs serve

CLI

plotnado plot chr1:1,000,000-1,100,000 -o browser_view.png
plotnado track-options bigwig
plotnado track-options --all --output-format json

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plotnado-0.3.tar.gz (8.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plotnado-0.3-py3-none-any.whl (7.8 MB view details)

Uploaded Python 3

File details

Details for the file plotnado-0.3.tar.gz.

File metadata

  • Download URL: plotnado-0.3.tar.gz
  • Upload date:
  • Size: 8.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for plotnado-0.3.tar.gz
Algorithm Hash digest
SHA256 2bc0fb3b257a49678108d2e9486a2b001fbf78caf7dd0373233618039b743d88
MD5 b5a9692cc07a3e3fe6d6e4f9adb3e281
BLAKE2b-256 e0e516d797a335ee05ec691599f42739295bcfe2c00d5d00e1f7ec2c9fda7b51

See more details on using hashes here.

Provenance

The following attestation bundles were made for plotnado-0.3.tar.gz:

Publisher: publish.yml on alsmith151/plotnado

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file plotnado-0.3-py3-none-any.whl.

File metadata

  • Download URL: plotnado-0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for plotnado-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ae131d30ea073e517c9c67940ac02f3e6ec1600cdec32b0eca5cae51fed84421
MD5 5cb90b4afef907e447b4393431e53ef9
BLAKE2b-256 a8012fb7321369b10c71ebf9003009b20eb5ad39245e256aaf2abb3a8db4bd3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for plotnado-0.3-py3-none-any.whl:

Publisher: publish.yml on alsmith151/plotnado

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page