Greengenes Tree Download With Branch Lengths

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.

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

6 Likes