AuspiceV2 with num_date... for samples only?

Hello! I’m constructing my own AuspiceV2 JSON for reasonably sized subtrees (~1500 sequences) of a tree with >1M sequences and using the wonderful nextstrain.org/fetch/ feature to display it. So far I’ve been doing without num_date, but would like to add it now. The trouble is, I have sample collection dates for most of the 1M sequences, but at this point my branches do not have dates.

When I set display_defaults.distance_measure to “num_date”, the x axis is labeled by date as expected and the samples appear pretty much where I would expect but… there are no branches to click on:


https://nextstrain.org/fetch/hgwdev.gi.ucsc.edu/~angie/num_date_samplesOnly_default_date.json

I’m guessing that’s because Auspice expects the branches to have num_date, but they don’t. And there are many many errors like this in the JS console:

auspice.chunk.other-vendors.bundle.81ff835de92b0a701754.js:2 Error: <path> attribute d: Expected number, " M NaN,16.370246831…".

I guess the right answer would be to run treetime, at least on the extracted subtree for which I’m generating JSON, but I’m hoping there’s something really lightweight and quick (because the subtree extraction and JSON generation is on a web server and I’m short on time) and not too horrible that I can do instead. Would it be just too horrible to, say, just slap a very approximate num_date on each branch, where confidence is [ minOfAllChildMins, minOfAllChildMaxes ] and value is min of child dates (maybe minus some SARS-CoV-2 fudge factor)? Since some samples have no dates or just “2020” I think the min will very quickly be slammed back to Jan. 2020 as I work back from the leaves. And that’s probably why there’s treetime. Well, I will give it a try and see what happens. :grin:

Any ideas / suggestions / objections would be welcome!

Your guess is correct! Try setting "hidden": true on each internal node (not really documented, but the schema may help). I’m not 100% sure this will work but I think it should. Let us know how you get on!

1 Like