Hi-C cis interaction maps#

CLI mode#

conf-hicmap_4.yml

trackc:
  - ax: t1
    height: 1
    track_type: hicmap
    track_para:
      mat:
        method: extractCisContact
        clr: ./github/seqyuan/trackc_data/examples/HPDE6C7.chr18.mcool::/resolutions/25000
      mapC:
        map_type: tri
        height: 50
        label: tri
  - ax: t2
    height: 1
    hspace: 0.3
    track_type: hicmap
    track_para:
      mat2:
        method: extractCisContact
        clr: ./github/seqyuan/trackc_data/examples/HPDE6C7.chr18.mcool::/resolutions/25000
      mapC:
        map_type: tri
        height: 50
        label: tri-mat2
  - ax: t3
    height: 2
    hspace: 0.3
    track_type: hicmap
    track_para:
      mat:
        method: extractCisContact
        clr: ./github/seqyuan/trackc_data/examples/HPDE6C7.chr18.mcool::/resolutions/25000
      mapC:
        map_type: tri
        height: 50
        label: tri-symmetric
        symmetric: True

  - ax: t4
    height: 1
    hspace: 0.3
    track_type: hicmap
    track_para:
      mat:
        method: extractCisContact
        clr:./github/seqyuan/trackc_data/examples/BxPC3.chr18.mcool::/resolutions/25000
        extend: 50
      mapC:
        cmap: PuBu
        map_type: rec
        height: 50
        label: rec
  - ax: t5
    height: 1
    hspace: 0.3
    track_type: hicmap
    track_para:
      mat2:
        method: extractCisContact
        clr: ./github/seqyuan/trackc_data/examples/BxPC3.chr18.mcool::/resolutions/25000
        extend: 50
      mapC:
        cmap: cividis
        map_type: rec
        height: 50
        label: rec-mat2
  - ax: t6
    height: 2
    hspace: 0.3
    track_type: hicmap
    track_para:
      mat2:
        method: extractCisContact
        clr: ./github/seqyuan/trackc_data/examples/BxPC3.chr18.mcool::/resolutions/25000
        extend: 50
      mapC:
        cmap: magma
        map_type: rec
        height: 50
        symmetric: True
        logdata: True
        label: rec-symmetric

  - ax: t1
    track_type: scale_track
    track_para:
      scale_adjust: Mb
      tick_pos: top
      ratio2ax: 1
trackc cli conf-hicmap_4.yml -r 18:10000000-14500000

heatmap-4.png

API mode#

[18]:
import trackc as tc
[17]:
ten = tc.tenon(figsize=(7, 1))
ten.add(pos="bottom", height=2)
ten.add(pos="bottom", height=1)
ten.add(pos="bottom", height=1, hspace=0.3)

region = "18:10000000-14500000"
clr = "./github/seqyuan/trackc_data/examples/BxPC3.chr18.mcool::/resolutions/25000"

height = 50

mat = tc.tl.extractCisContact(clr=clr, region=region)
mat2 = tc.tl.extractCisContact(clr=clr, region=region, extend=height)


tc.pl.scale_track(
    ax=ten.axs(0), region=region, scale_adjust="Mb", tick_pos="top", ratio2ax=0.4
)

tc.pl.mapC(
    ax=ten.axs(0),
    mat=mat2,
    map_type="rec",
    height=height,
    label="rec-sym",
    symmetric=True,
)

tc.pl.mapC(
    ax=ten.axs(1), mat=mat, cmap="PuBu", map_type="tri", height=height, label="tri-mat"
)

tc.pl.mapC(
    ax=ten.axs(2),
    mat2=mat2,
    cmap="cividis",
    map_type="rec",
    height=height,
    label="rec-mat2",
)
no max min range
maxrange: 248.0 minrange: 1.0
no max min range
maxrange: 336.22000000000116 minrange: 1.0
no max min range
maxrange: 248.0 minrange: 1.0
../_images/cli_heatmap-4_4_1.png