Greengenes Tree Download With Branch Lengths

How can I get the 97% GG tree that has branch lengths? Also is there a version I can download that is already a qza file? Thanks!

Good afternoon Stephanie,

On the resources page there is a link to the newest version of greengenes, which includes trees and branch lengths. At least it should... Are you getting an error?

That's a great idea! We should totally include that with the default databases.

Colin

Hi Colin,

I’m still getting the branch error. I downloaded 13_8 version of greengenes. Then I imported it with this command:

qiime tools import \
> --input-path 97_otus.tree \
> --output-path unrooted-tree.qza \
> --type 'Phylogeny[Rooted]'

But when I tried to run alpha rarefaction using the new .qza tree it didnt work and I got the " All non-root nodes in tree must have a branch length" error.

Thanks for posting your command. The example on the Importing page uses
--type 'Phylogeny[Unrooted]' while your script says
--type 'Phylogeny[Rooted]'

Can you try passing --type 'Phylogeny[Unrooted]' instead, and see if the alpha rarefaction works?

Colin

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

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.