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

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

#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
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

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

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. 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. 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.

1 Like

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

1 Like

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

"#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.

1 Like