Skip to content

Commit

Permalink
[tmp] [genome build] fix division color assignment
Browse files Browse the repository at this point in the history
Closes #131
  • Loading branch information
jameshadfield committed Feb 20, 2025
1 parent 77cc11a commit e9dea34
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/assign-colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ def index_of(search_list, search_value, not_found_value):
observations.sort(key=lambda x: index_of(ordering[category], x, len(ordering[category])))
if (missing:=set(observations) - set(ordering[category])):
print(f"WARNING: For trait {category} we encountered {len(missing)} value(s) not present in the ordering TSV: {missing}", file=stderr)
# -- temporory --
# reduce the values we provide colorings for to just those present in the orderings TSV
# (values pruned out here will still be shown in Auspice, but they'll be grey)
# This addresses bug <https://github.com/nextstrain/avian-flu/issues/131> where
# we had more division values than colors and thus the pipeline failed
# Hopefully the underlying cause will be fixed by improvements in how we ingest data, e.g.
# <https://github.com/nextstrain/augur/issues/1578>
# and we can remove this restriction.
observations = [obs for obs in observations if obs in ordering[category]]
print(f"These will not be assigned colors and thus will appear grey in Auspice", file=stderr)
try:
hexes = schemes[len(observations)]
except KeyError:
Expand Down

0 comments on commit e9dea34

Please sign in to comment.