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 - Kraken2 module breaks when you have 0 unclassified reads #1440

Closed
drpatelh opened this issue Jun 2, 2021 · 5 comments
Closed
Labels
bug: module Bug in a MultiQC module

Comments

@drpatelh
Copy link
Contributor

drpatelh commented Jun 2, 2021

I tested with MultiQC v1.10.1. Creating a fresh folder with just the file below and running multiqc . should reproduce the error below:

[ERROR  ] multiqc : Oops! The 'kraken' MultiQC module broke... 
    Please copy the following traceback and report it at https://github.com/ewels/MultiQC/issues 
    If possible, please include a log file that triggers the error - the last file found was:
      ./hCoV-19_2021.kraken2.report.txt
  ============================================================
  Module kraken raised an exception: Traceback (most recent call last):
    File "/usr/local/lib/python3.9/site-packages/multiqc/multiqc.py", line 594, in run
      output = mod()
    File "/usr/local/lib/python3.9/site-packages/multiqc/modules/kraken/kraken.py", line 70, in __init__
      self.sum_sample_counts()
    File "/usr/local/lib/python3.9/site-packages/multiqc/modules/kraken/kraken.py", line 237, in sum_sample_counts
      row["counts_rooted"] / self.kraken_sample_total_readcounts[s_name]
  ZeroDivisionError: division by zero

The log above didn't point to the erroring file but the correct one is attached below:

test.kraken2.report.txt

@ewels
Copy link
Member

ewels commented Jun 2, 2021

The log above didn't point to the erroring file

Yes it did?

the last file found was:
      ./hCoV-19_2021.kraken2.report.txt

@ewels
Copy link
Member

ewels commented Jun 2, 2021

ah you mean the one it pointed to was not actually the one that caused the error maybe? Yeah that happens sometimes.

@ewels ewels closed this as completed in a821bbc Jun 2, 2021
@ewels ewels added the bug: module Bug in a MultiQC module label Jun 2, 2021
ewels added a commit to MultiQC/test-data that referenced this issue Jun 2, 2021
@ewels
Copy link
Member

ewels commented Jun 2, 2021

Fixed - should be solved in 1.11dev.

Thanks for providing the test data, I thought I fixed it in a about 2 lines but when I tested it, turned out to be a little more involved. Should now work though I think 👍🏻

@drpatelh
Copy link
Contributor Author

drpatelh commented Jun 2, 2021

Thanks for the quick fix 🙇🏽

ewels added a commit that referenced this issue Jun 3, 2021
@ewels
Copy link
Member

ewels commented Jun 3, 2021

Oops sorry, just realised that my force-push didn't go through last night. Should now be in place in 3cb88c4 so should now work 🤞🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: module Bug in a MultiQC module
Projects
None yet
Development

No branches or pull requests

2 participants