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: Add augur colors subcommand based on assign-colors.py scripts #1185

Open
corneliusroemer opened this issue Mar 17, 2023 · 4 comments
Open
Labels
enhancement New feature or request

Comments

@corneliusroemer
Copy link
Member

We discussed adding more reusable components to augur at our meeting yesterday.

Working on ncov PR nextstrain/ncov#1050 I encountered some limitations of the assign-colors.py script. This script could benefit from new features.

The script is used in a lot of places, it could be a prime candidate for augurification: see where it is used https://github.com/search?type=code&auto_enroll=true&q=assign-colors.py

The ncov version is here: https://github.com/nextstrain/ncov/blob/master/scripts/assign-colors.py

Some features to possibly add to the existing script:

  • Ability to ignore metadata (columns) for certain colorings
  • Ability to use node data jsons in place of metadata (particularly useful for clades jsons)
@corneliusroemer
Copy link
Member Author

Just rediscovered that augur export v2 doesn't accept color_ordering.tsv despite this being a pervasive config file pattern for current workflows. Another argument for augur colors

@huddlej
Copy link
Contributor

huddlej commented Sep 19, 2023

I just reinvented the wheel a bit in the seasonal flu repo with a similar command to generate a custom color scale in an Auspice config JSON. Thanks to @joverlee521 for reminding me that this is a more general need across pathogen workflows!

I can see how it's useful to get different output types like an Auspice config JSON color scale or a colors TSV file, depending on what you're trying to do. It's also useful to limit the values that get assigned colors to a subset of what appears in a given analysis. One could imagine supporting both an opt-in approach like the script I linked to above where the user specifies the values that should get colors and an opt-out approach where the user specifies the values that should not get assigned colors.

@joverlee521
Copy link
Contributor

During discussion today, we floated the idea of vendoring the color script similar to how we vendor nextstrain/ingest scripts since assign-colors.py feels a little too ad-hoc to officially release as an augur command.

@victorlin
Copy link
Member

Copying from nextstrain/avian-flu#102 (comment) for visibility.

Additional modification to consider:

- line.lstrip().rstrip()
+ line.strip()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

No branches or pull requests

4 participants