# Exporting with Taxonomy Error

**URL:** https://forum.qiime2.org/t/exporting-with-taxonomy-error/16758
**Category:** Other Bioinformatics Tools
**Tags:** export
**Created:** [September 30, 2020, 6:45pm UTC](https://forum.qiime2.org/t/exporting-with-taxonomy-error/16758 "2020-09-30T18:45:57Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Jrand](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/j/8edcca/32.png) [@Jrand](https://forum.qiime2.org/u/Jrand)
#### Post date: [September 30, 2020, 6:45pm UTC](https://forum.qiime2.org/t/exporting-with-taxonomy-error/16758/1 "2020-09-30T18:45:57Z")

</div>

Hello,

I have run into a slight issue with exporting my data after running the pipeline. Normally the .tsv file with taxonomy that I have been getting in previous runs doesn't seem to want to generate now. The error that is generate is seen below:

 ![Screen Shot 2020-09-30 at 11.06.57 AM](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/2X/5/5b1cad69426f47487e160080442dc51545bc7c26.png)

And the code that I ran to generate this error is:

qiime tools export --input-path DADA2/Fungi-Table-dada2-208-187-NS.qza --output-path DADA2/ExportedRaw  
cd DADA2/ExportedRaw  
mv feature-table.biom Fungi-Table-Filtered.biom  
biom convert -i Fungi-Table-Filtered.biom -o Fungi-Table-Filtered.tsv --to-tsv  
biom head -i Fungi-Table-Filtered.tsv

cd ..  
cd ..

cd Taxonomy

qiime tools export --input-path Fungal-Taxonomy.qza --output-path ./  
cp taxonomy.tsv biom-taxonomy.tsv

cd ..

biom add-metadata -i DADA2/ExportedRaw/Fungi-Table-Filtered.biom -o DADA2/ExportedRaw/Fungi-Table-With-Taxonomy.biom --observation-metadata-fp Taxonomy/biom-taxonomy.tsv --sc-separated taxonomy --observation-header OTUID,taxonomy,confidence  
biom convert -i DADA2/ExportedRaw/Fungi-Table-With-Taxonomy.biom -o DADA2/ExportedRaw/Fungi-Table-With-Taxonomy.tsv -m Fungal-Metadata-BLM.tsv --to-tsv --header-key taxonomy

I have searched the forums to try to find this exact error and though enlightening nothing tended to work. With [Biom add metadata problem](https://forum.qiime2.org/t/biom-add-metadata-problem/8302), being the closest to the issue and sadly not fixing it.

Any help would be appreciated.

Thank you all in advance!

---

<div class="post-metadata">

### Author: ![SoilRotifer](https://forum.qiime2.org/user_avatar/forum.qiime2.org/soilrotifer/32/21071_2.png) [@SoilRotifer](https://forum.qiime2.org/u/SoilRotifer)
#### Post date: [September 30, 2020, 9:15pm UTC](https://forum.qiime2.org/t/exporting-with-taxonomy-error/16758/2 "2020-09-30T21:15:22Z")

</div>

Hi @Jrand, welcome to :qiime2:

Try following the procedure outlined here. It appears there are some minor differences with your `biom add-metadata` command:

> [@Exporting and modifying BIOM tables (e.g. adding taxonomy annotations)](https://forum.qiime2.org/t/exporting-and-modifying-biom-tables-e-g-adding-taxonomy-annotations/3630):
>
> Creating a TSV BIOM table The following is based on [a post](https://forum.qiime2.org/t/how-to-add-taxonomy-to-feature-table-qza-and-get-otu-id-of-each-taxonomy-and-number-of-otus/3470/22) by @gregcaporaso. $ qiime tools export table.qza --output-dir ./ $ biom convert -i feature-table.biom -o feature-table.tsv --to-tsv $ biom head -i feature-table.tsv # Constructed from biom file #OTU ID L1S105 L1S140 L1S208 L1S257 L1S281 4b5eeb300368260019c1fbc7a3c718fc 2222.0 0.0 0.0 0.0 0.0 fe30ff0f71a38a39cf1717ec2be3a2fc 5.0 0.0 0.0 0.0 0.0 d29fe3c70564fc0f69f2c03e0d1e5561 0.0 0.0 0.0 0.0 0.0 868528ca947bc57b69ffdf83e6b73bae 0.0 2276…

and here:

> [@Change header names from Feature ID to OTUID in exported TSVTaxonomyDirectoryFormat file](https://forum.qiime2.org/t/change-header-names-from-feature-id-to-otuid-in-exported-tsvtaxonomydirectoryformat-file/6653):
>
> Hello What is the command line to change header names Feature ID to OTU ID? Best regards, Jasmine

You can also checkout more details about [biom convert](http://biom-format.org/documentation/biom_conversion.html).

---

<div class="post-metadata">

### Author: ![Jrand](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/j/8edcca/32.png) [@Jrand](https://forum.qiime2.org/u/Jrand)
#### Post date: [October 1, 2020, 4:05am UTC](https://forum.qiime2.org/t/exporting-with-taxonomy-error/16758/3 "2020-10-01T04:05:37Z")

</div>

Thank you Mike for your response!

I looked through the links, and from the first link I have found that the only difference in my problem code segment:

_biom convert -i DADA2/ExportedRaw/Fungi-Table-With-Taxonomy.biom -o DADA2/ExportedRaw/Fungi-Table-With-Taxonomy.tsv -m Fungal-Metadata-BLM.tsv --to-tsv --header-key taxonomy_

is the addition of my metadata with _-m Fungal-Metadata-BLM.tsv_. The rest of the code generates the needed files except for this last chunk of code. So I checked the second link. Sadly this is the same attempted fix I did before posting from that other post, [Biom add metadata problem](https://forum.qiime2.org/t/biom-add-metadata-problem/8302), and it didn't fix the issue either.

Again thank you so much for your help, I am still relatively new to all this so I am likely overlooking something obvious.

---

<div class="post-metadata">

### Author: ![SoilRotifer](https://forum.qiime2.org/user_avatar/forum.qiime2.org/soilrotifer/32/21071_2.png) [@SoilRotifer](https://forum.qiime2.org/u/SoilRotifer)
#### Post date: [October 1, 2020, 1:37pm UTC](https://forum.qiime2.org/t/exporting-with-taxonomy-error/16758/4 "2020-10-01T13:37:01Z")

</div>

Hi @Jrand,

I am not sure if this is the issue, but the command I referred to was:

> [@Jrand](#):
>
> biom add-metadata -i DADA2/ExportedRaw/Fungi-Table-Filtered.biom -o DADA2/ExportedRaw/Fungi-Table-With-Taxonomy.biom --observation-metadata-fp Taxonomy/biom-taxonomy.tsv --sc-separated taxonomy --observation-header OTUID,taxonomy,confidence

Is there a reason why you are adding `--observation-header OTUID,taxonomy,confidence`? You should not need this addition if you are editing the headers, as described in both links. I am wondering if this causes things to fail later on?

> [@Jrand](#):
>
> biom convert -i DADA2/ExportedRaw/Fungi-Table-With-Taxonomy.biom -o DADA2/ExportedRaw/Fungi-Table-With-Taxonomy.tsv -m Fungal-Metadata-BLM.tsv --to-tsv --header-key taxonomy

Not sure why `-m Fungal-Metadata-BLM.tsv` is being added to this command.

Also, then editing the taxonomy headers I usually replace:  
`Feature ID Taxon Confidence`  
with this:  
`#OTUID taxonomy confidence`

Perhaps you can share your qza files? Hopefully, someone smarter than I will spot the issue. 🙂

-Mike

---

<div class="post-metadata">

### Author: ![Jrand](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/j/8edcca/32.png) [@Jrand](https://forum.qiime2.org/u/Jrand)
#### Post date: [October 1, 2020, 6:04pm UTC](https://forum.qiime2.org/t/exporting-with-taxonomy-error/16758/5 "2020-10-01T18:04:08Z")

</div>

Well simply removing _-m Fungal-Metadata-BLM.tsv_ from the script allowed for the Fungi-Table-With-Taxonomy.tsv file to generate properly, and from the looks of it seems okay.

Thank you very much @SoilRotifer!
