Python bindings for HiGlass
Project description
higlass-python v2 🔎
a fresh python library for higlass
built
on top of higlass-schema
and
higlass-widget
.
Usage
import higlass as 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)
Development
higlass-python uses the recommended hatchling
build-system,
which is convenient to use via the hatch
CLI. We recommend installing hatch
globally (e.g., via pipx
) and running the various commands defined within pyproject.toml
. hatch
will take care
of creating and synchronizing a virtual environment with all dependencies defined in pyproject.toml
.
Commands Cheatsheet
All commands are run from the root of the project, from a terminal:
Command | Action |
---|---|
hatch run fix |
Format project with black . and apply linting with ruff --fix . |
hatch run lint |
Lint project with ruff . . |
hatch run test |
Run unit tests with pytest in latest Python version. |
hatch run test:test |
Run unit tests with pytest in all target Python versions. |
hatch run docs:build |
Build the documentation in docs/_build/html . |
hatch run docs:serve |
Start an dev-server for live editing RST files in docs/ . |
Note:
hatch build
andhatch publish
are available to build and publish the project to PyPI, but all releases are handled automatically via CI.
Alternatively, you can develop higlass-python by manually creating a virtual environment and
managing installation and dependencies with pip
. For example, create a virtual environment
with conda
:
conda create -n higlass python=3.11
conda activate higlass
and install higlass-python in editable mode with all optional dependencies:
pip install -e ".[dev,fuse,docs]"
Our CI checks formatting (black .
), linting (ruff .
), and tests (pytest
).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for higlass-0.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8adc267c74b00d0dc40a2765a655fd360da41a7937c128d3507e3a486bfba4c1 |
|
MD5 | 1cb33b3179cf20e93756fcb59080a626 |
|
BLAKE2b-256 | 2af35d43b7f2c6999b870c95a2cd6fa42c2f5bf1a116ae7dde451755f2764333 |