I've been having the same issue. Using the command suggested above biom add-metadata -i feature-table.biom -o table.w_omd.biom --observation-metadata-fp taxonomy.tsv --observation-header taxonomy
and variations tried previously, the resulting biom table does not seem to have taxonomy. I checked it by converting to a .tsv using biom convert -i table.w_omd.biom -o table_w_tax.tsv --to-tsv --header-key taxonomy
which may not be the best, but it worked for the qiime1 file I tried it on. I've shared my files, hopefully they help.
Using 'biom add-metadata -i feature-table.biom -o tax_table2.biom --observation-metadata-fp taxonomy.tsv --observation-header OTUID,taxonomy,confidence' I get this traceback:
Traceback (most recent call last):
File "/usr/bin/biom", line 9, in
load_entry_point('biom-format==2.1.6', 'console_scripts', 'biom')()
File "/usr/lib/python2.7/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/biom/cli/metadata_adder.py", line 114, in add_metadata
write_biom_table(result, fmt, output_fp)
File "/usr/lib64/python2.7/site-packages/biom/cli/util.py", line 35, in write_biom_table
table.to_hdf5(f, biom.parse.generatedby())
File "/usr/lib64/python2.7/site-packages/biom/table.py", line 4123, in to_hdf5
self.group_metadata(axis='observation'), 'csr', compression)
File "/usr/lib64/python2.7/site-packages/biom/table.py", line 4095, in axis_dump
formatter[category](grp, category, md, compression)
File "/usr/lib64/python2.7/site-packages/biom/table.py", line 326, in vlen_list_of_str_formatter
"below:\n%s" % (header, md[0][header]))
TypeError: Category 'taxonomy' is not formatted properly. The most common issue is when 'taxonomy' is represented as a flat string instead of a list. An attempt was made to split this field on a ';' to coerce it into a list but it failed. An example entry (which is not assured to be the problematic entry) is below:
k__Bacteria; p__Proteobacteria; c__Gammaproteobacteria; o__Enterobacteriales; f__Enterobacteriaceae
Using 'biom add-metadata -i feature-table.biom -o tax_table2.biom --observation-metadata-fp taxonomy.tsv --observation-header OTUID,taxonomy,confidence --sc-separated taxonomy' I get the following traceback which seems to match schmeltzy:
Traceback (most recent call last):
File "/usr/bin/biom", line 9, in
load_entry_point('biom-format==2.1.6', 'console_scripts', 'biom')()
File "/usr/lib/python2.7/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/biom/cli/metadata_adder.py", line 114, in add_metadata
write_biom_table(result, fmt, output_fp)
File "/usr/lib64/python2.7/site-packages/biom/cli/util.py", line 35, in write_biom_table
table.to_hdf5(f, biom.parse.generatedby())
File "/usr/lib64/python2.7/site-packages/biom/table.py", line 4123, in to_hdf5
self.group_metadata(axis='observation'), 'csr', compression)
File "/usr/lib64/python2.7/site-packages/biom/table.py", line 4095, in axis_dump
formatter[category](grp, category, md, compression)
File "/usr/lib64/python2.7/site-packages/biom/table.py", line 274, in general_formatter
data=[m[header].encode('utf8') for m in md],
AttributeError: 'NoneType' object has no attribute 'encode'
files.zip.tar.gz (709.0 KB)