Skip to Content
NotebooksHiglass

Higlass

The <NotebookRenderer /> component reads a .ipynb file from public/ and renders it as a static, read-only Jupyter-style document. Code is highlighted with shiki , markdown cells are rendered with react-markdown, and outputs (stdout, dataframes, plots, errors) are shown inline.

Usage

content/my-page.mdx
import { NotebookRenderer } from '@/components/notebook/NotebookRenderer' <NotebookRenderer src="/higlass_ipython.ipynb" />

Live example

Below is public/higlass_ipython.ipynb rendered with the component:

python/higlass_ipython.ipynb
In [ ]
python
%load_ext autoreload
%autoreload 2
In [ ]
javascript
%%javascript
require(["https://unpkg.com/higlass-arcs/dist/higlass-arcs.min.js"],
    function(hglib) {
        // Plugin registered
    }
);
<IPython.core.display.Javascript object>
In [ ]
python
!pip install --pre higlass-python
Collecting higlass-python
  Downloading higlass_python-1.4.0-py3-none-any.whl.metadata (5.9 kB)
Requirement already satisfied: anywidget>=0.9.0 in /usr/local/lib/python3.12/dist-packages (from higlass-python) (0.9.21)
Collecting higlass-schema>=0.2.0 (from higlass-python)
  Downloading higlass_schema-0.2.1-py3-none-any.whl.metadata (1.2 kB)
