# biom.exception.BiomParseException: No header line was found in mapping file

**URL:** https://forum.qiime2.org/t/biom-exception-biomparseexception-no-header-line-was-found-in-mapping-file/6487
**Category:** Other Bioinformatics Tools
**Created:** [October 17, 2018, 12:51pm UTC](https://forum.qiime2.org/t/biom-exception-biomparseexception-no-header-line-was-found-in-mapping-file/6487 "2018-10-17T12:51:04Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![dimitely](https://forum.qiime2.org/user_avatar/forum.qiime2.org/dimitely/32/3002_2.png) [@dimitely](https://forum.qiime2.org/u/dimitely)
#### Post date: [October 17, 2018, 12:51pm UTC](https://forum.qiime2.org/t/biom-exception-biomparseexception-no-header-line-was-found-in-mapping-file/6487/1 "2018-10-17T12:51:04Z")

</div>

Hi Matthew,

I have tried to do the same as @jairideout. Below are the command lines.

> $ qiime tools export   
> --input-path table.qza   
> --output-path exported
> 
> $ qiime tools export   
> --input-path taxonomy.qza   
> --output-path exported
> 
> $ biom add-metadata -i exported/feature-table.biom -o table-with-taxonomy.biom --observation-metadata-fp biom-taxonomy.tsv --sc-separated taxonomy

But the "biom add-metadata" showed some error as below.

> (qiime2-2018.8) [biostack@LFE0616 Run6]$ biom add-metadata -i exported/feature-table.biom -o table-with-taxonomy.biom --observation-metadata-fp biom-taxonomy.tsv --sc-separated taxonomy  
> Traceback (most recent call last):  
> File "/home/biostack/anaconda3/envs/qiime2-2018.8/bin/biom", line 6, in   
> sys.exit(biom.cli.cli())  
> File "/home/biostack/anaconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/click/core.py", line 722, in **call**  
> return self.main(\*args, \*\*kwargs)  
> File "/home/biostack/anaconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/click/core.py", line 697, in main  
> rv = self.invoke(ctx)  
> File "/home/biostack/anaconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/click/core.py", line 1066, in invoke  
> return \_process\_result(sub\_ctx.command.invoke(sub\_ctx))  
> File "/home/biostack/anaconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/click/core.py", line 895, in invoke  
> return ctx.invoke(self.callback, \*\*ctx.params)  
> File "/home/biostack/anaconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/click/core.py", line 535, in invoke  
> return callback(\*args, \*\*kwargs)  
> File "/home/biostack/anaconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/biom\_format-2.1.6-py3.5-linux-x86\_64.egg/biom/cli/metadata\_adder.py", line 107, in add\_metadata  
> float\_fields, sample\_header, observation\_header)  
> File "/home/biostack/anaconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/biom\_format-2.1.6-py3.5-linux-x86\_64.egg/biom/cli/metadata\_adder.py", line 174, in \_add\_metadata  
> header=observation\_header)  
> File "/home/biostack/anaconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/biom\_format-2.1.6-py3.5-linux-x86\_64.egg/biom/parse.py", line 527, in from\_file  
> raise BiomParseException("No header line was found in mapping "  
> biom.exception.BiomParseException: No header line was found in mapping file.

I have checked to use "tab" between #OTUID taxonomy confidence.  
But still could not fix the issue.  
here are mine "biom-taxonomy"[biom-taxonomy.tsv](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/flex002/uploads/qiime21/original/2X/5/56c5a783a7bcdc5e5ea60e3a26349222a80b650a.tsv) (3.3 MB)

I would also like to upload the "feature-table.biom" [feature-table.biom](https://1drv.ms/u/s!ArITGwsFHKrdpg81b6rJ9_brxYh6)

Any suggestion for what could go wrong?

I am trying to export my data to run PICRUSt.

Thanks a lot!  
Fangzhou

---

<div class="post-metadata">

### Author: ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)
#### Post date: [October 17, 2018, 12:58pm UTC](https://forum.qiime2.org/t/biom-exception-biomparseexception-no-header-line-was-found-in-mapping-file/6487/2 "2018-10-17T12:58:42Z")

</div>

Hi @dimitely,  
I have moved your question to a new topic and categorized as "other bioinformatics tools" because this is a question about biom-format, not QIIME 2. Thus, we might not be able to answer (we are not biom-format developers!) but others in the community may help.

What happens if you put a space between "OTU" and "ID"? Looking at the biom-format [documentation](http://biom-format.org/documentation/table_objects.html), it looks like "OTU ID" might be the expected header?

Let me know if that works!

---

<div class="post-metadata">

### Author: ![dimitely](https://forum.qiime2.org/user_avatar/forum.qiime2.org/dimitely/32/3002_2.png) [@dimitely](https://forum.qiime2.org/u/dimitely)
#### Post date: [October 17, 2018, 2:08pm UTC](https://forum.qiime2.org/t/biom-exception-biomparseexception-no-header-line-was-found-in-mapping-file/6487/3 "2018-10-17T14:08:41Z")

</div>

Thank you so much @Nicholas_Bokulich !  
I have tried to put a space between OUT and ID, but it still the output is same as before.

---

<div class="post-metadata">

### Author: ![JazM](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/j/258eb7/32.png) [@JazM](https://forum.qiime2.org/u/JazM)
#### Post date: [February 7, 2019, 1:42pm UTC](https://forum.qiime2.org/t/biom-exception-biomparseexception-no-header-line-was-found-in-mapping-file/6487/4 "2019-02-07T13:42:38Z")

</div>

I'm having the same problem, did you find a solution?

---

<div class="post-metadata">

### Author: ![Liyah\_Smith](https://forum.qiime2.org/user_avatar/forum.qiime2.org/liyah_smith/32/6395_2.png) [@Liyah\_Smith](https://forum.qiime2.org/u/Liyah_Smith)
#### Post date: [February 20, 2019, 1:52pm UTC](https://forum.qiime2.org/t/biom-exception-biomparseexception-no-header-line-was-found-in-mapping-file/6487/5 "2019-02-20T13:52:32Z")

</div>

I am running into the same issue as well. It I am trying to add the metadata to my biom files so that I can use them as input for a taxonomy barplot. What command should be used to add the missing headers?

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [February 22, 2019, 12:25am UTC](https://forum.qiime2.org/t/biom-exception-biomparseexception-no-header-line-was-found-in-mapping-file/6487/6 "2019-02-22T00:25:40Z")

</div>

> [@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…

---

<div class="post-metadata">

### Author: ![Liyah\_Smith](https://forum.qiime2.org/user_avatar/forum.qiime2.org/liyah_smith/32/6395_2.png) [@Liyah\_Smith](https://forum.qiime2.org/u/Liyah_Smith)
#### Post date: [March 12, 2019, 6:32pm UTC](https://forum.qiime2.org/t/biom-exception-biomparseexception-no-header-line-was-found-in-mapping-file/6487/7 "2019-03-12T18:32:18Z")

</div>

Thank you, the first two steps worked, so my taxonomy metadata has the correct header! The only problem is that I cannot seem to add it to the OTU table I have because the table is still in ".txt" format. I tried using the "biom convert" command, and I converted a copy of the OTU table file into both TSV and CSV formats before trying again. Every time, QIIME2 would give me the following message:

"Traceback (most recent call last):  
File "/home/qiime2/miniconda/envs/qiime2-2018.11/lib/python3.5/site-packages/biom/table.py", line 4775, in \_extract\_data\_from\_tsv  
values = list(map(dtype, fields[1:]))  
ValueError: could not convert string to float: 'hydrogenophaga sp. 7b\_224 ;k\_\_bacteria;p\_\_proteobacteria;c\_\_betaproteobacteria;o\_\_burkholderiales;f\_\_comamonadaceae;g\_\_hydrogenophaga;s\_\_hydrogenophaga sp.;superkingdom\_\_bacteria'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File "/home/qiime2/miniconda/envs/qiime2-2018.11/lib/python3.5/site-packages/biom/parse.py", line 660, in load\_table  
table = parse\_biom\_table(fp)  
File "/home/qiime2/miniconda/envs/qiime2-2018.11/lib/python3.5/site-packages/biom/parse.py", line 412, in parse\_biom\_table  
t = Table.from\_tsv(fp, None, None, lambda x: x)  
File "/home/qiime2/miniconda/envs/qiime2-2018.11/lib/python3.5/site-packages/biom/table.py", line 4631, in from\_tsv  
t\_md\_name) = Table.\_extract\_data\_from\_tsv(lines, \*\*kwargs)  
File "/home/qiime2/miniconda/envs/qiime2-2018.11/lib/python3.5/site-packages/biom/table.py", line 4779, in \_extract\_data\_from\_tsv  
raise TypeError(msg % (lineno, badidx+1, badval))  
TypeError: Invalid value on line 1, column 1, value hydrogenophaga sp. 7b\_224 ;k\_\_bacteria;p\_\_proteobacteria;c\_\_betaproteobacteria;o\_\_burkholderiales;f\_\_comamonadaceae;g\_\_hydrogenophaga;s\_\_hydrogenophaga sp.;superkingdom\_\_bacteria

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File "/home/qiime2/miniconda/envs/qiime2-2018.11/bin/biom", line 11, in   
sys.exit(cli())  
File "/home/qiime2/miniconda/envs/qiime2-2018.11/lib/python3.5/site-packages/click/core.py", line 764, in **call**  
return self.main(\*args, \*\*kwargs)  
File "/home/qiime2/miniconda/envs/qiime2-2018.11/lib/python3.5/site-packages/click/core.py", line 717, in main  
rv = self.invoke(ctx)  
File "/home/qiime2/miniconda/envs/qiime2-2018.11/lib/python3.5/site-packages/click/core.py", line 1137, in invoke  
return \_process\_result(sub\_ctx.command.invoke(sub\_ctx))  
File "/home/qiime2/miniconda/envs/qiime2-2018.11/lib/python3.5/site-packages/click/core.py", line 956, in invoke  
return ctx.invoke(self.callback, \*\*ctx.params)  
File "/home/qiime2/miniconda/envs/qiime2-2018.11/lib/python3.5/site-packages/click/core.py", line 555, in invoke  
return callback(\*args, \*\*kwargs)  
File "/home/qiime2/miniconda/envs/qiime2-2018.11/lib/python3.5/site-packages/biom/cli/table\_converter.py", line 114, in convert  
table = load\_table(input\_fp)  
File "/home/qiime2/miniconda/envs/qiime2-2018.11/lib/python3.5/site-packages/biom/parse.py", line 662, in load\_table  
raise TypeError("%s does not appear to be a BIOM file!" % f)  
TypeError: /home/qiime2/Documents/LSmith/2018 Caves Epibonts/Bacteria/analysisfiles/050218TSillcus515F-pr.fasta.otus.fa.OTU.copy.tsv does not appear to be a BIOM file!"  
What command would allow me to convert the OTU table to a biom format that can subsequently be imported into QIIME2 as an artifact, and is there a semantic type I should specify?

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [March 12, 2019, 8:18pm UTC](https://forum.qiime2.org/t/biom-exception-biomparseexception-no-header-line-was-found-in-mapping-file/6487/8 "2019-03-12T20:18:47Z")

</div>

Oops, can you include the _command you ran_ to go with that error message! That has some important context!

---

<div class="post-metadata">

### Author: ![Liyah\_Smith](https://forum.qiime2.org/user_avatar/forum.qiime2.org/liyah_smith/32/6395_2.png) [@Liyah\_Smith](https://forum.qiime2.org/u/Liyah_Smith)
#### Post date: [March 12, 2019, 8:32pm UTC](https://forum.qiime2.org/t/biom-exception-biomparseexception-no-header-line-was-found-in-mapping-file/6487/9 "2019-03-12T20:32:43Z")

</div>

Apologies, here is the 'biom convert' command I used:

(qiime2-2018.11) qiime2@qiime2core2018-11:~$ biom convert \

> -i '/home/qiime2/Documents/LSmith/2018 Caves Epibonts/Bacteria/analysisfiles/050218TSillcus515F-pr.fasta.otus.fa.OTU.copy.tsv'   
> -o '/home/qiime2/Documents/LSmith/TestData/050218TSillcusB-OTU.biom'   
> --to-hdf5

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [March 13, 2019, 3:41pm UTC](https://forum.qiime2.org/t/biom-exception-biomparseexception-no-header-line-was-found-in-mapping-file/6487/10 "2019-03-13T15:41:19Z")

</div>

Hi @Liyah_Smith:

[http://biom-format.org/documentation/biom\_conversion.html#general-usage-examples](http://biom-format.org/documentation/biom_conversion.html#general-usage-examples)

Please see the notes about `--table-type` and `--process-obs-metadata`.

---

<div class="post-metadata">

### Author: ![Dharitri](https://forum.qiime2.org/user_avatar/forum.qiime2.org/dharitri/32/14577_2.png) [@Dharitri](https://forum.qiime2.org/u/Dharitri)
#### Post date: [July 3, 2019, 6:28am UTC](https://forum.qiime2.org/t/biom-exception-biomparseexception-no-header-line-was-found-in-mapping-file/6487/11 "2019-07-03T06:28:22Z")

</div>

I was also facing the same problem. solved simply by adding a hashtag (#) in front of SampleID (first column first row of my metadata file, might be called as metadata header).  
This may be helpful:  
[http://biom-format.org/documentation/adding\_metadata.html](http://biom-format.org/documentation/adding_metadata.html)
