Skip to main content

Genomic plotting toolkit (Manhattan, Miami, locus-view and tracks)

Project description

Getting Started with skyline

version: 0.4.1a0

The skyline package is a genomic plotting toolkit. It was initially put together to plot Manhattan plots but can be generalised to plot general genomic "track" based data. Currently you can:

  1. Plot Manhattan style plots
  2. Plot Miami style plots
  3. Plot skyview plots (multiple Manhattans stacked and viewed from the top)
  4. Locus view type plots
  5. Link tracks together with different sorts of linkers
  6. Add label tracks

Architecture

Tracks are first-class objects that draw into Matplotlib Axes (they are not Axes subclasses), with hierarchical Theme styles and full access to Figure / Axes / Artists. Prefer imports from the package root (from skyline import manhattan, Theme, …).

High-level vs low-level API

Skyline offers two complementary surfaces:

Layer What it is When to use it
High-level Recipe functions (manhattan, miami, locus_scatter, …) that return a PlotResult Common figures, pipelines, and automation — few lines to a finished plot
Low-level Track / building-block classes (GenomicScatter, GeneTrack, linkers, rulers, grids, …) with draw(ax) Custom multi-track figures and layouts recipes do not cover
Shared Hierarchical Theme / role-leaf styles Styling both recipes and hand-built tracks

Recipes are the stable façade for everyday use; the low-level API is for composition and control. Matplotlib remains available underneath both (e.g. result.scatter.ax).

from skyline import HumanGRCh38, manhattan

res = manhattan(gwas_df, HumanGRCh38())
res.savefig("manhattan.png")
res.scatter.ax.axhline(y=7.3, ls="--")  # Matplotlib escape hatch

Installation

Conda

conda install -c cfin -c bioconda -c conda-forge skyline-plots

Optional Ensembl REST helpers:

pip install "skyline-plots[ensembl]"
# or install ensembl-rest-client into the same environment

Pip (from PyPI)

pip install skyline-plots
pip install "skyline-plots[ensembl]"   # optional REST features

The import package is still skyline (from skyline import …).

From a clone (development)

git clone git@gitlab.com:cfinan/skyline.git
cd skyline
python -m pip install -e ".[dev]"

For Ensembl-backed locus features during development:

python -m pip install -e ".[dev,ensembl]"

Example / demo data

Large example GWAS tables are not shipped in the installed package (they remain in the git tree under skyline/example_data/ for local notebooks and scripts). A small assembly coordinate file required by HumanGRCh37 / HumanGRCh38 / HumanNCBI36 is installed.

A download helper or documented data archive for demos is planned; until then use a git checkout for full examples.

Documentation

Online: https://cfinan.gitlab.io/skyline/

The docs home page mirrors this README. A progressive tutorial lives under resources/examples/ and the Sphinx “Tutorial” section. Notebook titles are tagged [high-level], [low-level], or [shared] so the layer is obvious in the sidebar:

  1. High-level recipes (Manhattan, Miami, locus view)
  2. Shared styles (Theme)
  3. Low-level tracks (scatter, genes, skyview / linkers / grids)
  4. Composition (recipe grids, hand-built multi-track figures, dual-locus capstone)

Local docs / CI dry-run (docker + pytest + Sphinx, HTML rsynced to pCloud):

cd resources/ci_cd
./build.sh

Tests

pytest tests/

Licence

GPLv3+ — see LICENCE.txt.

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

skyline_plots-0.4.1a0.tar.gz (155.0 kB view details)

Uploaded Source

Built Distribution

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

skyline_plots-0.4.1a0-py3-none-any.whl (171.6 kB view details)

Uploaded Python 3

File details

Details for the file skyline_plots-0.4.1a0.tar.gz.

File metadata

  • Download URL: skyline_plots-0.4.1a0.tar.gz
  • Upload date:
  • Size: 155.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for skyline_plots-0.4.1a0.tar.gz
Algorithm Hash digest
SHA256 0fe5600d736b8621e89a77d197485246de6f593c1a1a39b1a553ca7d384e1460
MD5 624b776bc184a4ad73b23e35553139ac
BLAKE2b-256 d154f1e6445bc7799406537c25aae64a6cac52eb39f182056075b02b2cc5047d

See more details on using hashes here.

File details

Details for the file skyline_plots-0.4.1a0-py3-none-any.whl.

File metadata

File hashes

Hashes for skyline_plots-0.4.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e7a89760c0e0d0a62ed96355e886504c3939b84dfcfdbc76ee8fc979be67c98
MD5 5c83964fffa76fce1ed5fbd1b1f553ef
BLAKE2b-256 a88185033121fffa674ded771a11ca4af36d8bc867a9850d035605432f2df3be

See more details on using hashes here.

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