Color clade of phylogenetic tree

Dear nextstrain team, how can I color the clades/emerging lineages which I have specified in the file clades.tsv in the phylogenetics tree?

For example, I tried included color.tsv in the my build.yml
colors: /home/leandro/ncov/my_profiles/md_color/colors.tsv


pango_lineage B.1.1 #FF69B4
pango_lineage B.1.1.33 #A0522D
pango_lineage B.1.1.28 #2E8B57
pango_lineage P.2 #FFD700
pango_lineage P.1.2 #D2691E
pango_lineage P.1.4 #696969
pango_lineage P.1.7 #00FFFF
pango_lineage P.1.9 #F4A460
pango_lineage P.1.10 #4B0082

But not worked.

1 Like

By default, we run a script which generates colours for a number of different pieces of metadata (clade_membership, country, division, emerging_lineage, location, pango_lineage, recency, region). This script reflects a specific ordering of values, which we define in defaults/color_ordering.tsv. That ordering includes the pango lineages in your message.

You can define a custom mapping of metadata to colours as per your color.tsv, however you have to include this in your builds.yaml such as

  colors: my_profiles/md_color/colors.tsv

Please note that this will result in all the other custom colours generated by the above script are no longer used, and auspice will use a generic colour scale for these instead, which means that the ordering won’t be as nice! It will also mean that all pango lineages apart from the ones you define are grey.

If you want to keep our ncov-specific colours, but simply change the hex values for a few pango lineages, the easiest may be to write a small script to modify the dataset JSON to redefine them there.