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

Add sampling year coloring #12

Merged
merged 2 commits into from
Aug 22, 2024
Merged

Add sampling year coloring #12

merged 2 commits into from
Aug 22, 2024

Conversation

jameshadfield
Copy link
Member

For builds where we've chosen not to infer a timetree it's still very useful to communicate the sampling date. Here we export the year which forms a nice continuous coloring. (An ordinal coloring would be better but the date range in this dataset means Auspice repeats colors which isn't ideal. Temporal coloring will be better once it accepts YYYY-MM-DD strings, but as of Auspice 2.55 it interprets integers as January 1st.)

We also export the date string, which is shown when clicking on tips is available as a filtering option.

image image
  • Checks pass

For builds where we've chosen not to infer a timetree it's still very
useful to communicate the sampling date. Here we export the year which
forms a nice continuous coloring. (An ordinal coloring would be better
but the date range in this dataset means Auspice repeats colors which
isn't ideal. Temporal coloring will be better once it accepts YYYY-MM-DD
strings, but as of Auspice 2.55 it interprets integers as January 1st.)
Not yet exported as a coloring (year is preferable, see previous commit)
but this allows the sampling date to appear when clicking on tips and
as a filtering option.
@@ -30,7 +31,7 @@ rule export:
--tree {input.tree} \
--metadata {input.metadata} \
--metadata-id-columns {params.strain_id} \
--node-data {input.branch_lengths} {input.nt_muts} {input.aa_muts} \
--node-data {input.branch_lengths} {input.nt_muts} {input.aa_muts} {input.year} \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not asking for a change, just curious

Instead of making another node-data JSON, why not just add a year column to the metadata.tsv that can be used directly as a coloring?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the approach here cleaner to implement, although if other rules used the data I'd have probably gone for modifying the TSV. It should also be trivial to copy & paste into other workflows which would benefit from this. Of course, once Auspice has a proper temporal scale this'll all be removed anyways.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps analogous to avian-flu where we currently add in a column (H5 LABEL) to the TSV but want to switch away from this to a node-data JSON

@jameshadfield jameshadfield merged commit 1df5993 into main Aug 22, 2024
5 checks passed
@jameshadfield jameshadfield deleted the james/year branch August 22, 2024 23:37
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.

4 participants