Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum Depth? #9

Closed
yashlal opened this issue Aug 24, 2021 · 2 comments
Closed

Maximum Depth? #9

yashlal opened this issue Aug 24, 2021 · 2 comments

Comments

@yashlal
Copy link

yashlal commented Aug 24, 2021

When trying to run DG on a sequence that is 1448 base pairs long, I encounter the following error:
RecursionError: maximum recursion depth exceeded in comparison

with the traceback:

Traceback (most recent call last):
File "C:\Users\Yash Lal\Desktop\Coevolution-Informatics\playground2.py", line 5, in
v = dg(s)
File "C:\Users\Yash Lal\AppData\Local\Programs\Python\Python39\lib\site-packages\seqfold\fold.py", line 89, in dg
structs = fold(seq, temp)
File "C:\Users\Yash Lal\AppData\Local\Programs\Python\Python39\lib\site-packages\seqfold\fold.py", line 69, in fold
v_cache, w_cache = _cache(seq, temp)
File "C:\Users\Yash Lal\AppData\Local\Programs\Python\Python39\lib\site-packages\seqfold\fold.py", line 161, in _cache
_w(seq, 0, n - 1, temp, v_cache, w_cache, emap)
File "C:\Users\Yash Lal\AppData\Local\Programs\Python\Python39\lib\site-packages\seqfold\fold.py", line 198, in _w
w1 = _w(seq, i + 1, j, temp, v_cache, w_cache, emap)
File "C:\Users\Yash Lal\AppData\Local\Programs\Python\Python39\lib\site-packages\seqfold\fold.py", line 198, in _w
w1 = _w(seq, i + 1, j, temp, v_cache, w_cache, emap)
File "C:\Users\Yash Lal\AppData\Local\Programs\Python\Python39\lib\site-packages\seqfold\fold.py", line 198, in _w
w1 = _w(seq, i + 1, j, temp, v_cache, w_cache, emap)
[Previous line repeated 989 more times]
File "C:\Users\Yash Lal\AppData\Local\Programs\Python\Python39\lib\site-packages\seqfold\fold.py", line 191, in _w
if w_cache[i][j] != STRUCT_DEFAULT:
File "C:\Users\Yash Lal\AppData\Local\Programs\Python\Python39\lib\site-packages\seqfold\fold.py", line 24, in eq
return self.e == other.e and self.ij == other.ij
RecursionError: maximum recursion depth exceeded in comparison

Is there anything I can do to make dg work with such a long sequence?

Thank you!

@jjti
Copy link
Collaborator

jjti commented Sep 11, 2021

You should be able to change that setting: https://stackoverflow.com/a/3323013

In theory I should also be able to unwind the recursive and have it iterate without recursion, but that's a re-write I don't have time for the in very short-term.

I just updated the README with a note about using pypy3 (JIT interpreter) which may also help you with sequences as large as that one: https://github.com/Lattice-Automation/seqfold

@yashlal
Copy link
Author

yashlal commented Sep 11, 2021

Thank you so much for the help!

@yashlal yashlal closed this as completed Sep 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants