Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR:hicexplorer.hicDifferentialTAD:local variable 'right_boundary_index_target' referenced before assignmentTraceback #685

Closed
10 tasks
antarikshtyagi opened this issue Mar 5, 2021 · 7 comments

Comments

@antarikshtyagi
Copy link

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 :

  • Search whether this issue (or a similar issue) has been solved before using the search tab above. Link the previous issue if appropriate below.

  • Paste your HiCExplorer version (hicInfo --version) and your python version (python --version) below.

  • hicInfo 3.6, Python 3.8.8

  • Have you checked our documentation on hicexplorer.readthedocs.io?

  • YES

  • Do you use conda to install HiCExplorer?

  • YES

  • Do you use the latest HiCExplorer release? If not, please install it via a conda environment:
    conda create --name hicexplorer hicexplorer=3.6 python=3.8 -c bioconda -c conda-forge
    and activate the environment: conda activate hicexplorer. Retry your command. You can exit a conda environment via conda deactivate. To learn more about conda and environments, please consider the following documentation.

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

  • Paste the full HiCExplorer command that produces the issue below
    (ignore if you simply spotted the issue in the code/documentation).

  • Paste the output printed on screen from the command that produces the issue
    below (ignore if you simply spotted the issue in the code/documentation).

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
Copy link
Collaborator

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
Copy link
Author

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
Copy link

nyuhic commented Jun 22, 2021

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

@nyuhic
Copy link

nyuhic commented Jun 23, 2021

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

@joachimwolff
Copy link
Collaborator

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

@joachimwolff
Copy link
Collaborator

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

@nyuhic
Copy link

nyuhic commented Jul 7, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants