How to get the correct time axis when using augur refine and timetree?

Hi,
I’m running this command:
Shell command:
augur refine --tree nextstrain_results/tree_raw.nwk --alignment nextstrain_results/aligned.fasta --metadata phylogeny/genotypes_combined/combined_metadata.tsv --output-tree nextstrain_results/tree.nwk --output-node-data nextstrain_results/branch_lengths.json --timetree --coalescent opt --date-confidence --date-inference marginal --clock-filter-iqd 4 --clock-rate 0.00079 --root best

But I’m struggling to correctly scale my x-axis when visualizing the tree.nwk using R and ape. How can I obtain a tree similar to the one downloaded from the auspice viewer that has branch lengths on a time scale?

Thanks, Jon

In nextstrain_results/branch_lengths.json each node (including internal nodes) will have a numdate (numeric date) value which you can use to plot on a temporal x-axis.

Best, james

I understand. Thanks, I’ll check it out!

This works nicely, thanks!
So tree.nwk output by augur refine already has time-calibrated branch lengths? And the numdate in the branch_lengts.json is something calculated outside of TimeTree by augur refine?

numdate comes form TreeTime, but augur refine is the wrapper which exports it in the JSON format. The “refined” newick branch lengths are in calendar time, measured in units of clock rate. If you want subs/site divergence you should use the mutation_length property in the JSON (which is what augur export / Auspice use).

1 Like