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

Error in hicPlotTADs #380

Closed luciaalvarez95 closed 5 years ago

luciaalvarez95 commented 5 years ago

Hi,

I have recently started using hicExplorer (version 2.2.1.1) and I have encountered an error when using the tool hicPlotTADs. I have tried to use it with several matrixes to make sure that the problem is not related with my data:

hicPlotTADs --tracks tracks.ini -out hi_tracks.png --region chr1:50000-500000 The error:

INFO:pygenometracks.tracksClass:plotting 1. [hic matrix]
Traceback (most recent call last):
  File "/home/user/.local/bin/hicPlotTADs", line 7, in <module>
    main()
  File "/home/user/.local/lib/python3.6/site-packages/hicexplorer/hicPlotTADs.py", line 9, in main
    plotTracks.main(args)
  File "/home/luser/.local/lib/python3.6/site-packages/pygenometracks/plotTracks.py", line 304, in main
    trp.plot(args.outFileName, *region, title=args.title)
  File "/home/user/.local/lib/python3.6/site-packages/pygenometracks/tracksClass.py", line 246, in plot
    track.plot(plot_axis, chrom, start, end)
  File "/home/user/.local/lib/python3.6/site-packages/pygenometracks/tracks/HiCMatrixTrack.py", line 173, in plot
    enumerate(self.hic_ma.cut_intervals)

ValueError: not enough values to unpack (expected 2, got 0) 

My tracks.ini file:

[x-axis]
where = top

[hic matrix]
file = matrix.h5
title = Hi-C data
depth = 500000
transform = log1p
file_type = hic_matrix

Looking forward to you to help me, thanks a lot!

gtrichard commented 5 years ago

Hello @luciaalvarez95 , thank you for using HiCExplorer.

Can you try hicInfo -m matrix.h5? Is the command working?

luciaalvarez95 commented 5 years ago

Thanks for answering! Yes, the command hicInfo is working perfectly fine:

hicInfo -m matrix.h5
INFO:root:Generating grammar tables from /usr/lib/python3.6/lib2to3/Grammar.txt
INFO:root:Generating grammar tables from /usr/lib/python3.6/lib2to3/PatternGrammar.txt
File:   matrix.h5
Size:   54,520
Sum:    245,917,577.3592614
Bin_length:     50000
Chromosomes:    1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, X, Y
Non-zero elements:      149,827,433
Minimum (non zero):     0.48900165602635337
Maximum:        4191.924440270264
NaN bins:       4166
LeilyR commented 5 years ago

It seems there is something wrong with your matrix since the bin coordinates couldn't be found. Do you mind using the most recent version of hicexplorer to generate and visualize the matrix? Also, did you try to run hicPlotTAD on our test data? Just to be sure that issue comes from you matrix.

luciaalvarez95 commented 5 years ago

Sorry for the delay! I have used the version 2.2.1.1 to plot and correct the matrix and the version 1.8.1 to generate it, is that a problem? Also, where can I find the test data you are mentioning? I am kind of new in this and I cannot find it.

Thanks a lot!!

LeilyR commented 5 years ago

It shouldn't be an issue using 2 different versions, unless there was a bug fix or an enhancement . In general would be recommended to use a single version for the entire process. Do you mind using the current version (3.0.1)? Also you can find test data at HiCExplorer/hicexplorer/test/test_data/. If your issue was still there after using the most recent version, feel free to send us your matrix that we can have a look.