File "/opt/software/QIIME2/2017.8/lib/python3.5/site-packages/biom_format-2.1.6-py3.5-linux-x86_64.egg/biom/table.py", line 4123, in to_hdf5
self.group_metadata(axis='observation'), 'csr', compression)
File "/opt/software/QIIME2/2017.8/lib/python3.5/site-packages/biom_format-2.1.6-py3.5-linux-x86_64.egg/biom/table.py", line 4095, in axis_dump
formatter[category](grp, category, md, compression)
File "/opt/software/QIIME2/2017.8/lib/python3.5/site-packages/biom_format-2.1.6-py3.5-linux-x86_64.egg/biom/table.py", line 274, in general_formatter
data=[m[header].encode('utf8') for m in md],
File "/opt/software/QIIME2/2017.8/lib/python3.5/site-packages/biom_format-2.1.6-py3.5-linux-x86_64.egg/biom/table.py", line 274, in <listcomp>
data=[m[header].encode('utf8') for m in md],
AttributeError: 'NoneType' object has no attribute 'encode'
The two main suggestions (based on googling) I saw and incorporated were to make sure my taxonomy.tsv file had the headers "OTUID taxonomy confidence" with tab separations rather than spaces and to add the --sc-separated taxonomy flag. I've also validated my BIOM table with biom validate-table.
Any help would be greatly appreciated! I'd like to be able to continue my analysis using QIIME2 but it seems I need to get past this hurdle first.
Would you be able to post a sample of taxonomy.tsv? Also I noticed your table has transposed in the filename. Does that mean anything as far as the biom table itself is concerned?
In regard to the table, I use Minimum Entropy Decomposition to analyze my data and generate my OTUs. The output from MED is a matrix counts table with the samples I inputted as rows and the OTU IDs as columns. I believe the standard BIOM format is the opposite, so I transposed the matrix in Excel. I did reopen it in TextWrangler to make sure it was in Unix format with Unicode (UTF-8) selected. Hope that helps.
Your example seems to use spaces instead of tabs, but that might just be our forum software trying to be clever. If you were to load that taxonomy.tsv in Excel, is it able to pick out the columns correctly?
Also, do the IDs in your example match your biom table? You can check with:
Yes, Excel is able to separate out the columns correctly.
I ran the command you suggested and the IDs match. However, there seem to be more IDs in my BIOM table (106 it looks like) than my taxonomy table (which only had 100 IDs). Also they are not in the same order. Would either of those cause problems?
Yes, this seemed to be the issue! The add-metadata command went through without an error and I used summarize-table to verify that the metadata was added. Thanks so much for your help!