-
Notifications
You must be signed in to change notification settings - Fork 130
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
tree: RecursionError in writing tree to Newick #328
Comments
Yes. This is a known problem and fixed via setting AUGUR_RECURSION_LIMIT. |
Thought's on a augur-wide catch for this & a nice error message? Something like
|
yes. that is a good idea. |
Thanks both. Is there a reason that augur does not just use a default recursion limit that can be overridden by the environment value? Furthermore, I'm not sure I follow why this needs to exist in environment at all. We should just be able to have a sensible default, right? I must be missing something. Is there discussion of this that I can reference? I didn't see much in #307. |
I am not sure I understand your question. But here are my 2c. There is a default and it is used by augur, but I am not sure whether this is an env var.
The recursion limit exists to guard against infinite recursions. So even if there was a way to set is globally, it is probably not a good idea. Hence we opted for an augur specific environment variable that can be set for example in the Snakefile. I guess setting a default to 10000 wouldn't hurt and would reduce the number of times this comes up -- until people start building bigger trees. |
Thanks so much for the detailed explanation @rneher. I think I finally understand. Two thoughts:
|
for what it's worth, @evogytis & I had this a lot in parsing BEAST MCC trees as well |
I think @jameshadfield's suggestion above to improve error message (#328 (comment)) is great. Otherwise I'd consider this issue closed. Thanks for the explanations. |
Will do this now 👍 |
But what if there were a global pandemic with an unprecedented amount of sequences and extremely low diversity? Would that be a time when the default might be too low? |
`newickize` can [overflow the python stack for very deep trees](nextstrain/augur#328). This is an alternate implementation that uses a deque (as a stack) to store the tree data. Although this is the same O(N) in terms of storage, the amount of data stored per function call depth in python is significantly higher.
`newickize` can [overflow the python stack for very deep trees](nextstrain/augur#328). This is an alternate implementation that uses a deque (as a stack) to store the tree data. Although this is the same O(N) in terms of storage, the amount of data stored per function call depth in python is significantly higher.
`newickize` can [overflow the python stack for very deep trees](nextstrain/augur#328). This is an alternate implementation that uses a deque (as a stack) to store the tree data. Although this is the same O(N) in terms of storage, the amount of data stored per function call depth in python is significantly higher.
`newickize` can [overflow the python stack for very deep trees](nextstrain/augur#328). This is an alternate implementation that uses a deque (as a stack) to store the tree data. Although this is the same O(N) in terms of storage, the amount of data stored per function call depth in python is significantly higher.
`newickize` can [overflow the python stack for very deep trees](nextstrain/augur#328). This is an alternate implementation that uses a deque (as a stack) to store the tree data. Although this is the same O(N) in terms of storage, the amount of data stored per function call depth in python is significantly higher.
I encountered the same error and adjusted AUGUR_RECURSION_LIMIT. However, iqtree's .ckp.gz checkpoint file seems to have been removed so the tree building has to restart. Is there any way to make it so that the checkpoint file is retained until after all the code executes? |
@DanLesman Relevant code is: Lines 184 to 194 in 4c474a9
I think we'd be receptive to a patch exposing the |
I'm getting this error when I run: treetime clock --tree new_tree_2.nwk --dates dates.csv --sequence-len 29903 --clock-filter 4 File "/analyses/software/miniconda3/lib/python3.7/site-packages/Bio/Phylo/NewickIO.py", line 300, in |
@jsan4christ As noted above, you can set the
|
Thanks @tsibley, tried that to no avail...even set it to 1 billion and the error is exactly the same. Like treetime does not seem to use the option AUGUR_RECURSION_LIMIT. I also tried removing my nextstrain environment and recreating it but that didn't help too. In recreating it plus re-installing treetime which is now up from version 0.8.6 to 0.9.1 but that too did not help. |
@jsan4christ Oh, sorry, I completely missed you were running the |
I get you. thanks for clarifying. I will go ahead and file the issue. |
We've had to use the `AUGUR_RECURSION_LIMIT` environment variable to bump the recursion limit for SARS-CoV-2 builds¹, mpox builds², and our `nextstrain-jobs` definition in AWS Batch. From a general search of the envvar across GitHub³, 10,000 looks like the default that others use as well (although this may be influenced by our discussions⁴). ¹ nextstrain/ncov#690 ² nextstrain/mpox#150 ³ https://cs.github.com/?scopeName=All+repos&scope=&q=AUGUR_RECURSION_LIMIT%3D ⁴ #328
We've had to use the `AUGUR_RECURSION_LIMIT` environment variable to bump the recursion limit for SARS-CoV-2 builds¹, mpox builds², and our `nextstrain-jobs` definition in AWS Batch. From a general search of the envvar across GitHub³, 10,000 looks like the default that others use as well (although this may be influenced by our discussions⁴). ¹ nextstrain/ncov#690 ² nextstrain/mpox#150 ³ https://cs.github.com/?scopeName=All+repos&scope=&q=AUGUR_RECURSION_LIMIT%3D ⁴ #328
I've encountered the following error when running flu trees for H3N2 MP segment. You should be able to reproduce this by running:
with this supplied
test.fasta
. IQTREE runs just fine and produces an apparently perfectly valid Newick tree (at least when viewed in FigTree), available astest.nwk
.However,
augur tree
errors out on line 422 (https://github.com/nextstrain/augur/blob/master/augur/tree.py#L422) with:Something odd with writing out this tree via
Bio.Phylo
. I believe this is stochastic error and will resolve itself when I rerun subsampling, but still thought I should document it here.I tried upgrading BioPython to 1.73 as a simple fix to no avail.
The text was updated successfully, but these errors were encountered: