Skip to main content

Python bindings for HiGlass

Project description

higlass-python 🔎

A fresh Python library for higlass built on top of:

License Open In Colab

Installation

pip install higlass-python

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)

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

To learn more about the new API, check out the updated documentation.

Upgrade Guide

higlass-python v1.0 is a total rewrite of our prior implementation, aimed to offer a more ergonomic and flexible API. While this might present challenges when upgrading existing code, we've prepared documentation to guide you through the new API usage.

If you find a missing feature, please open an issue – we're committed to supporting your use cases with the new API.

Despite the large changes in v1.0, we will strive to avoid breaking changes going forward. However, because of the complete rewrite, the v1.0 release doesn't strictly adhere to semantic versioning. You can think of it as a pre-1.0 release, with breaking changes and new features included in minor releases, and bug fixes in patch releases.

We will aim for strict semantic versioning with the v2.0 release. Your feedback and understanding are greatly appreciated.

Development

higlass-python uses uses uv for development.

Commands Cheatsheet

All commands are run from the root of the project, from a terminal:

Command Action
uv run ruff check --fix && uv run ruff format Lint and apply formatting
uv run check Check linting rules
uv run ruff format --check Check formatting
uv run pytest Run unit tests
uv run docs/build.py Build the documentation in docs/_build/html

This table now includes only the UV-related commands, with each command in the left column and its corresponding action in the right column. The formatting is clean and easy to read.

Our CI enforces formatting, linting, and tests.

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

higlass_python-1.1.2.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

higlass_python-1.1.2-py2.py3-none-any.whl (21.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file higlass_python-1.1.2.tar.gz.

File metadata

  • Download URL: higlass_python-1.1.2.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for higlass_python-1.1.2.tar.gz
Algorithm Hash digest
SHA256 c3cd9e85792a858a2ef44afca45c24bfc73cefa1c69d046cde15750b76796a29
MD5 23b5706e4f79935934b7989096222760
BLAKE2b-256 42bb45daae00f8a4d25e28b8d4bacf15ff3304d4921bb391d248e385ceb91b1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for higlass_python-1.1.2.tar.gz:

Publisher: ci.yml on higlass/higlass-python

Attestations:

File details

Details for the file higlass_python-1.1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for higlass_python-1.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2238eaa48680bc47066d18f6f6d1cc467733881bdc0c9e6ada6588f1f793e865
MD5 7880c291550a083fde5b3f764e98cbe9
BLAKE2b-256 4be2cc6f027ed486096c2e95c127d94188678d1e0662e3b8c842ec24f9cba065

See more details on using hashes here.

Provenance

The following attestation bundles were made for higlass_python-1.1.2-py2.py3-none-any.whl:

Publisher: ci.yml on higlass/higlass-python

Attestations:

Supported by

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