TrEE-TIMC / circhic

A python library to display HiC data on a circular strip and to integrate genomic data
https://tree-timc.github.io/circhic/
Other
1 stars 2 forks source link

plot_hic's inner radius is wrong. #38

Closed NelleV closed 4 years ago

ijunier commented 4 years ago

Is the bug related to my part of the code?

NelleV commented 4 years ago

I'm not sure…

Here's some code to identify and reproduce the problem:

  from circhic import datasets
  from circhic._base import CircHiCFigure

  # Load the data, compute the cumulative raw counts.
  data = datasets.load_ecoli()
  counts = data["counts"]
  lengths = data["lengths"]

  ###############################################################################
  # A simple vertical colorbar
  circhicfig = CircHiCFigure(lengths)
  im, ax = circhicfig.plot_hic(counts, inner_radius=0.5)

  rax = circhicfig._create_subplot(outer_radius=0.5)
  rax.set_rgrids([])
  rax.set_thetagrids([])
  rax.spines["polar"].set_linewidth(2)
  rax.spines["polar"].set_color("r")

  rax = circhicfig._create_subplot(outer_radius=1)
  rax.set_rgrids([])
  rax.set_thetagrids([])
  rax.spines["polar"].set_linewidth(2)
  rax.spines["polar"].set_color("r")

The black lines from the HiC contact map border and the red lines are supposed to overlay. The results is as follows:

bug_circhic

NelleV commented 4 years ago

The problem comes from the subplot. I'll check out exactly what's going on…

NelleV commented 4 years ago

I think the problem may come from Matplotlib :(

ijunier commented 4 years ago

Another one! ;)