# Loading Greengenes tree in iTOL

**URL:** https://forum.qiime2.org/t/loading-greengenes-tree-in-itol/2319
**Category:** User Support
**Tags:** itol, greengenes, tree
**Created:** [December 24, 2017, 6:28pm UTC](https://forum.qiime2.org/t/loading-greengenes-tree-in-itol/2319 "2017-12-24T18:28:21Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Richard\_Rodrigues](https://forum.qiime2.org/user_avatar/forum.qiime2.org/richard_rodrigues/32/4446_2.png) [@Richard\_Rodrigues](https://forum.qiime2.org/u/Richard_Rodrigues)
#### Post date: [December 24, 2017, 6:28pm UTC](https://forum.qiime2.org/t/loading-greengenes-tree-in-itol/2319/1 "2017-12-24T18:28:21Z")

</div>

Hi,

Did anyone figure out the solution for this? Basically, 97\_otus tree can be visualized in ITOL, but it seems the internal ids and annotation already in the tree are not being recognized by ITOL. Adding an external annotation file only shows Archaea, possibly due to limit on tips as someone mentioned above. Finally, how can we display bar charts for genus level using the greengenes trees?

Thanks.

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [December 27, 2017, 4:20pm UTC](https://forum.qiime2.org/t/loading-greengenes-tree-in-itol/2319/3 "2017-12-27T16:20:32Z")

</div>

Hi @Richard_Rodrigues!

> [@Richard\_Rodrigues](#):
>
> Adding an external annotation file only shows Archaea, possibly due to limit on tips as someone mentioned above

We can't really provide support for ITOL, since we don't develop it, but, they have [pretty nice docs](https://itol.embl.de/help.cgi#annot) that demonstrate how to prepare you annotation file.

Using the Moving Pictures dataset, I prepared a phylogenetic tree, with taxonomic annotations, for viewing in ITOL using the following procedure:

1. Export QIIME 2 Artifacts

```bash
$ qiime tools export rooted-tree.qza --output-dir .
$ qiime tools export taxonomy.qza --output-dir .
$ ls
rooted-tree.qza taxonomy.qza taxonomy.tsv tree.nwk

```

1. Prepare annotation file (note, these commands use macOS `sed` --- if you are on a Linux machine you will need to adjust appropriately - you can also use MS Excel or LibreOffice to make this file)

```bash
$ echo $'LABELS\nSEPARATOR TAB\nDATA' > taxonomy.txt
$ sed "1d" taxonomy.tsv | cut -f1,2 >> taxonomy.txt

```

Here is what that file looks like after preparing it following the ITOL docs: [taxonomy.txt](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/flex002/uploads/qiime21/original/1X/3fc4d77bcbfa80e48c17d7ba6eb62e5f2e5e2d91.txt) (97.8 KB)

1. Load the NWK file in ITOL, then add the annotation (`taxonomy.txt`) by dragging-and-dropping onto the rendered tree graphic:  
 ![34 AM](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/1X/822bc88052b1a43ed0085740b4563ba50505a8e3.jpg)

As I mentioned above, we can't really provide support for ITOL, but hopefully this is enough to get you started!

* * *

> [@Richard\_Rodrigues](#):
>
> Finally, how can we display bar charts for genus level using the greengenes trees?

The `taxa barplots` visualization includes a drop-down that allows you to select a taxonomic level to view, here is the Moving Pictures tutorial at the genus level:

 ![02 AM](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/1X/2da6375277e3a58d12de85b7cd5d2e5cc7f279e1.png)

Please note that the "Taxonomic Level" dropdown is set to "Level 6", which corresponds with the genus level in the Greengenes database.

If you haven't had a chance to work through the [Moving Pictures](https://docs.qiime2.org/2017.12/tutorials/moving-pictures/) tutorial, I would highly recommend working through our [Getting Started](https://docs.qiime2.org/2017.12/getting-started/) guide, which will get you geared up for QIIME 2!

Good luck and keep us posted! 🦖

---

<div class="post-metadata">

### Author: ![Richard\_Rodrigues](https://forum.qiime2.org/user_avatar/forum.qiime2.org/richard_rodrigues/32/4446_2.png) [@Richard\_Rodrigues](https://forum.qiime2.org/u/Richard_Rodrigues)
#### Post date: [December 28, 2017, 2:18am UTC](https://forum.qiime2.org/t/loading-greengenes-tree-in-itol/2319/5 "2017-12-28T02:18:40Z")

</div>

Hi Matt,

Thanks for your response. I really appreciate your help, especially considering that these are non-QIIME questions. There seems to be something different about the annotated trees that ITOL (i) cannot show the full tree (ii) is unable to read the annotations in the tree. ITOL developers say it could be the semicolons in the taxonomy (node names) that are not supported in newick format. However, replacing the semicolons didn't work either. Anyways, using the unannotated greengenes trees with a separate annotation file works.

Sorry for not clarifying my question of displaying bar charts for genus level, I meant using it with ITOL. In ITOL, you can display bar charts at the tips of the tree (e.g., [iTOL: Help](https://itol.embl.de/help.cgi#bar)). I was wondering if we have a genus level version of greengenes tree, so I could simply use the genus level taxonomic summary file with the tree to visualize in ITOL.

Thanks again.

-Rich

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [December 28, 2017, 2:35pm UTC](https://forum.qiime2.org/t/loading-greengenes-tree-in-itol/2319/7 "2017-12-28T14:35:01Z")

</div>

> [@Richard\_Rodrigues](#):
>
> using the unannotated greengenes trees with a separate annotation file works.

👍 🎉

> [@Richard\_Rodrigues](#):
>
> Sorry for not clarifying my question of displaying bar charts for genus level, I meant using it with ITOL. In ITOL, you can display bar charts at the tips of the tree (e.g., [iTOL: Help](https://itol.embl.de/help.cgi#bar))

Hmm, sorry, that is definitely outside of my familiarity with ITOL --- perhaps someone else floating around the forum has some thoughts on this.

> [@Richard\_Rodrigues](#):
>
> I was wondering if we have a genus level version of greengenes tree, so I could simply use the genus level taxonomic summary file with the tree to visualize in ITOL.

I don't think this will work, since your Feature IDs will either be a random ID (which the GG DB won't know about) - or the Feature sequence itself, which won't be an exact match to the GG DB sequence.

One option that comes to mind is that you could modify my protocol above to strip off the species level annotation in the taxonomy file (you could split on the semicolons, drop the last column, then rejoin with a semicolon), but I might be misunderstanding what you are trying to accomplish here (my apologies!). Keep us posted!

PS - it would be really cool if ITOL could read QZA files! 🆒

---

<div class="post-metadata">

### Author: ![iletunic](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/i/3da27b/32.png) [@iletunic](https://forum.qiime2.org/u/iletunic)
#### Post date: [January 26, 2018, 2:27pm UTC](https://forum.qiime2.org/t/loading-greengenes-tree-in-itol/2319/9 "2018-01-26T14:27:32Z")

</div>

Hey...

Author of iTOL here... Let me know if I can be of any assistance. Could you send me some example files, and explain what you're trying to visualize?

---

<div class="post-metadata">

### Author: ![iletunic](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/i/3da27b/32.png) [@iletunic](https://forum.qiime2.org/u/iletunic)
#### Post date: [January 30, 2018, 4:41pm UTC](https://forum.qiime2.org/t/loading-greengenes-tree-in-itol/2319/10 "2018-01-30T16:41:58Z")

</div>

OK, the initial support for direct parsing of Qiime files is now in iTOL.  
Before documenting it, I'd appreciate some feedback or ideas on improving/extending it.

Basically, you should create a ZIP file containing \*-tree.qza (either rooted-tree.qza or unrooted-tree.qza) and taxonomy.qza. I also added basic support for parsing taxa-bar-plots.qzv, so this file can be in the zip file as well. Here is an example from your tutorial: [https://itol.embl.de/help/qiime\_example.zip](https://itol.embl.de/help/qiime_example.zip)

This zip file can be uploaded directly through iTOL's upload page (through 'Tree file' file), or into iTOL's personal account (through the project 'Upload tree files').

Taxonomy.qza will be parsed and used to label the tree. Space characters from the taxonomy will be removed. Confidence values from the taxonomy.qza will be extracted into a simple bar chart dataset. Note that actual leaf IDs in the tree will be the values from the taxonomy file, in case further datasets are to be created.

If taxa-bar-plots.qzv file is present, iTOL will parse the level-7.csv (ie. taxonomic level 7), and create a multi-value bar chart dataset with different samples).

Here is an example tree in iTOL, resulting from upload of the example file linked above: [Qiime tree in iTOL](https://itol.embl.de/tree/10111714872921517309828)

Please send feedback and ideas on improving this...

Perhaps Qiime could create an 'itol.qza' file which would contain the tree, taxonomy file and any other data to be visualized? That would save the extra step of having to zip these qzas together...

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [January 31, 2018, 7:24pm UTC](https://forum.qiime2.org/t/loading-greengenes-tree-in-itol/2319/12 "2018-01-31T19:24:13Z")

</div>

Awesome! Thanks so much @iletunic! 🎈

> [@iletunic](#):
>
> I’d appreciate some feedback or ideas on improving/extending it.

Can do! Hopefully some users on the forum will get a chance to take a look at this, too.

> [@iletunic](#):
>
> Perhaps Qiime could create an ‘itol.qza’ file which would contain the tree, taxonomy file and any other data to be visualized? That would save the extra step of having to zip these qzas together…

Instead of zipping, what if users just uploaded their files individually? In my tutorial above, first I uploaded the rooted tree, then I added the taxonomy annotation in another step. One cool thing about provenance is that iTOL can programmatically interrogate the `SemanticType` of each file, that way you don't have to rely on users renaming their files (check out `metadata.yaml` in any artifact for more info).

> [@iletunic](#):
>
> If taxa-bar-plots.qzv file is present, iTOL will parse the level-7.csv (ie. taxonomic level 7), and create a multi-value bar chart dataset with different samples).

This is super cool, but, it might break down for some reference databases that might have more than or less than 7 taxonomic levels (I don't know of any off the top of my head). If iTOL is able to read biom files, another option might be to have users supply taxonomy + their feature table artifacts, that way iTOL can generate the bar plots using the source data (in QIIME 2, QZV files are regarded as "terminal outputs" - they usually represent some final stage in a branch of an analysis, so you can't use a QZV as an input to another QIIME 2 action).

If you would like to continue this chat (the QIIME 2 team would love to!), maybe it makes sense to move this discussion over to [Developer Discussion](https://forum.qiime2.org/c/dev-discussion)?

Thanks so much for putting this together, we are super excited! 🦖

---

<div class="post-metadata">

### Author: ![iletunic](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/i/3da27b/32.png) [@iletunic](https://forum.qiime2.org/u/iletunic)
#### Post date: [February 1, 2018, 2:58pm UTC](https://forum.qiime2.org/t/loading-greengenes-tree-in-itol/2319/14 "2018-02-01T14:58:40Z")

</div>

OK, rewrote it now in a more 'proper' way... I removed the zip file support mentioned in the previous post.

Trees should be uploaded directly as QZA files, and the uploader will automatically parse any tree.nwk file inside.

After the initial upload, the tree will have the original Qiime internal IDs, but I have now added support for direct drag-dropping of QZA files onto the tree. Other iTOL annotation files are processed client side, but QZAs will be uploaded to the server for processing (so that I can implement reading of biom files in the future).

At the moment, only taxonomy files will be processed (FeatureData[Taxonomy]). Leaf labels will be assigned from there, and a bar chart dataset with confidences created.

I'll create a new post in developer section for further discussion.

---

<div class="post-metadata">

### Author: ![ebolyen](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ebolyen/32/11_2.png) [@ebolyen](https://forum.qiime2.org/u/ebolyen)
#### Post date: [February 1, 2018, 3:00pm UTC](https://forum.qiime2.org/t/loading-greengenes-tree-in-itol/2319/15 "2018-02-01T15:00:29Z")

</div>

I wish I could "like" a reply more than once. That is amazing @iletunic!

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [February 1, 2018, 3:12pm UTC](https://forum.qiime2.org/t/loading-greengenes-tree-in-itol/2319/16 "2018-02-01T15:12:27Z")

</div>

@iletunic: QIIME 2 MVP! ❤ This is amazing - thank you!

---

<div class="post-metadata">

### Author: ![gregcaporaso](https://forum.qiime2.org/user_avatar/forum.qiime2.org/gregcaporaso/32/17769_2.png) [@gregcaporaso](https://forum.qiime2.org/u/gregcaporaso)
#### Post date: [February 13, 2018, 9:48pm UTC](https://forum.qiime2.org/t/loading-greengenes-tree-in-itol/2319/17 "2018-02-13T21:48:30Z")

</div>

I just tried this out and it works great. Thanks so much @iletunic, this is really exciting!

---

<div class="post-metadata">

### Author: ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)
#### Post date: [March 17, 2018, 3:48am UTC](https://forum.qiime2.org/t/loading-greengenes-tree-in-itol/2319/18 "2018-03-17T03:48:39Z")

</div>

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