# View bootstrap trees with augur export

**URL:** <https://nextstrain.discourse.group/t/view-bootstrap-trees-with-augur-export/86>\
**Category:** Help and Getting Started\
**Created:** [July 23, 2020, 10:32pm UTC](https://nextstrain.discourse.group/t/view-bootstrap-trees-with-augur-export/86 "2020-07-23T22:32:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mesti90](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@mesti90](https://nextstrain.discourse.group/u/mesti90)\
**Post date:** [July 23, 2020, 10:32pm UTC](https://nextstrain.discourse.group/t/view-bootstrap-trees-with-augur-export/86/1 "2020-07-23T22:32:59Z")

</div>

I want to build and view a bootstrap tree.  
Instead of augur tree I used iqtree2, then on the resulting tree I applied augur refine, augur ancestral, augur translate and augur traits.  
When building a normal (not bootstrap) tree, everything was OK.  
With the bootstrap tree, everything went smoothly, but augur export raised the following error message:

```
ERROR: cannot find branch length information for NODE_00010120.00 #NB this is an internal node on the tree

Traceback (most recent call last):
  File "/usr/bin/miniconda3/envs/nextstrain/bin/augur", line 8, in <module>
    sys.exit(main())
  File "/usr/bin/miniconda3/envs/nextstrain/lib/python3.6/site-packages/augur/ __main__.py", line 10, in main
    return augur.run( argv[1:] )
  File "/usr/bin/miniconda3/envs/nextstrain/lib/python3.6/site-packages/augur/ __init__.py", line 74, in run
    return args. __command__.run(args)
  File "/usr/bin/miniconda3/envs/nextstrain/lib/python3.6/site-packages/augur/export.py", line 22, in run
    return run_v2(args)
  File "/usr/bin/miniconda3/envs/nextstrain/lib/python3.6/site-packages/augur/export_v2.py", line 866, in run_v2
    data_json["tree"] = convert_tree_to_json_structure(T.root, node_attrs)
  File "/usr/bin/miniconda3/envs/nextstrain/lib/python3.6/site-packages/augur/export_v2.py", line 84, in convert_tree_to_json_structure
    node_struct["children"].append(convert_tree_to_json_structure(child, metadata, div=cdiv))
UnboundLocalError: local variable 'cdiv' referenced before assignment

```

The commands I use:

```
iqtree2 -s masked_alignment.fasta -m GTR -T 70 -fast -redo -b 100

augur refine --tree tree_raw.nwk --alignment masked_alignment.fasta --metadata augur_filtered.metadata.tsv --output-tree tree.nwk --output-node-data branch_lengths.json --timetree --coalescent skyline --date-confidence --no-covariance --date-inference marginal --clock-filter-iqd 4 --clock-rate 0.0008 --clock-std-dev 0.0004 > augur.refine.log 2> augur.refine.err

augur ancestral --tree tree.nwk --alignment masked_alignment.fasta --output-node-data nt_muts.json --inference joint > augur.ancestral.log 2> augur.ancestral.err

augur translate --tree tree.nwk --ancestral-sequences nt_muts.json --reference-sequence config/MN908947.3.genbank --output-node-data aa_muts.json --alignment-output aligned_translated_%GENE.faa > augur.translate.log 2> augur.translate.err

augur traits --tree tree.nwk --metadata augur_filtered.metadata.tsv --output-node-data traits.json --columns region country --confidence > augur.traits.log 2> augur.traits.err

augur export v2 --tree tree.nwk --title Title --metadata augur_filtered.metadata.tsv --node-data branch_lengths.json traits.json nt_muts.json aa_muts.json --colors colors.tsv --lat-longs config/long_lat_ext.tsv --auspice-config config/auspice_config.json --output auspice/iqtree2_bs100.json --maintainers XY --build-url 0.0.0.0 --description config/description.md --panels tree map entropy frequencies > augur.export.log 2> augur.export.err
```

---

<div class="post-metadata">

**Author:** ![rneher](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/rneher/32/20_2.png) [@rneher](https://nextstrain.discourse.group/u/rneher)\
**Post date:** [July 24, 2020, 9:24pm UTC](https://nextstrain.discourse.group/t/view-bootstrap-trees-with-augur-export/86/2 "2020-07-24T21:24:05Z")

</div>

This is difficult to answer without seeing `tree_raw.nwk` and possibly `branch_lengths.json`. Do these files contain all the branch lengths necessary to compute divergence? Could you compare them when you with and without bootstrap?

---

<div class="post-metadata">

**Author:** ![mesti90](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@mesti90](https://nextstrain.discourse.group/u/mesti90)\
**Post date:** [July 28, 2020, 12:34pm UTC](https://nextstrain.discourse.group/t/view-bootstrap-trees-with-augur-export/86/3 "2020-07-28T12:34:46Z")

</div>

@meher I uploaded the raw tree, the refined tree and the branch lengths for both trees with and without bootstrap to here:  
[https://drive.google.com/drive/folders/1b4HF13-JStlXfEcmAapfeb69lD4C8QoH?usp=sharing](https://drive.google.com/drive/folders/1b4HF13-JStlXfEcmAapfeb69lD4C8QoH?usp=sharing)  
I really appreciate your help.

---

<div class="post-metadata">

**Author:** ![rneher](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/rneher/32/20_2.png) [@rneher](https://nextstrain.discourse.group/u/rneher)\
**Post date:** [August 1, 2020, 9:40am UTC](https://nextstrain.discourse.group/t/view-bootstrap-trees-with-augur-export/86/4 "2020-08-01T09:40:45Z")

</div>

The problem seems to be that bootstrap values are not parsed correctly by Biophyton when internal nodes have names. This results in node names like NODE\_000358854.00 where the last 5 digits stem from the bootstrap confidence values. This could be fixed with a script that sanitizes this, but i am afraid there is no easy fix. it also depends a lot on what you are planning to do with these bootstrap values…
