KolmogorovLab / hapdup

Pipeline to convert a haploid assembly into diploid
Other
90 stars 10 forks source link

ZeroDivisionError #20

Closed mattloose closed 1 year ago

mattloose commented 1 year ago

Hi,

I'm running hapdup version 0.8 on a number of human genomes.

It appears to fail fairly regulary with an error in flye:

[2022-10-20 15:33:48] INFO: Running Flye polisher [2022-10-20 15:33:48] INFO: Polishing genome (1/1) [2022-10-20 15:33:48] INFO: Polishing with provided bam [2022-10-20 15:33:48] INFO: Separating alignment into bubbles [2022-10-20 15:37:12] ERROR: Thread exception [2022-10-20 15:37:12] ERROR: Traceback (most recent call last): File "/home/plzmwl/anaconda3/envs/hapdup/lib/python3.8/site-packages/flye/polishing/bubbles.py", line 79, in _thread_worker indels_profile = _get_indel_clusters(ctg_aln, profile, ctg_region.start) File "/home/plzmwl/anaconda3/envs/hapdup/lib/python3.8/site-packages/flye/polishing/bubbles.py", line 419, in _get_indel_clusters get_clusters(deletions, add_last=True) File "/home/plzmwl/anaconda3/envs/hapdup/lib/python3.8/site-packages/flye/polishing/bubbles.py", line 410, in get_clusters support = len(reads) / region_coverage ZeroDivisionError: division by zero

The flye version is 2.9-b1778

Has anyone else seen this and have any suggestions on how to fix?

Thanks.

mikolmogorov commented 1 year ago

Oups - it does look like a bug, will try to push a new release with a fix soon!

I'm curious what is the coverage of your human genomes? Haven't seen this error with our 35-40x human datasets yet..

mattloose commented 1 year ago

Thanks for getting back to me.

These are all in the slightly low range of 30-35x. Read length N50s are 50kb +- 5kb.

I'll check if this is failing on higher coverage samples as well - I suspect it is.

mikolmogorov commented 1 year ago

Pushed a 0.10 update to docker and github - it should fix the issue! Note that if you are using github installation, don't forget to do git submodule update since the updated part in in Flye submodule. Let me know if that fixes your problem.

mattloose commented 1 year ago

Thanks - this fixed it for these samples (but see new issue ;-)