# Greengenes Tree Download With Branch Lengths

**URL:** https://forum.qiime2.org/t/greengenes-tree-download-with-branch-lengths/3329
**Category:** User Support
**Tags:** taxonomy, greengenes
**Created:** [March 6, 2018, 9:11pm UTC](https://forum.qiime2.org/t/greengenes-tree-download-with-branch-lengths/3329 "2018-03-06T21:11:25Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![wasade](https://forum.qiime2.org/user_avatar/forum.qiime2.org/wasade/32/2317_2.png) [@wasade](https://forum.qiime2.org/u/wasade)
#### Post date: [March 7, 2018, 6:44am UTC](https://forum.qiime2.org/t/greengenes-tree-download-with-branch-lengths/3329/5 "2018-03-07T06:44:46Z")

</div>

Hi @Stephanieorch,

The issue comes from the reroot performed on that release of Greengenes where the added branch did not get set with a length (connecting "k\_\_Bacteria" to a common vertex with "k\_\_Archaea"). In QIIME1, this missing length was not an issue as PyCogent's `PhyloNode` interpreted a missing length as 0.0 when computing phylogenetic metrics so this went unnoticed at the time of release. One way to solve this is to open the tree, set a length, and write it out. An example of doing so is below using Python and saving a `Phylogeny[Rooted]` artifact.

```auto
In [1]: import skbio

In [2]: t = skbio.TreeNode.read('97_otus.tree')

In [3]: for n in t.traverse():
   ...: if n.length is None:
   ...: n.length = 0.0
   ...:

In [4]: import qiime2

In [5]: ar = qiime2.Artifact.import_data('Phylogeny[Rooted]', t)

In [6]: ar.save('97_otus.qza')
Out[6]: '97_otus.qza'

```

Best,  
Daniel

---

_[View the full topic](https://forum.qiime2.org/t/greengenes-tree-download-with-branch-lengths/3329)._
