How to combine Feature Table with the taxonomy class

Hallo everyone!
I have convert the feature table which form with qiime2.2019.7 from .biom to .txt by biom, like this:


Now I want to use STAMP to analyze my data. But the data that STAMP needs must be like this that include taxonomy class and the form must be strictly hierarchy.
Please tell me how to get the right form data that STAMP could use.
Thanks very much!!!

Hi @cyy,

I would export your data to a biom file, export your taxonomy to a tsv, combine them, and then convert to a text file. I’ll put those commands below.

However, my unsolicited reply is also to strongly discourage the use of STAMPS. It’s taxonomic comparisons are based on tests that aren’t appropriate for microbiome data (the user manual shows anova(!!!) as a possible statistical test which makes all kinds of assumptions that got thrown out 2014-2017). There are a couple of posts that list some issues; here’s one that links to about half a dozen more posts:

You can use ANCOM, which is compositionally aware, within QIIME 2, which I might recommend as a starting point.

And, that warning issued, here’s hwat I would do:

  1. Export feature table to a qza. Im going to assume your feature table is called feature-table.qza
qiime tools export \
 --input-path feature-table.qza \
 --output-path feature-table
  1. Then export your taxonomy
qiime tool export \
 --input-path taxonomy.qza \
 --output-path taxonomy
  1. Open the taxonomy and change the header. When you open it, you’ll see the header looks like this:
Feature ID	Taxon	Confidence

where the spaces are tabs. You need to change it to this:

#otu-id	taxonomy	Confidence
  1. Add the metadata to the biom table
biom add-metadata \
 --input-fp table/feature-table.biom \
 --observation-metadata-fp taxonomy/taxonomy.qza \
 --output-fp biom-with-taxonomy.biom
  1. Export the biom table to text
biom convert \
 --input-fp biom-with-taxonomy.biom \
 --output-fp biom-with-taxonomy.tsv \
 --to-tsv \
 --output-observation-metadata \
 --header-key taxonomy
  1. Carefully edit the file according to your needs, wants and desires. If you’re using excel, you want to open AS TEXT. Alternatively I would recommend python, R, or another text-handling programatic software of your choice. (Although if you’re using Python, I suggest the python API for both biom and :qiime2:, since they’re going to be easier.)

And :boom:, you now have a tax with taxonomy that is appropriate for all sorts of other visualisation software but probably shouldn’t go into stamps for the aforementioned reasons.

Best,
Justine

5 Likes

Thanks, but I keep getting the error that “Error: no such option: --output-observation-metadata”

What should I use instead?

Hi @msport469,

Could you post your commands to show the way you’re getting there?

Best,
Justine

Hi, I found my mistake. Thanks.

2 Likes

@msport469, it would be very helpful for future readers of this thread if you posted your solution - thanks!

2 Likes