ncov icon indicating copy to clipboard operation
ncov copied to clipboard

Gray out early clades

Open trvrb opened this issue 6 months ago • 0 comments

Description of proposed changes

This PR is attempting to solve the same problem as #1129, but in a different fashion. In this case, we keep the subsampling in the 6m, 2m and 1m builds the same as before and so keep the long contextual tail going from 6m / 2m / 1m back to the beginning of the pandemic. However, I've added new functionality to the assign-colors.py script that takes in a --clade-recency parameter. This specifies the number of months back to look for circulating clades. So for example, --clade-recency 6 would use tips in the previous 6 months and only keep clade_membership in this time period. I added parameter logic to specify --clade-recency of 6 vs 2 vs 1 for 6m, 2m and 1m builds. The all-time builds include all clades.

Here's some comparisons.

global/6m

Live

Screenshot 2024-07-26 at 6 24 11 PM

PR

Screenshot 2024-07-26 at 6 25 26 PM

global/2m

Live

Screenshot 2024-07-26 at 6 26 20 PM

PR

Screenshot 2024-07-26 at 6 26 50 PM

global/1m

Live

Screenshot 2024-07-26 at 6 27 46 PM

PR

Screenshot 2024-07-26 at 6 28 20 PM

I think this is a big improvement. We no longer have 3 highly similar similar shades of red for currently circulating clades. It also seems semantically appropriate to gray out these early clades to correspond to "context". This the same thing we do for regions outside of the focal region ala south-america/6m?c=country

My preference would be to merge this PR (after code review) and reconsider the previous time-based sampling PR #1129. I think we'll eventually need to move the min_date up from 2020, but with clade colors fixed it's not so urgent. Additionally, having this strategy of gray clades outside of focal window would work with alternative time-based sampling windows.

Testing

Tested locally and via trial build (URLs linked above). However, this adds a new parameters.yaml option. I tested and it shouldn't break existing builds that don't specify colors:clade_recency, but attention here wouldn't hurt.

Release checklist

If this pull request introduces new features, complete the following steps:

  • [ ] Update docs/src/reference/change_log.md in this pull request to document these changes by the date they were added.

trvrb avatar Jul 27 '24 01:07 trvrb