khyox / recentrifuge

Recentrifuge: robust comparative analysis and contamination removal for metagenomics
http://www.recentrifuge.org
Other
86 stars 7 forks source link

OverflowError when trying passing centrifuge input test #50

Closed pimarin closed 9 months ago

pimarin commented 9 months ago

Hello,

I tried to update the recentrifuge galaxy tool from 1.12.1 to 1.13.1 but when I tested centrifuge input, the tool failed and make and error. Inputs from https://github.com/galaxyproject/tools-iuc/tree/main/tools/recentrifuge/test-data

Output observed :

=-= /opt/conda/envs/recentrifuge/bin/rcf =-= v1.13.1 - Jan 2024 =-= by Jose Manuel Martí =-=

Loading NCBI nodes... OK! 
Loading NCBI names... OK! 
Building dict of parent to children taxa... OK! 

Please, wait, processing files in parallel...

multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/opt/conda/envs/recentrifuge/lib/python3.11/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/recentrifuge/lib/python3.11/site-packages/recentrifuge/taxclass.py", line 128, in process_output
    tree.allin1(ontology=ontology, counts=counts, scores=scores,
  File "/opt/conda/envs/recentrifuge/lib/python3.11/site-packages/recentrifuge/trees.py", line 276, in allin1
    child_acc: Union[int, None] = self[tid].allin1(
                                  ^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/recentrifuge/lib/python3.11/site-packages/recentrifuge/trees.py", line 276, in allin1
    child_acc: Union[int, None] = self[tid].allin1(
                                  ^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/recentrifuge/lib/python3.11/site-packages/recentrifuge/trees.py", line 276, in allin1
    child_acc: Union[int, None] = self[tid].allin1(
                                  ^^^^^^^^^^^^^^^^^
  [Previous line repeated 3 more times]
  File "/opt/conda/envs/recentrifuge/lib/python3.11/site-packages/recentrifuge/trees.py", line 305, in allin1
    update_score_and_acc(chld, child_acc)
  File "/opt/conda/envs/recentrifuge/lib/python3.11/site-packages/recentrifuge/trees.py", line 268, in update_score_and_acc
    self[tid].score = swmean(
                      ^^^^^^^
  File "/opt/conda/envs/recentrifuge/lib/python3.11/site-packages/recentrifuge/trees.py", line 263, in swmean
    (cnt1 * 10**sco1 + cnt2 * 10**sco2) / (cnt1 + cnt2)
            ~~^^~~~~
OverflowError: (34, 'Numerical result out of range')
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/conda/envs/recentrifuge/bin/rcf", line 928, in <module>
    main()
  File "/opt/conda/envs/recentrifuge/bin/rcf", line 887, in main
    read_samples()
  File "/opt/conda/envs/recentrifuge/bin/rcf", line 492, in read_samples
    input_files, [r.get() for r in async_results]):
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/recentrifuge/bin/rcf", line 492, in <listcomp>
    input_files, [r.get() for r in async_results]):
                  ^^^^^^^
  File "/opt/conda/envs/recentrifuge/lib/python3.11/multiprocessing/pool.py", line 774, in get
    raise self._value
OverflowError: (34, 'Numerical result out of range')
khyox commented 9 months ago

Hi @pimarin and thank you for the bug report. Just the day before your report, I issued Recentrifuge v1.13.2, which should address this bug introduced in v1.13.0. I hope it quickly made its way to galaxy and you can see this solved now. Please feel free to reopen if you still see that after upgrading to v1.13.2. Thanks!

pimarin commented 9 months ago

Thank you @khyox !

khyox commented 9 months ago

You're welcome @pimarin, and thanks again for reporting the issue! :)