Skip to main content

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

Project description

Getting Started with skyline

version: 0.4.2a0

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.2a0.tar.gz (155.5 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.2a0-py3-none-any.whl (172.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: skyline_plots-0.4.2a0.tar.gz
  • Upload date:
  • Size: 155.5 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.2a0.tar.gz
Algorithm Hash digest
SHA256 f463d5743b9dae5e119804db1d25d547de6f775bccaa79f7f79fe8a37bb9ccfb
MD5 539889c04e6f65c5115d2a3b73fadf54
BLAKE2b-256 89246bc0d8fe12db134796ffed68820f8c94aab654e25280332d12b5ef0fd7b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for skyline_plots-0.4.2a0-py3-none-any.whl
Algorithm Hash digest
SHA256 0bb45a9c1bed03fb2e3e30e0c31acf106091807481937f7069fccc135592829c
MD5 e484248a6723665979c532b531935664
BLAKE2b-256 842ef5e8d8b24d38ef9fd0f96fd43b50f4d78817771b6cae123bac06b4562db7

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