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

Unhandled exception in clades: index error in is_node_in_clade #965

Closed
corneliusroemer opened this issue Jun 7, 2022 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@corneliusroemer
Copy link
Member

Running augur clade I got the following unhandled exception that I didn't know immediately how to debug:

monkeypox-nextclade on  nextclade [$!] via 🅒 nextstrain took 2m16s 
❯ augur clades             --tree results/HPXV1/tree.nwk             --mutations results/HPXV1/nt_muts.json results/HPXV1/aa_muts.json             --clades config/clades.tsv             --output-node-data results/HPXV1/clades.json 2>&1 | tee
Validating schema of 'results/HPXV1/aa_muts.json'...
Traceback (most recent call last):
  File "/usr/local/Caskroom/mambaforge/base/envs/nextstrain/bin/augur", line 10, in <module>
    sys.exit(main())
  File "/usr/local/Caskroom/mambaforge/base/envs/nextstrain/lib/python3.8/site-packages/augur/__main__.py", line 10, in main
    return augur.run( argv[1:] )
  File "/usr/local/Caskroom/mambaforge/base/envs/nextstrain/lib/python3.8/site-packages/augur/__init__.py", line 75, in run
    return args.__command__.run(args)
  File "/usr/local/Caskroom/mambaforge/base/envs/nextstrain/lib/python3.8/site-packages/augur/clades.py", line 280, in run
    clade_membership = assign_clades(clade_designations, all_muts, tree, ref)
  File "/usr/local/Caskroom/mambaforge/base/envs/nextstrain/lib/python3.8/site-packages/augur/clades.py", line 217, in assign_clades
    if is_node_in_clade(clade_alleles, node, ref):
  File "/usr/local/Caskroom/mambaforge/base/envs/nextstrain/lib/python3.8/site-packages/augur/clades.py", line 143, in is_node_in_clade
    state = ref[gene][pos]
IndexError: list index out of range

All files needed to reproduce are in the following tar archive (named .txt so I can upload to Github).
reproduce.tar.txt

Unpack through: tar xf reproudce.tar.txt --directory .

@corneliusroemer corneliusroemer added the bug Something isn't working label Jun 7, 2022
@jameshadfield
Copy link
Member

Augur clades neds quite a bit of work under the hood to make it more robust and to consider & document edge-cases in behavior. I wrote a bit about this at #735. After reading the code I'm not surprised with bugs like the one described here. I think we'd be better served by a major lift on the code rather than a small patch over this particular bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

No branches or pull requests

2 participants