biocore / biom-format

The Biological Observation Matrix (BIOM) Format Project
http://biom-format.org
Other
90 stars 95 forks source link

error nicely on missing --process-obs-metadata #506

Closed antgonza closed 10 years ago

antgonza commented 10 years ago

If you run: biom convert -i test.txt -o new_otu_table.biom --to-hdf5 --table-type="OTU table" you will get:

  File "biom-format/biom/table.py", line 3290, in vlen_list_of_str_formatter
    data[i, :len(value)] = value
TypeError: len() of unsized object1

but the solution is to pass --process-obs-metadata taxonomy so the command will look like: biom convert -i test.txt -o new_otu_table.biom --to-hdf5 --table-type="OTU table" --process-obs-metadata taxonomy

wasade commented 10 years ago

I think this is a bug in Table.to_hdf5, @josenavas, what are your thoughts here?

josenavas commented 10 years ago

I think we can specifically check for the type of the taxonomy metadata category, and raise a useful error.