Requirement already satisfied: ipywidgets>=7.6.0 in /usr/local/lib/python3.12/dist-packages (from anywidget>=0.9.0->higlass-python) (7.7.1)
Requirement already satisfied: psygnal>=0.8.1 in /usr/local/lib/python3.12/dist-packages (from anywidget>=0.9.0->higlass-python) (0.15.1)
Requirement already satisfied: typing-extensions>=4.2.0 in /usr/local/lib/python3.12/dist-packages (from anywidget>=0.9.0->higlass-python) (4.15.0)
Requirement already satisfied: pydantic>=2.0 in /usr/local/lib/python3.12/dist-packages (from higlass-schema>=0.2.0->higlass-python) (2.12.3)
Requirement already satisfied: rich>=13.0.0 in /usr/local/lib/python3.12/dist-packages (from higlass-schema>=0.2.0->higlass-python) (13.9.4)
Requirement already satisfied: ipykernel>=4.5.1 in /usr/local/lib/python3.12/dist-packages (from ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (6.17.1)
Requirement already satisfied: ipython-genutils~=0.2.0 in /usr/local/lib/python3.12/dist-packages (from ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.2.0)
Requirement already satisfied: traitlets>=4.3.1 in /usr/local/lib/python3.12/dist-packages (from ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (5.7.1)
Requirement already satisfied: widgetsnbextension~=3.6.0 in /usr/local/lib/python3.12/dist-packages (from ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (3.6.10)
Requirement already satisfied: ipython>=4.0.0 in /usr/local/lib/python3.12/dist-packages (from ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (7.34.0)
Requirement already satisfied: jupyterlab-widgets>=1.0.0 in /usr/local/lib/python3.12/dist-packages (from ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (3.0.16)
Requirement already satisfied: annotated-types>=0.6.0 in /usr/local/lib/python3.12/dist-packages (from pydantic>=2.0->higlass-schema>=0.2.0->higlass-python) (0.7.0)
Requirement already satisfied: pydantic-core==2.41.4 in /usr/local/lib/python3.12/dist-packages (from pydantic>=2.0->higlass-schema>=0.2.0->higlass-python) (2.41.4)
Requirement already satisfied: typing-inspection>=0.4.2 in /usr/local/lib/python3.12/dist-packages (from pydantic>=2.0->higlass-schema>=0.2.0->higlass-python) (0.4.2)
Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/lib/python3.12/dist-packages (from rich>=13.0.0->higlass-schema>=0.2.0->higlass-python) (4.0.0)
Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/lib/python3.12/dist-packages (from rich>=13.0.0->higlass-schema>=0.2.0->higlass-python) (2.19.2)
Requirement already satisfied: debugpy>=1.0 in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (1.8.15)
Requirement already satisfied: jupyter-client>=6.1.12 in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (7.4.9)
Requirement already satisfied: matplotlib-inline>=0.1 in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.2.1)
Requirement already satisfied: nest-asyncio in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (1.6.0)
Requirement already satisfied: packaging in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (26.0)
Requirement already satisfied: psutil in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (5.9.5)
Requirement already satisfied: pyzmq>=17 in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (26.2.1)
Requirement already satisfied: tornado>=6.1 in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (6.5.1)
Requirement already satisfied: setuptools>=18.5 in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (75.2.0)
Collecting jedi>=0.16 (from ipython>=4.0.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python)
  Downloading jedi-0.19.2-py2.py3-none-any.whl.metadata (22 kB)
Requirement already satisfied: decorator in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (4.4.2)
Requirement already satisfied: pickleshare in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.7.5)
Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (3.0.52)
Requirement already satisfied: backcall in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.2.0)
Requirement already satisfied: pexpect>4.3 in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (4.9.0)
Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.12/dist-packages (from markdown-it-py>=2.2.0->rich>=13.0.0->higlass-schema>=0.2.0->higlass-python) (0.1.2)
Requirement already satisfied: notebook>=4.4.1 in /usr/local/lib/python3.12/dist-packages (from widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (6.5.7)
Requirement already satisfied: parso<0.9.0,>=0.8.4 in /usr/local/lib/python3.12/dist-packages (from jedi>=0.16->ipython>=4.0.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.8.6)
Requirement already satisfied: entrypoints in /usr/local/lib/python3.12/dist-packages (from jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.4)
Requirement already satisfied: jupyter-core>=4.9.2 in /usr/local/lib/python3.12/dist-packages (from jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (5.9.1)
Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.12/dist-packages (from jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (2.9.0.post0)
Requirement already satisfied: jinja2 in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (3.1.6)
Requirement already satisfied: argon2-cffi in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (25.1.0)
Requirement already satisfied: nbformat in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (5.10.4)
Requirement already satisfied: nbconvert>=5 in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (7.17.0)
Requirement already satisfied: Send2Trash>=1.8.0 in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (2.1.0)
Requirement already satisfied: terminado>=0.8.3 in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.18.1)
Requirement already satisfied: prometheus-client in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.24.1)
Requirement already satisfied: nbclassic>=0.4.7 in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (1.3.3)
Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.12/dist-packages (from pexpect>4.3->ipython>=4.0.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.7.0)
Requirement already satisfied: wcwidth in /usr/local/lib/python3.12/dist-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython>=4.0.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.6.0)
Requirement already satisfied: platformdirs>=2.5 in /usr/local/lib/python3.12/dist-packages (from jupyter-core>=4.9.2->jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (4.9.4)
Requirement already satisfied: notebook-shim>=0.2.3 in /usr/local/lib/python3.12/dist-packages (from nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.2.4)
Requirement already satisfied: beautifulsoup4 in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (4.13.5)
Requirement already satisfied: bleach!=5.0.0 in /usr/local/lib/python3.12/dist-packages (from bleach[css]!=5.0.0->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (6.3.0)
Requirement already satisfied: defusedxml in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.7.1)
Requirement already satisfied: jupyterlab-pygments in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.3.0)
Requirement already satisfied: markupsafe>=2.0 in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (3.0.3)
Requirement already satisfied: mistune<4,>=2.0.3 in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (3.2.0)
Requirement already satisfied: nbclient>=0.5.0 in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.10.4)
Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (1.5.1)
Requirement already satisfied: fastjsonschema>=2.15 in /usr/local/lib/python3.12/dist-packages (from nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (2.21.2)
Requirement already satisfied: jsonschema>=2.6 in /usr/local/lib/python3.12/dist-packages (from nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (4.26.0)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.12/dist-packages (from python-dateutil>=2.8.2->jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (1.17.0)
Requirement already satisfied: argon2-cffi-bindings in /usr/local/lib/python3.12/dist-packages (from argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (25.1.0)
Requirement already satisfied: webencodings in /usr/local/lib/python3.12/dist-packages (from bleach!=5.0.0->bleach[css]!=5.0.0->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.5.1)
Requirement already satisfied: tinycss2<1.5,>=1.1.0 in /usr/local/lib/python3.12/dist-packages (from bleach[css]!=5.0.0->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (1.4.0)
Requirement already satisfied: attrs>=22.2.0 in /usr/local/lib/python3.12/dist-packages (from jsonschema>=2.6->nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (25.4.0)
Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /usr/local/lib/python3.12/dist-packages (from jsonschema>=2.6->nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (2025.9.1)
Requirement already satisfied: referencing>=0.28.4 in /usr/local/lib/python3.12/dist-packages (from jsonschema>=2.6->nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.37.0)
Requirement already satisfied: rpds-py>=0.25.0 in /usr/local/lib/python3.12/dist-packages (from jsonschema>=2.6->nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.30.0)
Requirement already satisfied: jupyter-server<3,>=1.8 in /usr/local/lib/python3.12/dist-packages (from notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (2.14.0)
Requirement already satisfied: cffi>=1.0.1 in /usr/local/lib/python3.12/dist-packages (from argon2-cffi-bindings->argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (2.0.0)
Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.12/dist-packages (from beautifulsoup4->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (2.8.3)
Requirement already satisfied: pycparser in /usr/local/lib/python3.12/dist-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (3.0)
Requirement already satisfied: anyio>=3.1.0 in /usr/local/lib/python3.12/dist-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (4.12.1)
Requirement already satisfied: jupyter-events>=0.9.0 in /usr/local/lib/python3.12/dist-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.12.0)
Requirement already satisfied: jupyter-server-terminals>=0.4.4 in /usr/local/lib/python3.12/dist-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.5.4)
Requirement already satisfied: overrides>=5.0 in /usr/local/lib/python3.12/dist-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (7.7.0)
Requirement already satisfied: websocket-client>=1.7 in /usr/local/lib/python3.12/dist-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (1.9.0)
Requirement already satisfied: idna>=2.8 in /usr/local/lib/python3.12/dist-packages (from anyio>=3.1.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (3.11)
Requirement already satisfied: python-json-logger>=2.0.4 in /usr/local/lib/python3.12/dist-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (4.0.0)
Requirement already satisfied: pyyaml>=5.3 in /usr/local/lib/python3.12/dist-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (6.0.3)
Requirement already satisfied: rfc3339-validator in /usr/local/lib/python3.12/dist-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.1.4)
Requirement already satisfied: rfc3986-validator>=0.1.1 in /usr/local/lib/python3.12/dist-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (0.1.1)
Requirement already satisfied: fqdn in /usr/local/lib/python3.12/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (1.5.1)
Requirement already satisfied: isoduration in /usr/local/lib/python3.12/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (20.11.0)
Requirement already satisfied: jsonpointer>1.13 in /usr/local/lib/python3.12/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (3.0.0)
Requirement already satisfied: rfc3987-syntax>=1.1.0 in /usr/local/lib/python3.12/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (1.1.0)
Requirement already satisfied: uri-template in /usr/local/lib/python3.12/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (1.3.0)
Requirement already satisfied: webcolors>=24.6.0 in /usr/local/lib/python3.12/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (25.10.0)
Requirement already satisfied: lark>=1.2.2 in /usr/local/lib/python3.12/dist-packages (from rfc3987-syntax>=1.1.0->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (1.3.1)
Requirement already satisfied: arrow>=0.15.0 in /usr/local/lib/python3.12/dist-packages (from isoduration->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (1.4.0)
Requirement already satisfied: tzdata in /usr/local/lib/python3.12/dist-packages (from arrow>=0.15.0->isoduration->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.0->anywidget>=0.9.0->higlass-python) (2025.3)
Downloading higlass_python-1.4.0-py3-none-any.whl (24 kB)
Downloading higlass_schema-0.2.1-py3-none-any.whl (8.7 kB)
Downloading jedi-0.19.2-py2.py3-none-any.whl (1.6 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 9.0 MB/s eta 0:00:00
[?25hInstalling collected packages: jedi, higlass-schema, higlass-python
Successfully installed higlass-python-1.4.0 higlass-schema-0.2.1 jedi-0.19.2
4MD

Synced heatmaps

In [ ]
python
import higlass as hg

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

tileset2 = hg.remote(
    uid="QvdMEvccQuOxKTEjrVL3wA",
    server="https://higlass.io/api/v1/",
    name="Rao et al. (2014) K562 MboI (allreps) 1kb",
)

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

# Create two independent Views, 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 side-by-side, and apply synchronization lock
(view1 | view2).locks(view_lock)
Loading HiGlass viewer…
In [ ]
python
# Lock zoom only for each view
(view1 | view2).locks(zoom=view_lock)
Loading HiGlass viewer…
In [ ]
python
# Lock location only for each view
(view1 | view2).locks(location=view_lock)
Loading HiGlass viewer…
In [ ]
python
# Create additional views and synchronize (apply black to white color range)

bw_color_range = ["rgba(255,255,255,1)", "rgba(0,0,0,1)"]
view3 = hg.view(track1.opts(colorRange=bw_color_range), width=6)
view4 = hg.view(track2.opts(colorRange=bw_color_range), width=6)

# Create stacked view configuration and lock views by column
((view1 / view2) | (view3 / view4)).locks(
    hg.lock(view1, view2),
    hg.lock(view3, view4),
)
Loading HiGlass viewer…
9MD

Value scale syncing

In [ ]
python
# Create Tracks

# creates a hg.Track without a tileset
t1 = hg.track("top-axis")

# Creates a hg.RemoteTileset object
remote_tileset = hg.remote(
    uid="CQMd6V_cRw6iCI_-Unl3PQ",
    server="https://higlass.io/api/v1/",  # optional, "http://higlass.io/api/v1/"
    name="Rao et al. (2014) GM12878 MboI (allreps) 1kb",
)

# Tileset.track() creates a hg.Track object binding the parent Tileset
t2 = remote_tileset.track("heatmap").opts(valueScaleMax=0.5)

# Create Views

# Positional arguments for `hg.view` are overloaded. Keyword arguments are
# forwarded to the creation of the `hg.View`. Layout fields (`x`, `y`,
# `width`, `height`) may also be assigned.

# (1) Track objects (positioning guessed based on track type)
view1 = hg.view(t1, t2, width=6)

# (2) (Track, position) tuple
view2 = hg.view((t1, "top"), t2, width=6)

# (3) hg.Tracks object
view3 = hg.view(hg.Tracks(top=[t1], center=[t2]), width=6)

# (View, Track) tuples -> ScaleValueLock
scale_value_lock = hg.lock((view1, t2), (view2, t2))

(view1 | view2).locks(scale_value_lock)
Loading HiGlass viewer…
11MD

Remote heatmaps

In [ ]
python
# Initialize data sources
tset1 = hg.remote(
    uid="CQMd6V_cRw6iCI_-Unl3PQ",
    name="Rao et al. (2014) GM12878 MboI (allreps) 1kb",
)

tset2 = hg.remote(
    uid="QvdMEvccQuOxKTEjrVL3wA",
    name="Rao et al. (2014) K562 MboI (allreps) 1kb",
)

# Create a track for each data source
t1 = tset1.track("heatmap", height=300)
t2 = tset2.track("heatmap", height=300)

# Create a custom DividedTrack and modify color scale
t3 = hg.divide(t1, t2).opts(
    colorRange=["blue", "white"],
    valueScaleMin=0.1,
    valueScaleMax=10,
)

# Set initial view domains
domain = (7e7, 8e7)
v1 = hg.view(t1, width=4).domain(x=domain)
v2 = hg.view(t2, width=4).domain(x=domain)
v3 = hg.view(t3, width=4).domain(x=domain)

(v1 | v3 | v2).locks(hg.lock(v1, v2, v3))
Loading HiGlass viewer…
13MD

Extract track from another view config

In [ ]
python
# Load view config from URL
url = "https://gist.githubusercontent.com/manzt/c2c498dac3ca9804a2b8e4bc1af3b55b/raw/ee8426c9728e875b6f4d65030c61181c6ba29b53/example.json"
config = hg.Viewconf.from_url(url)

# Display viewconfig
config
Loading HiGlass viewer…
In [ ]
python
# Inspect the Viewconf tracks
for position, track in config.views[0].tracks:
    print(position)  # position in view layout
    print(track)  # python object from `higlass-schema`
left
tilesetUid='OHJakQICQD6gTD7skx4EWA' server='//higlass.io/api/v1' type='vertical-gene-annotations' uid='dqBTMH78Rn6DeSyDBoAEXw' width=60 height=None options={'labelPosition': 'bottomRight', 'name': 'Gene Annotations (hg19)', 'fontSize': 10, 'labelColor': 'black', 'labelBackgroundColor': '#ffffff', 'labelLeftMargin': 0, 'labelRightMargin': 0, 'labelTopMargin': 0, 'labelBottomMargin': 0, 'minHeight': 24, 'plusStrandColor': 'blue', 'minusStrandColor': 'red', 'trackBorderWidth': 0, 'trackBorderColor': 'black', 'showMousePosition': False, 'mousePositionColor': '#000000', 'geneAnnotationHeight': 16, 'geneLabelPosition': 'outside', 'geneStrandSpacing': 4} data=None chromInfoPath=None fromViewUid=None x=None y=None
left
tilesetUid=None server=None type='vertical-chromosome-labels' uid='RHdQK4IRQ7yJeDmKWb7Pcg' width=30 height=None options={'color': '#808080', 'stroke': '#ffffff', 'fontSize': 12, 'fontIsLeftAligned': False, 'showMousePosition': False, 'mousePositionColor': '#000000', 'reverseOrientation': False} data=None chromInfoPath='//s3.amazonaws.com/pkerp/data/hg19/chromSizes.tsv' fromViewUid=None x=None y=None
top
tilesetUid='OHJakQICQD6gTD7skx4EWA' server='//higlass.io/api/v1' type='horizontal-gene-annotations' uid='OHJakQICQD6gTD7skx4EWA' width=None height=60 options={'name': 'Gene Annotations (hg19)', 'fontSize': 10, 'labelColor': 'black', 'labelBackgroundColor': '#ffffff', 'labelPosition': 'hidden', 'labelLeftMargin': 0, 'labelRightMargin': 0, 'labelTopMargin': 0, 'labelBottomMargin': 0, 'minHeight': 24, 'plusStrandColor': 'blue', 'minusStrandColor': 'red', 'trackBorderWidth': 0, 'trackBorderColor': 'black', 'showMousePosition': False, 'mousePositionColor': '#000000', 'geneAnnotationHeight': 16, 'geneLabelPosition': 'outside', 'geneStrandSpacing': 4} data=None chromInfoPath=None fromViewUid=None x=None y=None
top
tilesetUid=None server=None type='horizontal-chromosome-labels' uid='X4e_1DKiQHmyghDa6lLMVA' width=None height=30 options={'color': '#808080', 'stroke': '#ffffff', 'fontSize': 12, 'fontIsLeftAligned': False, 'showMousePosition': False, 'mousePositionColor': '#000000', 'reverseOrientation': False} data=None chromInfoPath='//s3.amazonaws.com/pkerp/data/hg19/chromSizes.tsv' fromViewUid=None x=None y=None
center
type='combined' uid='c1' width=None height=200 options={} contents=[HeatmapTrack(tilesetUid='CQMd6V_cRw6iCI_-Unl3PQ', server='//higlass.io/api/v1', type='heatmap', uid='GjuZed1ySGW1IzZZqFB9BA', width=None, height=None, options={'maxZoom': None, 'labelPosition': 'bottomRight', 'name': 'Rao et al. (2014) GM12878 MboI (allreps) 1kb', 'backgroundColor': '#eeeeee', 'labelLeftMargin': 0, 'labelRightMargin': 0, 'labelTopMargin': 0, 'labelBottomMargin': 0, 'labelShowResolution': True, 'labelShowAssembly': True, 'colorRange': ['white', 'rgba(245,166,35,1.0)', 'rgba(208,2,27,1.0)', 'black'], 'colorbarBackgroundColor': '#ffffff', 'minWidth': 100, 'minHeight': 100, 'colorbarPosition': 'topRight', 'trackBorderWidth': 0, 'trackBorderColor': 'black', 'heatmapValueScaling': 'log', 'showMousePosition': False, 'mousePositionColor': '#000000', 'showTooltip': False, 'extent': 'full', 'zeroValueColor': None, 'scaleStartPercent': '0.00000', 'scaleEndPercent': '1.00000'}, data=None, position=None, transforms=[{'name': 'ICE', 'value': 'weight'}])] position=None
In [ ]
python
# Extract a specific track from the above Viewconf and modify its properties
gene_annotation_track = config.views[0].tracks.top[0].properties(height=200)

# Display track in isolation
hg.view(gene_annotation_track)
Loading HiGlass viewer…
17MD

Local bigWig files

In [ ]
python
!wget http://hgdownload.cse.ucsc.edu/goldenpath/hg19/encodeDCC/wgEncodeSydhTfbs/wgEncodeSydhTfbsGm12878InputStdSig.bigWig
--2026-03-08 18:56:25--  http://hgdownload.cse.ucsc.edu/goldenpath/hg19/encodeDCC/wgEncodeSydhTfbs/wgEncodeSydhTfbsGm12878InputStdSig.bigWig
Resolving hgdownload.cse.ucsc.edu (hgdownload.cse.ucsc.edu)... 128.114.119.163
Connecting to hgdownload.cse.ucsc.edu (hgdownload.cse.ucsc.edu)|128.114.119.163|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 302716075 (289M)
Saving to: ‘wgEncodeSydhTfbsGm12878InputStdSig.bigWig’

wgEncodeSydhTfbsGm1 100%[===================>] 288.69M  45.9MB/s    in 7.0s    

2026-03-08 18:56:33 (41.4 MB/s) - ‘wgEncodeSydhTfbsGm12878InputStdSig.bigWig’ saved [302716075/302716075]

In [ ]
python
tileset = hg.bigwig("wgEncodeSydhTfbsGm12878InputStdSig.bigWig")
hg.view(tileset.track("horizontal-bar"))
ImportError: You must have `clodius` installed to use `hg.bigwig`.
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
/usr/local/lib/python3.12/dist-packages/higlass/tilesets.py in load(filepath)
    178         try:
--> 179             module = __import__(
    180                 f"clodius.tiles.{kind}", fromlist=["tiles", "tileset_info"]

ModuleNotFoundError: No module named 'clodius'

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
/tmp/ipykernel_166/265301860.py in <cell line: 0>()
----> 1 tileset = hg.bigwig("wgEncodeSydhTfbsGm12878InputStdSig.bigWig")
      2 hg.view(tileset.track("horizontal-bar"))

/usr/local/lib/python3.12/dist-packages/higlass/tilesets.py in load(filepath)
    181             )
    182         except (ImportError, AttributeError):
--> 183             raise ImportError(f"You must have `clodius` installed to use `hg.{kind}`.")
    184 
    185         return ClodiusTileset(

ImportError: You must have `clodius` installed to use `hg.bigwig`.

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------
20MD

Local cooler files

This section describes how to load cooler files that are on the same filesystem as the Jupyter notebook.

In [ ]
python
tileset = hg.cooler("../test/data/Dixon2012-J1-NcoI-R1-filtered.100kb.multires.cool")
hg.view(tileset.track("heatmap"))
ImportError: You must have `clodius` installed to use `hg.cooler`.
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
/usr/local/lib/python3.12/dist-packages/higlass/tilesets.py in load(filepath)
    178         try:
--> 179             module = __import__(
    180                 f"clodius.tiles.{kind}", fromlist=["tiles", "tileset_info"]

ModuleNotFoundError: No module named 'clodius'

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
/tmp/ipykernel_166/3026692895.py in <cell line: 0>()
----> 1 tileset = hg.cooler("../test/data/Dixon2012-J1-NcoI-R1-filtered.100kb.multires.cool")
      2 hg.view(tileset.track("heatmap"))

/usr/local/lib/python3.12/dist-packages/higlass/tilesets.py in load(filepath)
    181             )
    182         except (ImportError, AttributeError):
--> 183             raise ImportError(f"You must have `clodius` installed to use `hg.{kind}`.")
    184 
    185         return ClodiusTileset(

ImportError: You must have `clodius` installed to use `hg.cooler`.

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------
In [ ]
python
<IPython.core.display.Javascript object>
In [ ]
javascript
%%javascript
require(["https://unpkg.com/higlass-arcs/dist/higlass-arcs.min.js"], function() {
    console.log("higlass-arcs plugin loaded");
});


import higlass as hg

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

tileset2 = hg.remote(
    uid="QvdMEvccQuOxKTEjrVL3wA",
    server="https://higlass.io/api/v1/",
    name="Rao et al. (2014) K562 MboI (allreps) 1kb",
)

# Your arc data tileset (bedpe-style, e.g. from a .beddb file)
arcs_tileset = hg.remote(
    uid="YOUR_ARCS_TILESET_UID",
    server="https://higlass.io/api/v1/",
    name="My Arcs",
)

track1 = tileset1.track("heatmap")
track2 = tileset2.track("heatmap")

# Add arcs track — type "1d-arcs" is registered by higlass-arcs plugin
arcs_track = arcs_tileset.track("1d-arcs")

view1 = hg.view(track1, arcs_track, width=6)
view2 = hg.view(track2, width=6)

view_lock = hg.lock(view1, view2)
(view1 | view2).locks(view_lock)
<IPython.core.display.Javascript object>
In [ ]
python
view_lock = hg.lock(view1, view2)
(view1 | view2).locks(view_lock)
Loading HiGlass viewer…
In [ ]
python
# Location: chr4:190,998,876-191,000,255
from typing import ClassVar, Literal
import higlass as hg

# Define the plugin track class — this is the correct pattern
class ArcsTrack(hg.PluginTrack):
    type: Literal["1d-arcs"]
    plugin_url: ClassVar[str] = (
        "https://unpkg.com/higlass-arcs/dist/higlass-arcs.min.js"
    )

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

tileset2 = hg.remote(
    uid="QvdMEvccQuOxKTEjrVL3wA",
    server="https://higlass.io/api/v1/",
    name="Rao et al. (2014) K562 MboI (allreps) 1kb",
)

# Create heatmap tracks
track1 = tileset1.track("heatmap")
track2 = tileset2.track("heatmap")

# Create the arcs track using the plugin class directly
arcs_track = ArcsTrack(
    type="1d-arcs",
    tilesetUid="JzccFAJUQEiz-0188xaWZg",
    server="https://resgen.io/api/v1",
    height=80,
    options={
        "labelPosition": "topLeft",
        "strokeColor": "green",
        "strokeWidth": 1.5,
        "strokeOpacity": 0.33,
        "arcStyle": "circle",
        "flip1D": "yes",
        "name": "Neuron PLAC-seq",
    },
)

# Build views — pass arcs_track with explicit position "top"
view1 = hg.view(
    (track1, "center"),
    (arcs_track, "top"),
    width=6,
)
view2 = hg.view(track2, width=6)

# Lock zoom & location
view_lock = hg.lock(view1, view2)

# Render side-by-side
(view1 | view2).locks(view_lock)
AttributeError: 'Viewconf' object has no attribute 'viewconf'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/tmp/ipykernel_1196/4189411242.py in <cell line: 0>()
     73 
     74 # Render
---> 75 (view1 | view2).locks(view_lock).viewconf(
     76     trackSourceServers=[
     77         "//higlass.io/api/v1",

/usr/local/lib/python3.12/dist-packages/pydantic/main.py in __getattr__(self, item)
   1024                     else:
   1025                         # this is the current error
-> 1026                         raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}')
   1027 
   1028         def __setattr__(self, name: str, value: Any) -> None:

AttributeError: 'Viewconf' object has no attribute 'viewconf'
In [ ]
python
from typing import ClassVar, Literal
import higlass as hg

class ArcsTrack(hg.PluginTrack):
    type: Literal["1d-arcs"]
    plugin_url: ClassVar[str] = (
        "https://unpkg.com/higlass-arcs/dist/higlass-arcs.min.js"
    )

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

tileset2 = hg.remote(
    uid="QvdMEvccQuOxKTEjrVL3wA",
    server="https://higlass.io/api/v1/",
    name="Rao et al. (2014) K562 MboI (allreps) 1kb",
)

# ✅ hg19 chromosome sizes tileset — required for the search box
chrom_sizes = hg.remote(
    uid="ADfY_RtsQR6oKOMyrq6qhw",
    server="https://resgen.io/api/v1",
    name="hg19 chrom sizes",
)

track1 = tileset1.track("heatmap")
track2 = tileset2.track("heatmap")

# ✅ Chromosome labels track — this is what the search box anchors to
chrom_track = chrom_sizes.track("horizontal-chromosome-labels")

arcs_track = ArcsTrack(
    type="1d-arcs",
    tilesetUid="JzccFAJUQEiz-0188xaWZg",
    server="https://resgen.io/api/v1",
    height=80,
    options={
        "labelPosition": "topLeft",
        "strokeColor": "green",
        "strokeWidth": 1.5,
        "strokeOpacity": 0.33,
        "arcStyle": "circle",
        "flip1D": "yes",
        "name": "Neuron PLAC-seq",
    },
)

search_box = hg.GenomePositionSearchBox(
    autocompleteServer="//higlass.io/api/v1",
    autocompleteId="OHJakQICQD6gTD7skx4EWA",   # hg19 gene annotations
    chromInfoServer="//higlass.io/api/v1",
    chromInfoId="hg19",
    visible=True,
)

# ✅ Add chrom_track to both views at "top"
view1 = hg.view(
    (track1, "center"),
    (arcs_track, "top"),
    (chrom_track, "top"),       # <-- required
    width=6,
    genomePositionSearchBox=search_box,
)

view2 = hg.view(
    (track2, "center"),
    (chrom_sizes.track("horizontal-chromosome-labels"), "top"),  # <-- required
    width=6,
    genomePositionSearchBox=search_box,
)

view_lock = hg.lock(view1, view2)

vc = (view1 | view2).locks(view_lock)
vc = vc.model_copy(update={
    "trackSourceServers": [
        "//higlass.io/api/v1",
        "https://resgen.io/api/v1",
    ]
})

vc
Loading HiGlass viewer…
In [ ]
python
# GM12878 HiCCUPS loops (hg19) — use https not ftp
!wget "https://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE63525&format=file&file=GSE63525_GM12878_primary%2Breplicate_HiCCUPS_looplist.txt.gz" \
     -O GSE63525_GM12878_loops.txt.gz

# Decompress
!gunzip GSE63525_GM12878_loops.txt.gz

# Preview the format (first 3 lines)
!head -3 GSE63525_GM12878_loops.txt
--2026-03-08 19:15:12--  https://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE63525&format=file&file=GSE63525_GM12878_primary%2Breplicate_HiCCUPS_looplist.txt.gz
Resolving www.ncbi.nlm.nih.gov (www.ncbi.nlm.nih.gov)... 130.14.29.110, 2607:f220:41e:4290::110
Connecting to www.ncbi.nlm.nih.gov (www.ncbi.nlm.nih.gov)|130.14.29.110|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 674624 (659K) [application/octet-stream]
Saving to: ‘GSE63525_GM12878_loops.txt.gz’


          GSE63525_   0%[                    ]       0  --.-KB/s               
GSE63525_GM12878_lo 100%[===================>] 658.81K  --.-KB/s    in 0.07s   

2026-03-08 19:15:12 (9.33 MB/s) - ‘GSE63525_GM12878_loops.txt.gz’ saved [674624/674624]

chr1	x1	x2	chr2	y1	y2	color	o	e_bl	e_donut	e_h	e_v	fdr_bl	fdr_donut	fdr_h	fdr_v	num_collapsed	centroid1	centroid2	radius
10	100225000	100230000	10	100420000	100425000	0,255,255	95	27.4926	25.533	31.2977	32.8853	1.19563917441e-15	9.93567880311e-16	3.82998212108e-10	4.0995892129e-10	10	100228000	100426000	10606.6017178
10	100225000	100230000	10	101005000	101010000	0,255,255	56	14.6209	14.1223	19.5321	14.2999	5.73812113072e-11	7.8893030998e-11	2.48826282338e-07	8.19419926968e-11	5	100226500	101007500	6403.12423743
In [ ]
python
!clodius aggregate bedpe \
    --assembly hg19 \
    --chr1-col 1 --from1-col 2 --to1-col 3 \
    --chr2-col 4 --from2-col 5 --to2-col 6 \
    --has-header \
    --output-file GM12878_loops.beddb \
    GSE63525_GM12878_loops.txt
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/dist-packages/clodius/cli/aggregate.py", line 233, in line_to_dict
    chrom1_offset = chrom_info.cum_chrom_lengths[chrom1]
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: '10'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/clodius", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1485, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1406, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1873, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1873, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1269, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/clodius/cli/aggregate.py", line 1661, in bedpe
    _bedpe(
  File "/usr/local/lib/python3.12/dist-packages/clodius/cli/aggregate.py", line 298, in _bedpe
    entries += [line_to_dict(line) for line in [line.strip() for line in f] if line]
                ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/clodius/cli/aggregate.py", line 254, in line_to_dict
    raise (KeyError(error_str))
KeyError: "ERROR converting chromosome position to genome position. Please make sure you've specified the correct assembly using the --assembly option or a chromsizes file using the . --chromsizes-filename option.Current assembly: hg19, chromosomes: 10,10"
In [ ]
python
# Add "chr" prefix to chromosome columns (skips the header line)
awk 'NR==1{print; next} {$1="chr"$1; $4="chr"$4; print}' OFS='\t' \
    GSE63525_GM12878_loops.txt > GSE63525_GM12878_loops_chr.txt

# Verify it looks right
head -2 GSE63525_GM12878_loops_chr.txt
SyntaxError: invalid syntax (2789273065.py, line 2)
  File "/tmp/ipykernel_1196/2789273065.py", line 2
    awk 'NR==1{print; next} {$1="chr"$1; $4="chr"$4; print}' OFS='\t' \
        ^
SyntaxError: invalid syntax
In [ ]
javascript
%%javascript
require(["https://unpkg.com/higlass-arcs/dist/higlass-arcs.min.js"], function() {
    console.log("higlass-arcs plugin loaded");
});


import higlass as hg
import json

config_dict = {
  "editable": True,
  "views": [
    {
      "uid": "bq8XqbKnSByCds_LNA0KPw",
      "tracks": {
        "top": [
          {
            "type": "top-axis",
            "options": {},
            "uid": "T-h45lNeRsez_jv6rD9izg",
            "server": "http://localhost:50478/api/v1",
            "height": 20
          },
          {
            "type": "horizontal-chromosome-labels",
            "options": {
              "tickPositions": "ends",
              "color": "#808080",
              "stroke": "#ffffff",
              "fontSize": 12,
              "fontIsLeftAligned": False,
              "showMousePosition": False,
              "mousePositionColor": "#000000",
              "reverseOrientation": False
            },
            "tilesetUid": "ADfY_RtsQR6oKOMyrq6qhw",
            "height": 30,
            "width": None,
            "server": "https://resgen.io/api/v1",
            "uid": "LL6t70pOQWWmn9IVmicKSg"
          },
          {
            "type": "horizontal-gene-annotations",
            "options": {
              "fontSize": 10,
              "labelColor": "black",
              "labelBackgroundColor": "#ffffff",
              "labelPosition": "hidden",
              "labelLeftMargin": 0,
              "labelRightMargin": 0,
              "labelTopMargin": 0,
              "labelBottomMargin": 0,
              "minHeight": 24,
              "plusStrandColor": "blue",
              "minusStrandColor": "red",
              "trackBorderWidth": 0,
              "trackBorderColor": "black",
              "showMousePosition": False,
              "mousePositionColor": "#000000",
              "geneAnnotationHeight": 12,
              "geneLabelPosition": "outside",
              "geneStrandSpacing": 4,
              "name": "Gene Annotations (hg19)"
            },
            "tilesetUid": "NCifnbrKQu6j-ohVWJLoJw",
            "height": 55,
            "width": None,
            "server": "https://resgen.io/api/v1",
            "uid": "etN9kTVxTe6jn5O8uZ6Oow"
          },
          {
            "type": "horizontal-bar",
            "options": {
              "barFillColor": "rgb(201, 99, 95)",
              "align": "bottom",
              "labelColor": "[glyph-color]",
              "labelPosition": "topLeft",
              "labelLeftMargin": 0,
              "labelRightMargin": 0,
              "labelTopMargin": 0,
              "labelBottomMargin": 0,
              "labelShowResolution": False,
              "axisLabelFormatting": "scientific",
              "axisPositionHorizontal": "right",
              "valueScaling": "linear",
              "trackBorderWidth": 0,
              "trackBorderColor": "black",
              "labelTextOpacity": 0.4,
              "barOpacity": 1,
              "name": "microglia_H3K27ac_pooled",
              "labelShowAssembly": True
            },
            "tilesetUid": "WyTmNKusQyuFmVmpSpPzCQ",
            "height": 20,
            "width": None,
            "server": "https://resgen.io/api/v1",
            "uid": "V3SfNozTRsCmKw3aU3XLPQ"
          },
          {
            "type": "1d-arcs",
            "uid": "u1",
            "tilesetUid": "JzccFAJUQEiz-0188xaWZg",
            "server": "https://resgen.io/api/v1",
            "height": 50,
            "options": {
              "labelPosition": "topLeft",
              "strokeColor": "green",
              "strokeWidth": 1.5,
              "strokeOpacity": 0.33,
              "arcStyle": "circle",
              "flip1D": "yes",
              "labelColor": "black",
              "name": "Neuron PLAC-seq",
              "completelyContained": False,
              "trackBorderWidth": 0,
              "trackBorderColor": "black"
            }
          },
          {
            "type": "1d-arcs",
            "uid": "u2",
            "server": "https://resgen.io/api/v1",
            "tilesetUid": "JzccFAJUQEiz-0188xaWZg",
            "height": 50,
            "options": {
              "labelPosition": "topLeft",
              "strokeColor": "green",
              "strokeWidth": 1.5,
              "strokeOpacity": 0.33,
              "arcStyle": "ellipsis",
              "completelyContained": False,
              "flip1D": "no",
              "labelColor": "black",
              "trackBorderWidth": 0,
              "trackBorderColor": "black",
              "name": "Neuron PLAC-seq"
            }
          }
        ],
        "center": [],
        "left": [],
        "right": [],
        "bottom": [],
        "whole": [],
        "gallery": []
      },
      "layout": {
        "w": 12,
        "h": 12,
        "x": 0,
        "y": 0
      },
      "initialXDomain": [
        2453719221,
        2470150193
      ],
      "initialYDomain": [
        2456860153.293911,
        2467009260.706089
      ]
    }
  ],
  "trackSourceServers": [
    "http://higlass.io/api/v1"
  ],
  "locationLocks": {
    "locksByViewUid": {},
    "locksDict": {}
  },
  "valueScaleLocks": {
    "locksByViewUid": {},
    "locksDict": {}
  },
  "zoomLocks": {
    "locksByViewUid": {},
    "locksDict": {}
  },
  "exportViewUrl": "http://higlass.io/api/v1/viewconfs"
}

# Load directly from dict
config = hg.Viewconf(**config_dict)
config
<IPython.core.display.Javascript object>

Supported outputs

  • streamstdout and stderr text
  • execute_result / display_data for:
    • image/png and image/jpeg (base64)
    • image/svg+xml
    • text/html (e.g. pandas DataFrames)
    • application/json
    • text/plain fallback
  • error — ANSI codes are stripped from tracebacks

Notes

  • Static renderer — cells are never executed.
  • Light and dark color schemes are applied automatically via prefers-color-scheme.
Last updated on