rrwick / Unicycler

hybrid assembly pipeline for bacterial genomes
GNU General Public License v3.0
535 stars 132 forks source link

Unicycler v 0.5.0 still returns ZeroDivisionError: float division by zero error #313

Open cmstouthamer opened 1 year ago

cmstouthamer commented 1 year ago

Hello,

I have recently been using Unicycler because it's perfect for the relatively old data that I have of symbiont genomes. After the hybrid assembly stage using SPADes, Unicycler fails and returns the following errors:

File "/apps/eb/Unicycler/0.5.0-gompi-2019b-Python-3.7.4/bin/unicycler", line 10, in <module> sys.exit(main()) File "/apps/eb/Unicycler/0.5.0-gompi-2019b-Python-3.7.4/lib/python3.7/site-packages/unicycler/unicycler.py", line 156, in main args.min_dead_end_size, graph, anchor_segments) File "/apps/eb/Unicycler/0.5.0-gompi-2019b-Python-3.7.4/lib/python3.7/site-packages/unicycler/assembly_graph.py", line 1363, in clean$ usedupness_scores[seg_num] = self.get_usedupness_score(seg_num, unbridged_graph) File "/apps/eb/Unicycler/0.5.0-gompi-2019b-Python-3.7.4/lib/python3.7/site-packages/unicycler/assembly_graph.py", line 1526, in get_u$ depth_fraction_used = depth_used / original_depth ZeroDivisionError: float division by zero

I really want to use Unicycler for my dataset, and I've seen in the resolved issues tab that this problem has been addressed in other Unicycler python scripts. I was wondering if this could be a similar fix?

Thank you so much! Corinne

abrozzi commented 1 year ago

Hi, I get the same error when I try with the sample_data provided in the installation folder

unicycler -1 /home/Unicycler/sample_data/short_reads_1.fastq.gz -2 /home/Unicycler/sample_data/short_reads_2.fastq.gz -o /home/Unicycler/testUni
Saving /home/Unicycler/testUni/004_bridges_applied.gfa
Traceback (most recent call last):
  File "/home/.local/bin/unicycler", line 33, in <module>
    sys.exit(load_entry_point('unicycler==0.5.0', 'console_scripts', 'unicycler')())
  File "/home/.local/lib/python3.9/site-packages/unicycler/unicycler.py", line 155, in main
    graph.clean_up_after_bridging_2(seg_nums_used_in_bridges, args.min_component_size,
  File "/home/.local/lib/python3.9/site-packages/unicycler/assembly_graph.py", line 1363, in clean_up_after_bridging_2
    usedupness_scores[seg_num] = self.get_usedupness_score(seg_num, unbridged_graph)
  File "/home/.local/lib/python3.9/site-packages/unicycler/assembly_graph.py", line 1526, in get_usedupness_score
    depth_fraction_used = depth_used / original_depth
ZeroDivisionError: float division by zero