rtn28 / Complet-Plus

0 stars 2 forks source link

RecursionError: maximum recursion depth exceeded while calling a Python object #1

Open JFF1594032292 opened 1 year ago

JFF1594032292 commented 1 year ago

Hi, thanks for developing this tool. I used it in my mmseq2 results, however it reported this error:

Traceback (most recent call last):
  File "/data/home/myname/software/Complet-Plus/complet-plus-scripts/relabel_seqs.py", line 101, in <module>
    recruitment_dict = traverse_targets(RH_data, recruitment_dict, query, query)
  File "/data/home/myname/software/Complet-Plus/complet-plus-scripts/relabel_seqs.py", line 71, in traverse_targets
    recruitments = traverse_targets(data, recruitments, target, og_query)
  File "/data/home/myname/software/Complet-Plus/complet-plus-scripts/relabel_seqs.py", line 71, in traverse_targets
    recruitments = traverse_targets(data, recruitments, target, og_query)
  File "/data/home/myname/software/Complet-Plus/complet-plus-scripts/relabel_seqs.py", line 71, in traverse_targets
    recruitments = traverse_targets(data, recruitments, target, og_query)
  [Previous line repeated 995 more times]
  File "/data/home/myname/software/Complet-Plus/complet-plus-scripts/relabel_seqs.py", line 60, in traverse_targets
    if query not in recruitments.keys():
RecursionError: maximum recursion depth exceeded while calling a Python object

And the whole error information: image It seems like the error about recursion. My mmseq2 results contained about 14 million seqs, I don't know if this error was caused by excessive quantity. Thanks!

chassenr commented 1 year ago

Hi @rtn28

I am getting the same error. Uncommenting line 99 in the relabel_seqs.py script also did not help, but rather lead to a segmentation fault (core dumped) error. Any help would be highly appreciated.

Thanks!

Cheers, Christiane

chassenr commented 1 year ago

Hi @JFF1594032292 and @rtn28

I just wanted to let you know that I solved the recursion limit (and segmentation fault error) with the help of this website: Additional to the sys.setrecursionlimit(500000) in line 99 of the relabel_seqs.py script (which in uncommented), it was necessary to include the following 2 commands: resource.setrlimit(resource.RLIMIT_STACK, (-1, -1)) in the line before setting the recursion limit to avoid a segmentation fault at high values of the recursion limit, and import resource at the beginning of the script to make the setrlimit command available. I hope this will also work on your system. ⚠️ Usually there is a reason for the default settings for these values (e.g. to avoid crashes). Changing them may lead to memory issue depending on your system.

Cheers, Christiane