EukDetect icon indicating copy to clipboard operation
EukDetect copied to clipboard

ZeroDivisionError: division by zero

Open antgonza opened this issue 3 years ago • 3 comments

Hello,

I'm trying to run eukdetect --mode runall --configfile default_configfile.yml --cores 16 and I'm getting this error:

02/10/2022 16:00:54:  Parsing config file ...
Traceback (most recent call last):
  File "/home/antoniog/miniconda3/envs/eukdetect/bin/eukdetect", line 33, in <module>
    sys.exit(load_entry_point('EukDetect==1.0.1', 'console_scripts', 'eukdetect')())
  File "/home/antoniog/miniconda3/envs/eukdetect/lib/python3.6/site-packages/EukDetect-1.0.1-py3.6.egg/eukdetect/runall.py", line 139, in main
  File "/home/antoniog/miniconda3/envs/eukdetect/lib/python3.6/site-packages/EukDetect-1.0.1-py3.6.egg/eukdetect/runall.py", line 459, in check_readlen
ZeroDivisionError: division by zero

any idea what could be going on?

If it helps:

  • Tests run just fine:
$ python tests/test_eukdetect.py
.....
----------------------------------------------------------------------
Ran 5 tests in 87.763s

OK
  • The command was initially failing with this error:
$ eukdetect --mode runall --configfile default_configfile.yml --cores 16
02/10/2022 15:58:27:  Parsing config file ...
02/10/2022 15:58:27:  Error: missing files in database directory: all_buscos_v4.fna.1.bt2, all_buscos_v4.fna.2.bt2, all_buscos_v4.fna.3.bt2, all_buscos_v4.fna.4.bt2, all_buscos_v4.fna.rev.1.bt2, all_buscos_v4.fna.rev.2.bt2

but changing it to ncbi_eukprot_met_arch_markers.fna (AFAIK newest version) let it continue.

Thank you!

antgonza avatar Feb 11 '22 00:02 antgonza

The issue was that some of the gz files had zero reads after QC (removing any reads below 100bps).

antgonza avatar Feb 11 '22 13:02 antgonza

Thanks for the update. Just to be clear, you get an error reporting that the database is empty, but the issue is that your read files don't contain reads longer than the cutoff specified in the config file?

allind avatar Feb 25 '22 16:02 allind

We use fastp for our QC (but I have seen this with other tools too) and if there are no sequences that pass our parameters that tool writes empty fastq.gz files. Then, EukDetect opens that file, reads it with 0 counts and python raises an error due to a division by zero. Hope this helps.

antgonza avatar Feb 25 '22 16:02 antgonza