deeptools / HiCExplorer

HiCExplorer is a powerful and easy to use set of tools to process, normalize and visualize Hi-C data.
https://hicexplorer.readthedocs.org
GNU General Public License v3.0
233 stars 70 forks source link

hicPlotTADs: IndexError: index 0 is out of bounds for axis 0 with size 0 #55

Closed apaytuvi closed 7 years ago

apaytuvi commented 7 years ago

Hi,

when transform = -log in tracks.txt, everything's OK. Command:

hicPlotTADs --tracks tracks.txt --region 1:20000000:22000000 --dpi 300 -out test.png

When transform = log, it throws:

time initializing track(s):
21.2699968815
Figure size in cm is 40 x 14.42832. Dpi is set to 300
setting min, max values for track 2. [hic] to: 323.714421836, 329.513362322
Traceback (most recent call last):
  File "/usr/bin/hicPlotTADs", line 5, in <module>
    pkg_resources.run_script('HiCExplorer==1.3', 'hicPlotTADs')
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 540, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 1455, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/lib/python2.7/site-packages/HiCExplorer-1.3-py2.7.egg/EGG-INFO/scripts/hicPlotTADs", line 7, in <module>
    main()
  File "/usr/lib/python2.7/site-packages/HiCExplorer-1.3-py2.7.egg/hicexplorer/hicPlotTADs.py", line 320, in main
    trp.plot(args.outFileName, *region, title=args.title)
  File "/usr/lib/python2.7/site-packages/HiCExplorer-1.3-py2.7.egg/hicexplorer/trackPlot.py", line 177, in plot
    track.plot(axis, label_axis, chrom, start, end)
  File "/usr/lib/python2.7/site-packages/HiCExplorer-1.3-py2.7.egg/hicexplorer/trackPlot.py", line 949, in plot
    if ticks[0] == 0:
IndexError: index 0 is out of bounds for axis 0 with size 0
fidelram commented 7 years ago

I will need to take a closer look at that. The error seems to imply that the log operation did not produce any values other than NaN.

What happens if you use transform=log1p ?

apaytuvi commented 7 years ago

With transform=log1p, I works @fidelram, but it gives a weird output:

test

fidelram commented 7 years ago

What is the 'max' and 'min' of your corrected matrix?

What happens if you do not apply any transform (in other words if you plot using a linear scale)?

apaytuvi commented 7 years ago

@fidelram Without transformation, it looks nice, just as I've posted here: https://github.com/maxplanck-ie/HiCExplorer/issues/52

Regarding minimum and maximum values:

>>> m.min()
1.119242523190496e-08
>>> m.max()
1.8245491357060435e+144
fidelram commented 7 years ago

The maximum value is way too big! This should go away with proper correction. Did you try again with different thresholds?

On Wed, Dec 21, 2016 at 1:05 PM, apaytuvi notifications@github.com wrote:

Without transformation, it looks nice, just as I've posted here: #52 https://github.com/maxplanck-ie/HiCExplorer/issues/52

Regarding minimum and maximum values:

m.min() 1.119242523190496e-08 m.max() 1.8245491357060435e+144

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/maxplanck-ie/HiCExplorer/issues/55#issuecomment-268507064, or mute the thread https://github.com/notifications/unsubscribe-auth/AEu_1SSC-GEkgmD2TRE1j4TCl0r2Eu4yks5rKRX9gaJpZM4LRB17 .

--

Fidel Ramirez

apaytuvi commented 7 years ago

Ok, increasing the lower threshold a bit, I get rid of these huge values! Thus, I don't get errors plotting the log-transformed counts. Thanks!