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

ZeroDivisionError: division by zero #200

Open
80QvQ08 opened this issue Nov 26, 2024 · 2 comments
Open

ZeroDivisionError: division by zero #200

80QvQ08 opened this issue Nov 26, 2024 · 2 comments

Comments

@80QvQ08
Copy link

80QvQ08 commented Nov 26, 2024

Hello, FANC is amazing! I successfully used FANC to analyze A/B compartment. but i also encountered a problem when i want to run the TAD analysis with .hic generated by jucer, and i specified a resolution 50kb, The code I used and the feedback are listed below:

fanc insulation Mpha.hic@50kb Mpha_50kb.insulation -w 50kb

2024-11-25 20:16:38,792 INFO FAN-C version: 0.9.28
2024-11-25 20:16:39,124 INFO Chosen window sizes: 50000
2024-11-25 20:16:39,850 INFO Chr1 (1/11)
Traceback (most recent call last):
File "/opt/software/python/bin/fanc", line 127, in
Fanc()
File "/opt/software/python/bin/fanc", line 93, in init
command([sys.argv[0]] + sys.argv[option_ix:], log_level=log_level, verbosity=verbosity)
File "/opt/software/python/lib/python3.8/site-packages/fanc/commands/fanc_commands.py", line 3801, in insulation
_domain_scores(parser, input_file, output_file, output_format,
File "/opt/software/python/lib/python3.8/site-packages/fanc/commands/fanc_commands.py", line 3853, in _domain_scores
scores = score_class.from_hic(matrix, file_name=output_file,
File "/opt/software/python/lib/python3.8/site-packages/fanc/architecture/domains.py", line 342, in from_hic
values_by_chromosome[w_ix][k] /= bin_window_size ** 2
ZeroDivisionError: division by zero
Closing remaining open files:Mpha_50kb.insulation...done

At the mean time, I also try to use fanc auto to generate .hic using fastq.gz data and validpair data produced by Hicpro, but I encountered the same error: ZeroDivisionError: division by zero.

Thank you very much for your time and assistance. I look forward to your guidance on this matter.

@kaukrise
Copy link
Collaborator

Hi, and thank you.

Can you please try a larger window size? Setting the window size equal to the matrix resolution will effectively add up values along the diagonal of the matrix, which is surely not what you want. Try 10x resolution first, i.e. 500kb.

Best,
Kai

@80QvQ08
Copy link
Author

80QvQ08 commented Dec 4, 2024

Thank you very much, indeed, I called TAD successfully specifing a resolution 50kb with larger window size(100kb、250kb and 500kb), and I found that TAD boundary are not same in different window size, so under which window size is the TAD boundary result more reliable? Thanks

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

No branches or pull requests

2 participants