# Visualize Data in HiGlass

Cooler (`.cooler`) is a widely used file format for storing **genomic contact matrices** (e.g., Hi-C–style interactions). TruPath uses the cooler format to encode the **frequency of reads aligned to pairs of genomic regions that were physically close on the flowcell**, which forms a genome-wide contact map. Cooler is designed to efficiently store and query these large, sparse interaction matrices. The DRAGEN colocation cooler file can be found as `<sample_name>/<sample_name>.colocation.cooler`

**HiGlass** (<https://higlass.io/>), a community visualization tool for browsing genomic interaction data with smooth zooming, panning, and region-level inspection is recommended to explore colocation maps interactively.

***

### Step 1 — Install HiGlass Docker

Use [higlass-docker ](https://github.com/higlass/higlass-docker)and follow instructions [here](https://github.com/higlass/higlass-docker?tab=readme-ov-file#running-locally)

```
docker pull higlass/higlass-docker # Ensure that you have the latest.
docker run --detach \
           --publish 8899:80 \
           --volume  <local_path_to_mcooler>:/data \
           --name higlass-container_8899 \
           higlass/higlass-docker
```

Then, go to <http://localhost:8899/app>

### Step 2 — Install `cooler` locally

You need to install `cooler` first before you can run commands like `cooler zoomify`.

You can install via **pip**:

```bash
pip install cooler
```

Or via **conda** (often preferred for scientific Python setups):

```bash
conda install -c conda-forge -c bioconda cooler
```

### Step 3 — Convert `.cooler` to multi-resolution `.mcooler`

Once installed, you can generate an `.mcool` file using `cooler zoomify`, which recursively coarsens the matrix into multiple resolutions:

```bash
cooler zoomify <sample_name>.colocation.cooler
```

This produces `<sample_name>.colocation.mcooler` with zoom levels typically increasing by factors of 2 (so HiGlass remains responsive while zooming).

### Step 4 — Visualize the `.mcooler` file with HiGlass

Next, Ingest mcooler from Step 2 into higlass:

```bash
higlass-manage ingest \
    --filetype cooler \
    --datatype matrix --assembly hg38 \
    --name <sample_name> --project-name <project_name> \
    <sample_name>.colocation.mcooler
```

In your HiGlass URL (e.g. <http://localhost:8888/app>), click the "+" on the top right > "Center"\\

<figure><img src="https://2122546113-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCiFAstZpxWHpI6k3vTvF%2Fuploads%2Fgit-blob-ea27734405e526dd952626f6c8cd59cdaf52eae4%2Fimage%20(8)%20(2).png?alt=media" alt=""><figcaption></figcaption></figure>

Next, select your sample colocation by `<project_name>/<sample_name>`, as you supplied to the `higlass-manage ingest` command. Here, my data is in cooler-test/test-chr14.

<figure><img src="https://2122546113-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCiFAstZpxWHpI6k3vTvF%2Fuploads%2Fgit-blob-cacb8331aa1577afe55ca61d8399320a6282fdea%2Fimage%20(1)%20(1)%20(1)%20(1)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

There are also several annotation tracks that are useful, i.e. you can add tracks on top and left for chromosome and genes. You can also turn on "Toggle Position Search Box" and you can navigate to your region of interest.

<figure><img src="https://2122546113-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCiFAstZpxWHpI6k3vTvF%2Fuploads%2Fgit-blob-09ace35cf1d4f296bb26239ae689067991a50f08%2Fimage%20(19)%20(1).png?alt=media" alt=""><figcaption><p>t(14,21)</p></figcaption></figure>

HiGlass also has several add-ons to support VCF, bed, and bedpe file formats. Please feel free to add those tracks on the X/Y axis and explore the proximity reads from Constellation.
