Zero value for coloring in nextstrain

Hello nextstrain team,

my coloring values are 21 elements from 0 to 1 in increments of 0.05.

every single values but 0 displays well. I mean 0.05, 0.1, 0.85 etc are all OK.

In the result file(auspice.json), 0 is written as “0.0” and legend displays “0”.

so I added coloring line like below to colors.tsv file.

index 0 #ff0000
index 0.05 #…
index 0.1 #…
index 0.15 #…
index 0.95 #…
index 1.0 #…

index 0.0 #ff0000

but both(0, 0.0) are all ignored. auspice uses self generated color scheme with 0(legend label).

So my question is that ZERO value is not working correctly by auspice coloring?

Thank you.

Hi @duxx,

It sounds like your colors.tsv file is not being used. Since this field only contains numeric values, it may be automatically assigned to a “continuous” type and it’s not currently possible to specify colors for continuous data.

My suggestion would be to specifically designate this field to the “ordinal” coloring type within your Auspice config JSON. Then the colors from your colors.tsv will be applied. The values in your colors.tsv should exactly match the values in your auspice.json, so the correct value should be 0.0.

Best,
Jover

@duxx could you post the section of the auspice config file which specifies this (if you have one) or (even better) the dataset JSON if it’s public?

You imply the non-zero values are using the hex codes you provide, so my guess is that there’s a :bug: in augur/auspice which is treating the zero as a falsy (i.e. invalid) value and that’s why it’s not working.

I totally agree with you.
I try other way to get around this. thank you.

I don’t think my colors.tsv is not applied. because only 0 value is not applied, the other values are all applied.

I tried continuous type on coloring section, then auspice generate a new legend below.
mine was 0 0.05 0.1 0.15…
but auspice generate 0 0.111 0.222 0.333…

That’s not what I want anyway.
Thank you for your answer.

You imply the non-zero values are using the hex codes you provide, so my guess is that there’s a :bug: in augur/auspice which is treating the zero as a falsy (i.e. invalid) value and that’s why it’s not working.

I was able to trace this to a bug in augur export. I’ve implemented a fix for this in Export zero value colors by joverlee521 · Pull Request #1100 · nextstrain/augur · GitHub

1 Like