From biom to taxa barplot

Hello,

I’m trying to display an imported biom file as a taxa bar plot. Since there is the taxonomy column in the biom file, I suppose it should be a one-step conversion, but I can’t find such a step in the qiime2 documentation. Thinking backwards, the taxa-bar-plot step requires --i-table and --i-taxonomy. I know I can import as shown in the Importing Data tutorial, but that gives me a FeatureTable[Frequency], which stripped off the taxonomy information, right? Then I have to run the classify-sklearn step to get taxonomy.qza, but I don’t have the reads from a downloaded biom file (and I actually don’t want to do the classify step because I want to compare other’s final results with mine). So, shouldn’t there be a command that converts biom files directly into taxa bar plot? Thank you.

Hi @jjmmii,

You are correct — taxonomy information is not stored inside feature tables in QIIME 2 and so that information is stripped off upon import. However, if there is taxonomy classification information in that biom table there must be a taxonomy assignments result file somewhere that corresponds to those features/OTUs. You can import that file into QIIME and use to build bar plots.

If such a taxonomy file no longer exists, let me know — there are other ways (outside of QIIME 2).

Such a command does exist — in QIIME1! The more QIIME2-ish way to handle this (I think) would be to add a method that extracts taxonomy information from a biom file upon import to generate a separate FeatureData[Taxonomy] artifact — @thermokarst and @ebolyen might have more thoughts on if/how we could handle this in the future.

I hope that helps!

2 Likes

Thanks @Nicholas_Bokulich! @jjmmii, please take a look at this forum post, it demonstrates how to import a BIOM table annotated with taxonomy data as both a FeatureTable[Frequency], and then again as FeatureData[Taxonomy]. Then you can use those Artifacts as inputs to taxa barplot. Going this route, you don’t need to worry about classifying your feature data, you get all that same info extracted from the Taxonomy column in your original BIOM file. Hope that helps!

3 Likes

Thank you both very much! I found the post that @thermokarst pointed to and figured it out yesterday (but can’t tell you earlier because my post wasn’t yet approved :stuck_out_tongue: )

But I’d like to comment that the steps weren’t convenient. I had five biom files, one per sample (in fact they were downloaded from the Human Microbiome Project). I intended to use QIIME 1’s parallel_merge_otu_tables.py to first merge the five biom files into one biom file, but there was a numpy error that I couldn’t solve. (I should raise this question in qiime1 forum.) So that means I had to import each biom as FeatureTable[Frequency] (table.qza) and as FeatureData[Taxonomy] (taxonomy.qza). Then I had to merge five table.qza’s into one table.qza and five taxonomy.qza’s into one taxonomy.qza, but the qiime feature-table merge and qiime feature-table merge-taxa-data only allows two files to be merged at a time, which means it took me five commands to merge five files into one. Then, I am able to generate the taxa barplot.

I hope QIIME2’s merge functions will allow multiple files as input, or QIIME1’s parallel_merge_otu_tables.py can be fixed.

1 Like

Ouch, that sounds pretty inconvenient. We have an open issue to support merging more than two feature tables (or two taxonomies) at a time, and will follow up here when that feature is supported in a release!

I can’t address the QIIME 1 merging issues here, recommend posting to the QIIME 1 Forum. Thanks!

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

In the new QIIME 2 2017.12 release, feature-table merge (and feature-table merge-taxa/merge-seqs) can now accept arbitrarily many items to merge!

1 Like