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:hicexplorer.hicDifferentialTAD:local variable 'right_boundary_index_target' referenced before assignmentTraceback #685

Closed antarikshtyagi closed 3 years ago

antarikshtyagi commented 3 years ago

Hello,

I am running hicDifferentialTAD using this command:

hicDifferentialTAD -tm cools/NlaIII_run01_UCSC_hg38.matrix.cool -cm cools/NlaIII_run03_UCSC_hg38.matrix.cool \ -td run_01/TADs_run01_domains.bed -o differential -p 0.01 -t 32 -mr all

This was running for over an hour and then crashed with the error below. Could you please help me in getting this running

Thanks Ant

Welcome to the HiCExplorer GitHub repository! Before opening the issue please check that the following requirements are met :

Retry your command, is it solved now? If not please continue with the following:

ERROR:hicexplorer.hicDifferentialTAD:local variable 'right_boundary_index_target' referenced before assignmentTraceback (most recent call last): File "/home/antariksh.tyagi/miniconda3/envs/hicexplorer/lib/python3.8/site-packages/hicexplorer/hicDifferentialTAD.py", line 197, in computeDifferentialT$ intertad_left_target = matrix_target_inter_tad[outer_left_boundary_index_target:left_boundary_index_target, left_boundary_index_target:right_boundary_i$UnboundLocalError: local variable 'right_boundary_index_target' referenced before assignment

real 70m6.006s user 184m27.765s sys 71m52.225s

joachimwolff commented 3 years ago

Hi Ant,

The error message indicates a bug in the implementation. I need to check in detail why the variable right_boundary_index_target is not defined at this stage. I assume we have some '+1' aka 'the last element in the list' bug, meaning some boundary condition check is not correct.

What you can try to get some result in the meantime: run the command not with --mode all(that is the default case you used) but with --mode left-inter-TAD. Only the TAD and the left inter-TAD region are considered; the problematic the right inter-TAD boundaries are excluded, and it might run.

Best,

Joachim

antarikshtyagi commented 3 years ago

Thanks for responding. I tried with --mode left-inter-TAD but could not complete the run and resulted in the same error:

ERROR:hicexplorer.hicDifferentialTAD:local variable 'right_boundary_index_target' referenced before assignmentTraceback (most recent call last): File "/home/antariksh.tyagi/miniconda3/envs/hicexplorer/lib/python3.8/site-packages/hicexplorer/hicDifferentialTAD.py", line 197, in computeDifferentialT$ intertad_left_target = matrix_target_inter_tad[outer_left_boundary_index_target:left_boundary_index_target, left_boundary_index_target:right_boundary_i$UnboundLocalError: local variable 'right_boundary_index_target' referenced before assignment

real 71m16.764s user 186m38.889s sys 75m51.119s

nyuhic commented 3 years ago

Hello, any update on this issue? I get the same error no matter what I set as the mode.

nyuhic commented 3 years ago

If someone is facing the same issue, I was able to get it working by not using multiple threads.

joachimwolff commented 3 years ago

Ok, thanks for the feedback. I will work on the parallelization for the next release.

joachimwolff commented 3 years ago

This bug could be fixed with the changes in the current develop branch. Can you check this @nyuhic @antarikshtyagi ? Thanks a lot!

nyuhic commented 3 years ago

Thanks, it works fine with multiple threads now.

I also have a related question. Once I get the differential tads, I want to know if interactions are increasing or decreasing in them. To check this I used deeptools multiBigwigSummary to extract the average score across the differential domains from the score.bedgraph files that are produced when calling tads. I then compare these scores between treatment and control condition. Does this make sense?