diff --git a/README.md b/README.md index e13b79c..5d00592 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,7 @@ All commands are run from the root of the project, from a terminal: | Command | Action | | ----------------------------------------------- | --------------------------------------------- | +| `uv run jupyter lab` | Run Jupyter lab with current package state | | `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 | @@ -112,6 +113,7 @@ Releases are managed via the GitHub UI. [Draft a new release](https://github.com/higlass/higlass-python/releases/new): 1. **Create a tag** + - Click _"Choose a tag"_, then **type a new tag** in the format `v[major].[minor].[patch]` to create it. - _Note_: The UI is not obvious about this. You can create a tag here, not @@ -119,6 +121,7 @@ Releases are managed via the GitHub UI. [workflow](.github/workflows/ci.yml) to publish to PyPI. 2. **Generate release notes** + - Click _"Generate Release Notes"_ to auto-summarize changes from merged PRs. - Edit to exclude irrelevant changes for end users (e.g., docs or CI). diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 188b448..6fed4b5 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -285,6 +285,28 @@ Tracks may be combined with the ``hg.combine()`` utility: hg.view((combined_track, "top")).domain(x=[0, 1e9]) +Chromosome grid on a heatmap +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. code-block:: python + + import higlass as hg + + cs_ts = hg.chromsizes('chromSizes_hg19_reordered.tsv') + cool_ts = hg.cooler("Dixon2012-J1-NcoI-R1-filtered.100kb.multires.cool") + + hg.view( + (hg.combine( + cool_ts.track(options={"name": "blah"}), + cs_ts.track('2d-chromosome-grid'), + position='center'), 'center'), + (cs_ts.track('horizontal-chromosome-labels'), 'top'), + (cs_ts.track('horizontal-chromosome-labels'), 'left'), + width=6) + +.. image:: img/chromsizes-overlay.png + :align: center + :width: 250 Multiple Views -------------- diff --git a/docs/higlass_theme/static/higlass.css b/docs/higlass_theme/static/higlass.css index d0f990d..130a283 100644 --- a/docs/higlass_theme/static/higlass.css +++ b/docs/higlass_theme/static/higlass.css @@ -800,3 +800,9 @@ div.document { position: static; } } + +img.align-center { + margin-left: auto; + margin-right: auto; + display: block; +} diff --git a/docs/img/chromsizes-overlay.png b/docs/img/chromsizes-overlay.png new file mode 100644 index 0000000..1e6e08c Binary files /dev/null and b/docs/img/chromsizes-overlay.png differ diff --git a/src/higlass/__init__.py b/src/higlass/__init__.py index 8594b92..c899211 100644 --- a/src/higlass/__init__.py +++ b/src/higlass/__init__.py @@ -35,6 +35,7 @@ bed2ddb, beddb, bigwig, + chromsizes, cooler, hitile, multivec, diff --git a/src/higlass/tilesets.py b/src/higlass/tilesets.py index dd1f5ee..7392cc1 100644 --- a/src/higlass/tilesets.py +++ b/src/higlass/tilesets.py @@ -191,6 +191,14 @@ def load(filepath: str | pathlib.Path) -> ClodiusTileset: return load +def chromsizes(filepath: str) -> ClodiusTileset: + from clodius.tiles.chromsizes import tileset_info + + return ClodiusTileset( + datatype="chromsizes", tiles_impl=None, info_impl=lambda: tileset_info(filepath) + ) + + bed2ddb = create_lazy_clodius_loader("bed2ddb", datatype="2d-rectangle-domains") beddb = create_lazy_clodius_loader("beddb", datatype="vector") bigwig = create_lazy_clodius_loader("bigwig", datatype="vector")