Hi Mike – I think there’s two slightly different questions being asked so I’ll answer in two parts!
- How to define how auspice looks when loaded
For a given dataset within auspice, there is a large space of different views a user can take the viz in (e.g. changing coloring, changing the tree layout, toggling on/off different panels, zooming into the tree, selecting a time slice). A dataset (JSON) can define the defaults for a few of these and URL queries can define a lot of them – these are best explained in the “View Settings” doc page you’ve found or by looking at the dataset JSON schema. Feel free to ask questions here too!
Note that such a view must be available within the dataset – for instance, you can’t set a default coloring to “age” if age doesn’t exist as a coloring in the dataset JSON.
- How to make certain options (e.g. colorings) available in Auspice
In theory, the dataset JSON schema (link above) defines how one should define a particular coloring in the JSON for auspice to be able to read it. In practice, this boils down to the augur export
command which is what produces the JSON file in most situations. The docs could be better here, but a good place to start is here – in essence augur export
needs to be told which bits of metadata and generated data should be exported as valid colorings, and what names they should be given. This approach allows augur export
to be agnostic about the tools used to generate such data.
The clades example is a good one as it’s one of the most complex (due to historical reasons). If you are running augur clades
then this will produce an intermediate JSON which associates nodes on the tree with a “clade_membership” value. Normally, for this to be in the resulting dataset JSON, two things are required:
- (i) this file is provided as an input to
augur export
's --node-data
argument
- (ii) a entry in the config JSON (supplied to
augur export
's --auspice_config
argument) along the lines of
"colorings": [
{
"key": "clade_membership",
"title": "Clade",
"type": "categorical"
}
]
BUT clades is an exeption to the general rule in that part (ii) is not needed – augur export
will automagically create a coloring for Clade if it is given a suitable node data JSON which defines “clade_membership” values. This is why you don’t see such an entry in the config JSON behind nextstrain.org/ncov/global, but clade is indeed a valid coloring in that dataset.
Please don’t hesitate to ask any further questions!