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

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) [[email protected] 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 (3.3 MB)

I would also like to upload the "feature-table.biom" feature-table.biom

Any suggestion for what could go wrong?

I am trying to export my data to run PICRUSt.

Thanks a lot!
Fangzhou

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, it looks like “OTU ID” might be the expected header?

Let me know if that works!

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.

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

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?

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?

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

Apologies, here is the ‘biom convert’ command I used:

(qiime2-2018.11) [email protected]:~$ 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

Hi @Liyah_Smith:

http://biom-format.org/documentation/biom_conversion.html#general-usage-examples

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

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

1 Like