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

ENH: Augur clades does not throw helpful error when no --clades is passed #1153

Closed
corneliusroemer opened this issue Feb 17, 2023 · 3 comments

Comments

@corneliusroemer
Copy link
Member

corneliusroemer commented Feb 17, 2023

Context

Augur clades doesn't seem to throw a helpful error when required options are missing.

Also, the documentation doesn't seem to mention which options are required.

E.g. (from a user who didn't pass any --clades option:

augur clades --tree results/tree.nwk --mutations results/nt_muts.json --reference data/reference.fasta --output-node-data augur_node_data.json
Validating schema of 'results/nt_muts.json'...
Traceback (most recent call last):
  File "/nextstrain/augur/augur/__init__.py", line 67, in run
    return args.__command__.run(args)
  File "/nextstrain/augur/augur/clades.py", line 280, in run
    clade_designations = read_in_clade_definitions(args.clades)
  File "/nextstrain/augur/augur/clades.py", line 51, in read_in_clade_definitions
    sep='\t' if clade_file.endswith('.tsv') else ',',
AttributeError: 'NoneType' object has no attribute 'endswith'

Also confusingly, it can appear to users that the error happened in the validation step - because the error happens right after the line: Validating schema of 'results/nt_muts.json'..., that should probably start with INFO: or otherwise be separated better.

Would be good if the docs for augur clades command linked to: https://docs.nextstrain.org/projects/augur/en/stable/faq/clades.html#labeling-clades

@Wen1953
Copy link

Wen1953 commented Apr 19, 2023

I have the same problem running nextstrain clades:

augur clades --tree refine_tree.nwk --mutations ancestral.json translate.json --output-node-data clades.json
Validating schema of 'ancestral.json'...
Validating schema of 'translate.json'...
Traceback (most recent call last):
File "/home/veronica/miniconda3/lib/python3.9/site-packages/augur/init.py", line 67, in run
return args.command.run(args)
File "/home/veronica/miniconda3/lib/python3.9/site-packages/augur/clades.py", line 280, in run
clade_designations = read_in_clade_definitions(args.clades)
File "/home/veronica/miniconda3/lib/python3.9/site-packages/augur/clades.py", line 51, in read_in_clade_definitions
sep='\t' if clade_file.endswith('.tsv') else ',',
AttributeError: 'NoneType' object has no attribute 'endswith'

I'm using https://docs.nextstrain.org/projects/augur/en/stable/faq/clades.html#labeling-clades as reference but it doesn't work. @jameshadfield @corneliusroemer some idea?

@jameshadfield
Copy link
Member

@Wen1953 - you are missing the clades TSV definition file in your call to augur clades. (PR #1199 will make this error clearer.)

@Wen1953
Copy link

Wen1953 commented Apr 19, 2023

Thanks @jameshadfield. It works!
I follow this instruction to construct TSV format > https://docs.nextstrain.org/projects/augur/en/stable/faq/clades.html#labeling-clades

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

3 participants