Loading Greengenes tree in iTOL

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.

1 Like

Hi @Richard_Rodrigues!

We can't really provide support for ITOL, since we don't develop it, but, they have pretty nice docs 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
$ 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)
$ 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 (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:

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


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:

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 tutorial, I would highly recommend working through our Getting Started guide, which will get you geared up for QIIME 2!

Good luck and keep us posted! :t_rex:

3 Likes

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., 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

:+1: :tada:

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

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! :cool:

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?

4 Likes

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

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

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…

6 Likes

Awesome! Thanks so much @iletunic! :balloon:

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

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).

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?

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

2 Likes

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.

16 Likes

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

3 Likes

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

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

1 Like

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