Skip to content

Commit 2819a7a

Browse files
authored
Add doc for chromsizes grid overlay (#187)
1 parent d401e1b commit 2819a7a

File tree

6 files changed

+40
-0
lines changed

6 files changed

+40
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ All commands are run from the root of the project, from a terminal:
8686

8787
| Command | Action |
8888
| ----------------------------------------------- | --------------------------------------------- |
89+
| `uv run jupyter lab` | Run Jupyter lab with current package state |
8990
| `uv run ruff check --fix && uv run ruff format` | Lint and apply formatting |
9091
| `uv run check` | Check linting rules |
9192
| `uv run ruff format --check` | Check formatting |
@@ -112,13 +113,15 @@ Releases are managed via the GitHub UI.
112113
[Draft a new release](https://github.com/higlass/higlass-python/releases/new):
113114

114115
1. **Create a tag**
116+
115117
- Click _"Choose a tag"_, then **type a new tag** in the format
116118
`v[major].[minor].[patch]` to create it.
117119
- _Note_: The UI is not obvious about this. You can create a tag here, not
118120
just select one. Tag creation triggers a
119121
[workflow](.github/workflows/ci.yml) to publish to PyPI.
120122

121123
2. **Generate release notes**
124+
122125
- Click _"Generate Release Notes"_ to auto-summarize changes from merged PRs.
123126
- Edit to exclude irrelevant changes for end users (e.g., docs or CI).
124127

docs/getting_started.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,28 @@ Tracks may be combined with the ``hg.combine()`` utility:
285285
286286
hg.view((combined_track, "top")).domain(x=[0, 1e9])
287287
288+
Chromosome grid on a heatmap
289+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
290+
291+
.. code-block:: python
292+
293+
import higlass as hg
294+
295+
cs_ts = hg.chromsizes('chromSizes_hg19_reordered.tsv')
296+
cool_ts = hg.cooler("Dixon2012-J1-NcoI-R1-filtered.100kb.multires.cool")
297+
298+
hg.view(
299+
(hg.combine(
300+
cool_ts.track(options={"name": "blah"}),
301+
cs_ts.track('2d-chromosome-grid'),
302+
position='center'), 'center'),
303+
(cs_ts.track('horizontal-chromosome-labels'), 'top'),
304+
(cs_ts.track('horizontal-chromosome-labels'), 'left'),
305+
width=6)
306+
307+
.. image:: img/chromsizes-overlay.png
308+
:align: center
309+
:width: 250
288310

289311
Multiple Views
290312
--------------

docs/higlass_theme/static/higlass.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,3 +800,9 @@ div.document {
800800
position: static;
801801
}
802802
}
803+
804+
img.align-center {
805+
margin-left: auto;
806+
margin-right: auto;
807+
display: block;
808+
}

docs/img/chromsizes-overlay.png

136 KB
Loading

src/higlass/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
bed2ddb,
3636
beddb,
3737
bigwig,
38+
chromsizes,
3839
cooler,
3940
hitile,
4041
multivec,

src/higlass/tilesets.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,14 @@ def load(filepath: str | pathlib.Path) -> ClodiusTileset:
191191
return load
192192

193193

194+
def chromsizes(filepath: str) -> ClodiusTileset:
195+
from clodius.tiles.chromsizes import tileset_info
196+
197+
return ClodiusTileset(
198+
datatype="chromsizes", tiles_impl=None, info_impl=lambda: tileset_info(filepath)
199+
)
200+
201+
194202
bed2ddb = create_lazy_clodius_loader("bed2ddb", datatype="2d-rectangle-domains")
195203
beddb = create_lazy_clodius_loader("beddb", datatype="vector")
196204
bigwig = create_lazy_clodius_loader("bigwig", datatype="vector")

0 commit comments

Comments
 (0)