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

HTseq module brakes if 0 counts #1006

Closed
SemiQuant opened this issue Aug 15, 2019 · 5 comments
Closed

HTseq module brakes if 0 counts #1006

SemiQuant opened this issue Aug 15, 2019 · 5 comments
Labels
bug: core Bug in the main MultiQC code

Comments

@SemiQuant
Copy link

Description of bug:
If a htseq count file is present with all 0s, an error is thrown. Not a huge issue but thought I'd post it.

MultiQC Error log:

  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:
    path/file.HTSeq.counts
============================================================
Module htseq raised an exception: Traceback (most recent call last):
  File "/usr/local/bin/multiqc", line 440, in multiqc
    output = mod()
  File "/usr/local/lib/python2.7/dist-packages/multiqc/modules/htseq/htseq.py", line 31, in __init__
    parsed_data = self.parse_htseq_report(f)
  File "/usr/local/lib/python2.7/dist-packages/multiqc/modules/htseq/htseq.py", line 70, in parse_htseq_report
    parsed_data['percent_assigned'] = (float(parsed_data['assigned']) / float(parsed_data['total_count'])) * 100.0
ZeroDivisionError: float division by zero
============================================================

MultiQC run details (please complete the following):
multiqc "path"
MultiQC v1.7
Ubuntu Singularity container
Python 2.7.15rc1

@ewels ewels added the bug: core Bug in the main MultiQC code label Aug 17, 2019
@ewels
Copy link
Member

ewels commented Aug 17, 2019

Hi @SemiQuant,

Thanks for this! Do you have an example file that I can use to confirm any bugfix?

Phil

@ewels
Copy link
Member

ewels commented Aug 17, 2019

Should be an easy fix, just catching the ZeroDivisionError here... https://github.com/ewels/MultiQC/blob/68fc58f7c35afdf0795b40b3b71ec6288d7411fa/multiqc/modules/htseq/htseq.py#L70

@ewels ewels closed this as completed in 26076d7 Aug 17, 2019
@ewels
Copy link
Member

ewels commented Aug 17, 2019

ok, as it was such a simple fix I've pushed it without testing - if you could confirm that this solves the problem @SemiQuant, that would be great!

Cheers,

Phil

@SemiQuant
Copy link
Author

Hi Phil

The fix is working perfectly, thanks!

I used MultiQC v1.8.dev0 to check.

@ewels
Copy link
Member

ewels commented Aug 21, 2019

Great! Thanks for checking :)

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

No branches or pull requests

2 participants