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

Allow config/validate of branch_label in display_defaults #445

Merged
merged 3 commits into from
Feb 26, 2020

Conversation

emmahodcroft
Copy link
Member

As raised in the issue #444. We haven't integrated anything about the display_defaults property branch_label (which is available now in auspice) into augur.

This is mostly because we don't currently have any way in augur to generate many kinds of branch labels - only clade and aa. If clade is available, it's shown by default, otherwise nothing is shown.

However, as raised in the issue above, users may want to specify that aa is shown by default, or be able to specify that even though clade is available, nothing should be shown by default.

This PR gives a simple fix just to allow the inclusion of branch_label into v2-style 'config' files, allows these to be validated, allows them to be exported by export v2 and again, allows them to validate.

Currently the only options permitted are aa, clade, and none. (None doesn't really do anything, but if you specify any non-valid entry, auspice simply displays nothing for branch labels. So, this can be made semi-legit by just restricting users to these three options.)

This should be updated to allow pretty much any value (excepting some special characters, probably) when we get around to integrating other ways of labelling branches into augur.

@jameshadfield
Copy link
Member

Thanks @emmahodcroft -- I added a commit so that if a default branch label is set in the JSON then we check it is defined on at least one node in the tree rather than forcing it to be aa, clade, or none. (And I allow the special case of setting the default label to none)

This allows valid JSONs to validate, although I realise augur export can't yet produce them!

Also added a test build to check this.

If a default branch label is set in the JSON then ensure it is defined on at least one node in the tree. We allow the special case of setting the default label to `none`. Note that `augur export` currently only exports clade and/or aa labels, but we should still be able to validate JSONs made somewhere else.

A test build is added.
@emmahodcroft
Copy link
Member Author

Great idea @jameshadfield - thank you!

Allows the test runner to complete as this calls `snakemake clean`
@jameshadfield jameshadfield merged commit a73ad8f into master Feb 26, 2020
@jameshadfield jameshadfield deleted the branch_label_allow branch February 26, 2020 22:18
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

Successfully merging this pull request may close these issues.

2 participants