<jupyter_start><jupyter_text>Higlass viewer [Higlass](cite-higlass) is nowadays the best, according to the writter of this notebook, visualization tool for Hi-C matrices. An online instance of Higlass can be used here https://higlass.io/, but the use of user data would require a full installation of Higlass in a web server.There is however a jupyter plugin (https://docs.higlass.io/jupyter.html) and a python package that we can use to display our data. To load the matrices into higlass we are going to export our matrix to a format compatible with higlass like cooler. The `tadbit export` will generate a cooler matrix that we will then visualize with a local instance of Higlass.<jupyter_code>%%bash

tadbit export -w ../results/B_rep1/ \
    --format cooler \
    -r 25000 \
    -o ../results/B_rep1_export_cooler.mcool
import higlass
import higlass.client as hgc
import higlass.tilesets as hgti
from higlass.client import View, Track
ts_tadbit = hgti.cooler('../results/B_rep1_export_cooler.mcool')
tr_tadbit = hgc.Track('heatmap',
                      tileset=ts_tadbit,
                      height=500,
                      width=500,
                      options={'assembly':'mm10'}
                     )

chromsizes_fp = '../refGenome/genmap/mappability/mm39_chr3.genmap.chrom.sizes'
cs = hgti.chromsizes(chromsizes_fp)

tr0 = Track('horizontal-chromosome-labels', position='top', tileset=cs)
tr1 = Track('vertical-chromosome-labels', position='left', tileset=cs)
view1 = hgc.View(tracks=[tr0,tr1,tr_tadbit],
                 initialXDomain=[0,150000000],
                 initialYDomain=[0,150000000])
(display, server, viewconf) = higlass.display([view1], server_port=54998)
display
del(display)
del(server)
ts_tadbit = hgti.cooler('../data/full_matrix.mcool')
tr_tadbit = hgc.Track('heatmap',
                      tileset=ts_tadbit,
                      height=500,
                      width=500,
                      options={'assembly':'mm10'}
                     )

tr2 = Track(server= "http://higlass.io/api/v1",
            tilesetUid="EtrWT0VtScixmsmwFSd7zg",
            type= "chromosome-labels", position='top')
view1 = hgc.View(tracks=[tr2,tr_tadbit],
                 initialXDomain=[0,150000000],
                 initialYDomain=[0,150000000])
(display, server, viewconf) = higlass.display([view1], server_port=54998)
#chr3:33950000-35450000
display<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10885761589403974, 'fraction_numerical': 0.04428807947019867, 'mean_word_length': 2.9753289473684212, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '371737', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 856, 'n_tokens_neox': 754, 'n_words': 187, 'path': 'assets/material/Notebooks/Day3/Higlass.ipynb', 'repo_name': 'GTPB/3DAROC21', 'size': '2416'}