# biom add-metadata: Error in biom file while adding Taxonomy

**URL:** https://forum.qiime2.org/t/biom-add-metadata-error-in-biom-file-while-adding-taxonomy/32919
**Category:** Other Bioinformatics Tools
**Tags:** taxonomy, feature-table
**Created:** [April 7, 2025, 10:24am UTC](https://forum.qiime2.org/t/biom-add-metadata-error-in-biom-file-while-adding-taxonomy/32919 "2025-04-07T10:24:58Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Zeina](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/z/f6c823/32.png) [@Zeina](https://forum.qiime2.org/u/Zeina)
#### Post date: [April 7, 2025, 10:24am UTC](https://forum.qiime2.org/t/biom-add-metadata-error-in-biom-file-while-adding-taxonomy/32919/1 "2025-04-07T10:24:58Z")

</div>

Hi, I am trying to add taxonomy to my biom file using the command below. Here an exemple of the taxonomy file :

```auto
#OTU ID	taxonomy	Confidence
b02e35c471964bc58fda61d0edffa5ad	d __Bacteria;p__ Proteobacteria;c __Gammaproteobacteria;o__ Burkholderiales	0.96638573636321
15d2e033875d50ece1dc66a38bbc6da9	d __Bacteria;p__ Chloroflexi;c __Dehalococcoidia;o__ Dehalococcoidia SAR202 clade;f __Dehalococcoidia SAR202 clade;g__ Dehalococcoidia SAR202 clade;s__type or paste code here

```

```auto
biom add-metadata -i 16s-feature-table.biom -o 16s-feature-FINAL-table.biom --observation-metadata-fp 16s-taxonomy.tsv --sc-separated taxonomytype or paste code here

```

I get this error, please could you tell me what it could be ?it is realated to the taxonomy header ? and how can i solve it . thank you

```auto
tTraceback (most recent call last):
  File "/softs/contrib/apps/anaconda/3/envs/qiime2-amplicon-2024.5/bin/biom", line 11, in <module>
    sys.exit(cli())
  File "/softs/contrib/apps/anaconda/3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/softs/contrib/apps/anaconda/3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/softs/contrib/apps/anaconda/3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/softs/contrib/apps/anaconda/3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/softs/contrib/apps/anaconda/3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/softs/contrib/apps/anaconda/3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/biom/cli/metadata_adder.py", line 112, in add_metadata
    write_biom_table(result, fmt, output_fp)
  File "/softs/contrib/apps/anaconda/3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/biom/cli/util.py", line 31, in write_biom_table
    table.to_hdf5(f, biom.parse.generatedby())
  File "/softs/contrib/apps/anaconda/3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/biom/table.py", line 4598, in to_hdf5
    raise ValueError("%s has inconsistent metadata "
ValueError: 5e046fdf2ba96f5b49bbdb2d0dc35504 has inconsistent metadata categories with 1fed8630277029fcec51a19fcc70afe8:
5e046fdf2ba96f5b49bbdb2d0dc35504: ['taxonomy', 'Confidence']
1fed8630277029fcec51a19fcc70afe8: []
ype or paste code here

```

---

<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: [April 7, 2025, 1:22pm UTC](https://forum.qiime2.org/t/biom-add-metadata-error-in-biom-file-while-adding-taxonomy/32919/2 "2025-04-07T13:22:34Z")

</div>

Hi @Zeina,

Assuming you are using QIIME 2 before getting to this step, there is a much easier way to do make these QIIME 1 like files. See this [post](https://forum.qiime2.org/t/how-to-build-an-otu-table/26900/2). Then while viewing the QZV you can click the export button to download a text version of the table.

Otherwise, I think everything looks fine, as outlined [here](https://forum.qiime2.org/t/link-biom-table-with-taxonomy/24171/4). Though I do not think the following line is correct, it contains `... ;s__type or paste code here`. Is this a copy/paste error? It looks like it is missing the the `Confidence` value.

---

<div class="post-metadata">

### Author: ![Zeina](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/z/f6c823/32.png) [@Zeina](https://forum.qiime2.org/u/Zeina)
#### Post date: [April 7, 2025, 2:08pm UTC](https://forum.qiime2.org/t/biom-add-metadata-error-in-biom-file-while-adding-taxonomy/32919/3 "2025-04-07T14:08:33Z")

</div>

Thank you for your reply . `... ;s__type or paste code here` is a mistake while typing.  
I was wondering which header format is correct, I've seen several formats, I'm confused !

#OTU ID taxonomy Confidence  
#OTUID taxonomy confidence  
#OTU ID taxonomy confidence

---

<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: [April 7, 2025, 3:48pm UTC](https://forum.qiime2.org/t/biom-add-metadata-error-in-biom-file-while-adding-taxonomy/32919/4 "2025-04-07T15:48:09Z")

</div>

I think the following is still the correct way to do it:

```auto
"#OTU ID\ttaxonomy\tconfidence"

```

Otherwise, I suggest using the base QIIME 2 approach to do this (_i.e._ via making a QZV file). You'll save yourself a lot of headache. Again, assuming you already have these files via QIIME 2.

---

<div class="post-metadata">

### Author: ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)
#### Post date: [May 8, 2025, 9:48pm UTC](https://forum.qiime2.org/t/biom-add-metadata-error-in-biom-file-while-adding-taxonomy/32919/5 "2025-05-08T21:48:46Z")

</div>

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