Link BIOM table with taxonomy

Hi @Ghaz, not sure how that happened unless the files are getting mixed up. I just tried the following commands using the table.qza and taxonomy.qza files from the Moving Pictures tutorial, and the commands below worked as expected.

# Export:
qiime tools export \
    --input-path table.qza \
    --output-path exported_table
    
qiime tools export \
    --input-path taxonomy.qza \
    --output-path exported_taxonomy/

Edit taxonomy header of exported_taxonomy/taxonomy.tsv :
- replace: "Feature ID Taxon Confidence"
- with: "#OTUID taxonomy confidence"

# Add metadata:
biom add-metadata \
	-i exported_table/feature-table.biom \
	--observation-metadata-fp exported_taxonomy/taxonomy.tsv \
	--sc-separated taxonomy \
	-o feature-table-tax.biom

# Make tsv:
biom convert \
	--table-type="OTU table" \
	-i feature-table-tax.biom \
	--to-tsv \
	--header-key taxonomy \
	-o feature-table-tax.tsv

Optional sanity-check: make a tsv file from your initially exported exported_table/feature-table.biom table, i.e. w/o taxonomy. Compare this to your feature-table-tax.tsv with the taxonomy.

biom convert \
	--table-type="OTU table" \
	-i exported_table/feature-table-tax.biom \
	--to-tsv \
	-o feature-table.tsv

You can find more information about biom conversion here.

2 Likes