biocore / biom-format

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

Issue with biom convert? #637

Closed jtremblay closed 9 years ago

jtremblay commented 9 years ago

Dear Biom-format developers, When I try to convert a tsv biom table to hdf5 format with this command:

biom convert -i ./otu_table.tsv -o ./otu_table.biom --table-type 'OTU table' --to-hdf5

I get the following error

  File "/path/to/software/qiime/qiime-1.9.0/lib/python/biom/table.py", line 278, in vlen_list_of_str_formatter
    data[i, :len(value)] = value
TypeError: len() of unsized object

As a temporary fix, in table.py (line 272), I changed: value = np.asarray(m[header]) to value = str(value).split(";") Seems to do the job for now. My Lineages (taxonomy columns) were following this nomenclature: k__Bacteria; p__Proteobacteria; c__Gammaproteobacteria; o__Alteromonadales; f__Alteromonadaceae; g__AlteromonadaceaeFA Cheers,

ElDeveloper commented 9 years ago

Thanks for reporting this @jtremblay! @wasade do you happen to have any ideas?

jtremblay commented 9 years ago

np, however I just find out that when I convert back hdf5 tables to tsv, taxonomy lineages are not written - the taxonomy column (header included) is simply not there... But when I dump the hdf5 file, I see the taxonomy information.

wasade commented 9 years ago

iirc, you need to explicitly indicate you want to retain a given observation metadata when going to tsv. Have you looked at the examples in biom convert --help? On Jul 16, 2015 3:39 PM, "Julien Tremblay" notifications@github.com wrote:

np, however I just find out that when I convert back hdf5 tables to tsv, taxonomy lineages are not written - the taxonomy column (header included) is simply not there...

— Reply to this email directly or view it on GitHub https://github.com/biocore/biom-format/issues/637#issuecomment-122109790 .

jtremblay commented 9 years ago

My bad, when including appropriate options it works fine. Sorry and thanks.

wasade commented 9 years ago

No worries, glad to help! If things are working, could you close the issue please? On Jul 16, 2015 4:22 PM, "Julien Tremblay" notifications@github.com wrote:

My bad, when including appropriate options it works fine. Sorry.

— Reply to this email directly or view it on GitHub https://github.com/biocore/biom-format/issues/637#issuecomment-122120684 .

jtremblay commented 9 years ago

Absolutely, done.

wasade commented 9 years ago

Thanks! On Jul 16, 2015 4:46 PM, "Julien Tremblay" notifications@github.com wrote:

Absolutely, done.

— Reply to this email directly or view it on GitHub https://github.com/biocore/biom-format/issues/637#issuecomment-122124332 .