nickjcroucher / gubbins

Rapid phylogenetic analysis of large samples of recombinant bacterial whole genome sequences using Gubbins
http://nickjcroucher.github.io/gubbins/
GNU General Public License v2.0
159 stars 49 forks source link

RuntimeError: cannot cache function 'seq_to_int' #396

Closed hkaspersen closed 4 months ago

hkaspersen commented 4 months ago

Hello! I recently updated gubbins to version 3.3.3 with the quay.io docker image. When running the program on a core genome alignment from ParSNP, I get the following error message:

Command error:
  Traceback (most recent call last):
    File "/usr/local/bin/run_gubbins.py", line 7, in <module>
      from gubbins.run_gubbins import main
    File "/usr/local/lib/python3.10/site-packages/gubbins/__init__.py", line 16, in <module>
      from gubbins import common
    File "/usr/local/lib/python3.10/site-packages/gubbins/common.py", line 42, in <module>
      from gubbins.pyjar import jar, get_base_patterns
    File "/usr/local/lib/python3.10/site-packages/gubbins/pyjar.py", line 212, in <module>
      def seq_to_int(seq,out_seq):
    File "/usr/local/lib/python3.10/site-packages/numba/core/decorators.py", line 234, in wrapper
      disp.enable_caching()
    File "/usr/local/lib/python3.10/site-packages/numba/core/dispatcher.py", line 863, in enable_caching
      self._cache = FunctionCache(self.py_func)
    File "/usr/local/lib/python3.10/site-packages/numba/core/caching.py", line 601, in __init__
      self._impl = self._impl_class(py_func)
    File "/usr/local/lib/python3.10/site-packages/numba/core/caching.py", line 337, in __init__
      raise RuntimeError("cannot cache function %r: no locator available "
  RuntimeError: cannot cache function 'seq_to_int': no locator available for file '/usr/local/lib/python3.10/site-packages/gubbins/pyjar.py'

This is the command that was used:

run_gubbins.py parsnp_alignment.fasta --seed 12345 --tree-builder raxml --model GTRGAMMA --threads 8 -v --prefix gubbins_out &> gubbins.log

Note that this command worked on earlier versions of Gubbins. Any idea what might be the issue here? Thanks in advance!

nickjcroucher commented 4 months ago

This seems to be due to numba not being compatible with python >3.10, fixed attempted in #397.

nickjcroucher commented 4 months ago

Should now be fixed in v3.3.4.

hkaspersen commented 3 months ago

Thank you for the quick fix! However I am still getting the same error with the new image 3.3.4--py310pl5321he4a0461_0. I do however see that this issue is not present when I run the github CI tests, only when it is run on our HPC cluster. Any thoughts on this?

hkaspersen commented 3 months ago

Hello again, just wanted to highlight that the suggested solution in the cited issue (export NXF_SINGULARITY_HOME_MOUNT=true) did not work for me. I added this line to my bashrc file, but it still generated the same error above. I am running with nextflow version 23.10.1.

nickjcroucher commented 3 months ago

Based on #402 - this seems to be a NextFlow issue, not a Gubbins one. Please reopen if there is a specific Gubbins problem though.