Merge feature-table with taxonomy


(Bill Landesman) #1

Using Qiime2 (Virtual Box), I am trying to merge feature-table and taxonomy files to create the equivalent of “otu_table_mc2_w_tax.biom” of Qiime 1.9. I want to do this so that I can use the taxonomy barplots function in Qiime 1.9. I found the command to use by searching the forum, however when I run the command, I get the error message below. I assume this has something to do what’s in the first two rows of the taxonomy and feature-table files but I’m not sure what change to make. Below are the code, content of the taxonomy and feature-table files and the error message. Thanks for any suggestions.

Bill

Code:

biom add-metadata -i feature-table.biom -o feature-table-with-taxonomy.biom --observation-metadata-fp taxonomy.tsv

Taxonomy.tsv (first 5 rows):

Feature ID Taxon
#q2:types categorical
e26be733f609ec5e768b922cf69cd54f D_0__Bacteria;D_1__Proteobacteria;D_2__Betaproteobacteria;D_3__Burkholderiales;D_4__Alcaligenaceae
715a13bfab0f175143f3ec02a3303f48 D_0__Bacteria;D_1__Proteobacteria;D_2__Betaproteobacteria;D_3__Burkholderiales;D_4__Comamonadaceae
00311865b066b5d93fdaebbb587dc603 D_0__Bacteria;D_1__Proteobacteria;D_2__Gammaproteobacteria;D_3__Pseudomonadales;D_4__Pseudomonadaceae;D_5__Pseudomonas

Feature-table.qza (first five rows):

'# Constructed from biom file
#OTU ID B17 T1000 T1010 T1034
441604515075282ad1d821bfa586c1f1 0 3524 1907 1867
bec535950291278a371a938c0406b908 0 3690 1845 1914
9c2e207a51aed4e45acd6f2ccab41e6a 0 3350 1778 1938

Error message:

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/metadata_adder.py”, line 107, in add_metadata
float_fields, sample_header, observation_header)
File “/home/qiime2/miniconda/envs/qiime2-2018.11/lib/python3.5/site-packages/biom/cli/metadata_adder.py”, line 174, in _add_metadata
header=observation_header)
File “/home/qiime2/miniconda/envs/qiime2-2018.11/lib/python3.5/site-packages/biom/parse.py”, line 533, in from_file
raise BiomParseException("No header line was found in mapping "
biom.exception.BiomParseException: No header line was found in mapping file.


(Evan Bolyen) #2

Hi @wlandesman,

Try looking at these docs. It looks like you could remove the two header lines in your taxonomy file and just provide what you want your keys to be inside the biom file.


(Bill Landesman) #3

Thanks Evan. I will give it a try!


(system) closed #4

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