rhpvorderman / sequali

Fast sequencing data quality metrics
GNU Affero General Public License v3.0
11 stars 0 forks source link

Prevent zero divide errors #63

Closed rhpvorderman closed 10 months ago

rhpvorderman commented 10 months ago

Checklist

Should fix #62

@marcelm, do you have the possibility to check if this fixes your issue?

pip install git+https://github.com/rhpvorderman/sequali.git@zerodivide

marcelm commented 10 months ago

The ZeroDivisionError is gone, but now the process doesn’t finish (after three minutes). Hitting Ctrl+C tells me it’s stuck here:

`.../report_modules.py", line 441, in from_phred_table_and_labels
    if accumulated_count == 0 or total == accumulated_count:

Maybe an infinite loop?

rhpvorderman commented 10 months ago

Definitiely infinite loop. It will be hard to debug without the data. The latest commit should be more robust.

I am really sorry to happily present you a tool that apparently does not survive the first contact with your data. I did test it on real-world data. But alas.

marcelm commented 10 months ago

I have asked whether I can make the data available to you.

rhpvorderman commented 10 months ago

The latest commit does not work? What I can also do is place a strategic print statement so that just the count data can be sent to me.

marcelm commented 10 months ago

The latest commit does not work?

No, 3bebc79 still hangs.

I can reproduce it with this single-nucleotide read:

@test
A
+
#
rhpvorderman commented 10 months ago

Thanks I can make a test case out of that.

rhpvorderman commented 10 months ago

The hanging should be fixed now.

It appears pygal's dependency on pkg_resources is causing a crash now. So I will need to fix that too. I will make a separate PR for the emptyness test cases.

marcelm commented 10 months ago

I’ve shared the file with you via e-mail. It appears to still hang.

rhpvorderman commented 10 months ago

It seems to work. I have send you the report.