gamcil / clinker

Gene cluster comparison figure generator
MIT License
507 stars 66 forks source link

Maximum recursion depth exceeded #48

Closed chanana closed 3 years ago

chanana commented 3 years ago

I recently ran into this error:

Traceback (most recent call last):
  File "/Users/schanana/Documents/qw-umonospora+b482/antismash/clinker/bin/clinker", line 11, in <module>
    load_entry_point('clinker==0.0.15', 'console_scripts', 'clinker')()
  File "/Users/schanana/Documents/qw-umonospora+b482/antismash/clinker/lib/python3.8/site-packages/clinker/main.py", line 218, in main
    clinker(
  File "/Users/schanana/Documents/qw-umonospora+b482/antismash/clinker/lib/python3.8/site-packages/clinker/main.py", line 81, in clinker
    globaligner = align.align_clusters(*clusters, cutoff=identity, jobs=jobs)
  File "/Users/schanana/Documents/qw-umonospora+b482/antismash/clinker/lib/python3.8/site-packages/clinker/align.py", line 55, in align_clusters
    aligner.align_stored_clusters(cutoff, jobs=jobs)
  File "/Users/schanana/Documents/qw-umonospora+b482/antismash/clinker/lib/python3.8/site-packages/clinker/align.py", line 399, in align_stored_clusters
    self.build_gene_groups()
  File "/Users/schanana/Documents/qw-umonospora+b482/antismash/clinker/lib/python3.8/site-packages/clinker/align.py", line 408, in build_gene_groups
    for genes in consolidate(links):
  File "/Users/schanana/Documents/qw-umonospora+b482/antismash/clinker/lib/python3.8/site-packages/clinker/align.py", line 68, in consolidate
    r, b = [arr[0]], consolidate(arr[1:])
  File "/Users/schanana/Documents/qw-umonospora+b482/antismash/clinker/lib/python3.8/site-packages/clinker/align.py", line 68, in consolidate
    r, b = [arr[0]], consolidate(arr[1:])
  File "/Users/schanana/Documents/qw-umonospora+b482/antismash/clinker/lib/python3.8/site-packages/clinker/align.py", line 68, in consolidate
    r, b = [arr[0]], consolidate(arr[1:])
  [Previous line repeated 990 more times]
  File "/Users/schanana/Documents/qw-umonospora+b482/antismash/clinker/lib/python3.8/site-packages/clinker/align.py", line 66, in consolidate
    if len(arr) < 2:
RecursionError: maximum recursion depth exceeded while calling a Python object

I was analyzing 11 gbk files. Once I removed 3 of them, it ran without problems. Is there a maximum limit to the number of files it can process at once?

my input command was:

$  clinker ./*.gbk -f -ufo -p ./result-f-ufo-p.html -o ./alignments-f-ufo-p.txt
gamcil commented 3 years ago

Ah I recently moved the gene grouping logic over to Python in the newest version which must be hitting this error with the recursive implementation. I'll change over to a non-recursive version and update soon

gamcil commented 3 years ago

Should be solved in v0.0.16 (https://github.com/gamcil/clinker/releases/tag/v0.0.16) which will be available via pip soon

chanana commented 3 years ago

Thanks for the speedy solution! Great tool 😄