Converting a .biom file to a .txt file.

3,078 views
Skip to first unread message

benz...@hartwick.edu

unread,
May 6, 2015, 1:32:20 AM5/6/15
to qiime...@googlegroups.com
Hello,

I am currently trying to convert my OTU.biom table to a OTU.txt format. When I run the command I obtained from the website I get a error back saying i must specify the table type. Is this "out table". I am not sure what it means by specify table type. Attached is the code I have tried. 

Thank you, 
Todd Benziger
biom_convert.rtf

suman...@gmail.com

unread,
May 6, 2015, 3:55:58 AM5/6/15
to qiime...@googlegroups.com
Hi Todd,

The table type should be .txt. I have modified the script you ran, try to run this, you should be fine.

biom convert -i full_otu_table_taxa.biom -o full_otu_table_taxa.txt --to-tsv --header-key taxonomy

Medha.

Jose Morillo

unread,
May 6, 2015, 6:22:34 AM5/6/15
to qiime...@googlegroups.com
Hello all,

I have the same problem. The command (copied from http://biom-format.org/documentation/biom_conversion.html) apparently does not work if the original otu table format is not specified, at least in my system (qiime 1.9.0, VB).

Command: biom convert -i nochimerasfiles/final_otu_table.biom -o final_otu_table.txt --to-tsv --header-key taxonomy

result: (..)
pyqi.core.exception.CommandError: Must specify --table-type!

Could you chek if there is a problem?

Thanks,
jose

Medha Suman

unread,
May 7, 2015, 12:47:42 AM5/7/15
to qiime...@googlegroups.com
Hi,

I use the command mentioned below to convert the biom table and it works fine. Give it a try.

biom convert -i otu_table.biom -o otu_table.txt -b --header-key taxonomy

Medha.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Qiime Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qiime-forum/KLdtTY7D12Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qiime-forum...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Benziger, Peter T.

unread,
May 11, 2015, 10:35:13 AM5/11/15
to qiime...@googlegroups.com
Hello,
Thank you for the help but I am still running into the same issue. I have also tried with "-b" but it says it is not an option. 

Todd

Medha Suman

unread,
May 11, 2015, 12:58:15 PM5/11/15
to qiime...@googlegroups.com
Hi Todd,

Can you send me the exact command that you are using and the error message that you are getting?

Medha.

Miriam

unread,
May 26, 2015, 8:17:08 PM5/26/15
to qiime...@googlegroups.com
Hi,

Have you found a solution to this? I have the same problem ie. "biom convert -i otu_qiime.biom -o otu_qiime.txt --to-tsv --header-key taxonomy " returns the error "pyqi.core.exception.CommandError: Must specify --table-type!".

I only get the above error if using a biom table created by pick_closed_reference_otus.py, but the command works fine if using a biom table which was converted from a txt table using "biom convert -i otuup.txt -o otu_up.biom --table-type="OTU table" --to-json". 

I noticed that the formats are slightly different between these 2 biom tables (attached). 
I'm using qiime 1.9.0. on linux2 with python 2.7.5. and biom format 2.1.4. and h5py not installed.

Thanks a lot,
Miriam

otu_qiime.biom
otu_up.biom

Jai Ram Rideout

unread,
May 27, 2015, 4:10:33 PM5/27/15
to qiime...@googlegroups.com
Hi Miriam,

Can you try the following command? I added "--table-type 'OTU table'" to the end of your original command.

biom convert -i otu_qiime.biom -o otu_qiime.txt --to-tsv --header-key taxonomy --table-type 'OTU table'

Best,
Jai

--

---
You received this message because you are subscribed to the Google Groups "Qiime Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qiime-forum...@googlegroups.com.

Miriam

unread,
May 28, 2015, 1:52:54 AM5/28/15
to qiime...@googlegroups.com
Thanks Jai!

I added the "--table-type 'OTU table" and it worked. I've also upgraded to qiime 1.9.1 and tried it with the original command again and it now worked too, so either way, all good.

Thanks,
Miriam

Jai Ram Rideout

unread,
May 28, 2015, 8:09:55 PM5/28/15
to qiime...@googlegroups.com
Glad to hear it worked for you!

Wessam Elnemr

unread,
Jul 8, 2015, 10:06:52 AM7/8/15
to qiime...@googlegroups.com
Hi, 
I have found that biom convert in my system do the opposite. It converts txt to biom. While I need to convert the biom file into txt. Any ideas???


biom convert -i table.txt -o table.biom --table-type "OTU table" --to-hdf5

Jose Navas

unread,
Jul 8, 2015, 7:08:15 PM7/8/15
to qiime...@googlegroups.com
Hi Wessam,

See this page for possible ways of using biom convert, including going from biom to txt.


There are multiple options depending on which information you want to maintain.

Also, if you run biom convert --help you can see all possible parameters that biom convert can take.

Hope this helps!
Jose Navas

Abby Kimball

unread,
Dec 2, 2015, 3:25:04 PM12/2/15
to Qiime 1 Forum
Does anyone know the reverse of this? What the code is to get a txt file to a biom file?

Colin Brislawn

unread,
Dec 2, 2015, 7:03:17 PM12/2/15
to Qiime 1 Forum
That (and more!) is on the official biom-format web site:

One way may be:
biom convert -i otu_table.txt -o new_otu_table.biom --to-hdf5 --table-type="OTU table" --process-obs-metadata taxonomy


Colin

Reply all
Reply to author
Forward
0 new messages