Improve temporal colors#3
Open
jameshadfield wants to merge 2 commits into
Open
Conversation
Without this the `augur ancestral` step in the nextclade pipeline fails: "KeyError: 'GPC'". Augur ancestral's reading of GenBank files is: > for 'CDS' features use the locus_tag or the gene. If neither, then silently ignore [1] [1] https://github.com/nextstrain/augur/blob/4b9397bacea57a2436267c1312c075e925201191/augur/io/sequences.py#L455
The previous (default) date categorical scale didn't define a custom color scale so auspice sorted the values by the number of occurrences on the tree and generated a linear scale from these values. This resulted in a non-chronological ordering and didn't emphasize the new data which is particularly relevant. One improvement is to just use a "temporal" scale type, but here we use a custom approach which projects the observed date range into a our canonical rainbow color scale non-linearly in order to space out the colors of more recent sequences.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current situation
collectionDateformats of of (empty string), YYYY, YYYY-MM-DDChanging to scale type "temporal" improves things, but only a little bit:
This PR
We use a script to projects the observed date range into our canonical rainbow color scale non-linearly
in order to space out the colors of more recent sequences.
(Long term we can move this script somewhere else, but I think this is appropriate for now)