# Tree options layout

**URL:** <https://nextstrain.discourse.group/t/tree-options-layout/1140>\
**Category:** Help and Getting Started\
**Created:** [June 13, 2022, 9:29am UTC](https://nextstrain.discourse.group/t/tree-options-layout/1140 "2022-06-13T09:29:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kelianP](https://avatars.discourse-cdn.com/v4/letter/k/ee59a6/32.png) [@kelianP](https://nextstrain.discourse.group/u/kelianP)\
**Post date:** [June 13, 2022, 9:29am UTC](https://nextstrain.discourse.group/t/tree-options-layout/1140/1 "2022-06-13T09:29:54Z")

</div>

Hi. I’m still submitting my dataset to nextstrain, however I would like to have clock layout available in the tree options panel.(That is not available in my case, see below)

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/nextstrain/original/1X/3d884353cb523439ead9bd83d51ade3834614665.jpeg)

I’m wondering if the attribute “div” in the displayed JSON is the node attribute that allows this layout. In case of augur refine calculates the divergence, I’d like to know if there was a way to use the one calculated from BEAST (Because I’m currently using a BEAST continuous phylogeography, that I’ve discretized to display it using nextstrain.)

Thanks.  
Kélian

---

<div class="post-metadata">

**Author:** ![james](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/james/32/11_2.png) [@james](https://nextstrain.discourse.group/u/james)\
**Post date:** [June 14, 2022, 4:05am UTC](https://nextstrain.discourse.group/t/tree-options-layout/1140/2 "2022-06-14T04:05:49Z")

</div>

Hi @kelianP – yes Auspice uses the presence of `div` on nodes in the JSON to represent a divergence view.

In a typical augur workflow, `augur refine` produces a `branch_lengths.json` which `augur export v2` parses to calculate the `div` and `num_date` attributes on nodes in the final (auspice) JSON. Unfortunately there is a lot of duplication in these files due to changes over the years which can make them hard to interpret! As an example:

```python
# example branch_lengths.json 
  "nodes": {
    NODE_NAME: {
      "mutation_length": 4 # used by `augur export` to calculate (cumulative) divergence
      "branch_length": 4, # not used, but _would be used_ if 'mutation_length' not present
      "clock_length": 0.00017860867215792312, # not used
      "date": "2022-05-01", # not used
      "numdate": 2022.3301369863013, # exported. You could also use "num_date" as the key here.
      "raw_date": "2022-05-01" # not used
    },

# resulting auspice / dataset JSON
  {
    "name": NODE_NAME,
    "node_attrs": {
      "div": 33, # cumulative -- i.e. root -> this node
      "num_date": {
        "value": 2022.3301369863013
      },
      ...

```

It should be enough to provide a custom node-data JSON which defines the `"mutation_length"` for each node in the tree. If there is another node-data file which also defines this value, ensure the file you want to use is specified last (e.g. in `augur export --node-data`).

Let me know if this doesn’t work and I’ll look into it more!

---

<div class="post-metadata">

**Author:** ![kelianP](https://avatars.discourse-cdn.com/v4/letter/k/ee59a6/32.png) [@kelianP](https://nextstrain.discourse.group/u/kelianP)\
**Post date:** [June 16, 2022, 8:56am UTC](https://nextstrain.discourse.group/t/tree-options-layout/1140/3 "2022-06-16T08:56:40Z")

</div>

Hi @james - as you suggested, it is sufficient to provide a custom node data JSON that defines the `"mutation_length"` or the `"branch_length"` for each node in the tree.

Indeed, it is necessary to provide the file containing this data/attributes in the last position of the `augur export --node-data` arguments, and in a separate file from the geographic information of the node data.

Following your approach, I am now able to display the MCC BEAST tree under the clock layout.

Thank you very much for your help.
