/hg

a python api for higlass

Primary LanguageJupyter NotebookMIT LicenseMIT

hg 🔎

a fresh python library for higlass built on top of higlass-schema and higlass-widget.

License Open In Colab

development

pip install -e .
jupyter notebook notebooks/Examples.ipynb

usage

import hg

# Remote data source (tileset)
tileset1 = hg.remote(
    uid="CQMd6V_cRw6iCI_-Unl3PQ",
    server="https://higlass.io/api/v1/",
    name="Rao et al. (2014) GM12878 MboI (allreps) 1kb",
)

# Local tileset
tileset2 = hg.cooler("../data/dataset.mcool")

# Create a `hg.HeatmapTrack` for each tileset
track1 = tileset1.track("heatmap")
track2 = tileset2.track("heatmap")

# Create two independent `hg.View`s, one for each heatmap
view1 = hg.view(track1, width=6)
view2 = hg.view(track2, width=6)

# Lock zoom & location for each `View`
view_lock = hg.lock(view1, view2)

# Concatenate views horizontally and apply synchronization lock
(view1 | view2).locks(view_lock)

Side-by-side Hi-C heatmaps, linked by pan and zoom