biom convert no longer supported? How do we export files in tsv formats?

I'm trying to export my .qza files into a .tsv format (or similar) so I can do analyses in R. In the past, I was able to use qiime tools export to generate a .biom file and a taxonomy file, which could be combined and exported with the following commands:

biom add-metadata -i //c/Sequencing/feature-table.biom -o //c/Sequencing/Complete_OTU_table.biom --observation-metadata-fp //c/Sequencing/taxonomy.tsv --observation-header FeatureID,Taxon --sc-separated Taxon

biom convert -i //c/Sequencing/Complete_OTU_table.biom -o //c/Sequencing/Complete_OTU_table.txt --to-tsv --header-key Taxon

However, biom convert no longer works due to a change made when Python was updated from v2 to v3: python - TypeError: sequence item 0: expected str instance, bytes found - Stack Overflow

I am unable to use biom convert to export my data now, so I thought using qiime tools export may get me there, but I am unable to find any information about what can be passed to --output-format TEXT. Basic calls like "txt" and "tsv" result in the same TypeError: No format: xxx

I can roll back to an older version of Qiime2 and I do not have this issue with biom convert, but that is a silly work around that will not be accessible when I move to working on a computing cluster from my personal machine where I have more control over versioning. Are there any solutions to this?

1 Like

Hi there,

Can I ask what version of Qiime2 you are trying to use biom convert in? I used it recently in qiime2-amplicon-2023.9. I first exported it like so:

qiime tools export \
--input-path table_clustered97.qza \
--output-path abundance_table

Which makes a directory called abundance_table with the biom table inside of it, then I convert it to a tsv using the biom command in my qiime2 env:

biom convert -i abundance_table/feature-table.biom \
-o abundance_table/feature-table.tsv --to-tsv

But obviously if you have a later version than that I am unsure.

I've had this issue on multiple versions. I'm currently using the most up-to-date release (amplicon:2024.5), but have had this issue with several releases since the core:2022.8 release. That is the current version I have to roll back to in order to get biom convert to not result in the python error I linked above. I have not tried the amplicon:2023.9 release you are using, but I think I used another 2023 release and had the same issue (which is why I've kept the 2022.8 release around).

Hi again @Brightbeard ,

Oh, how odd.
Did you install Qiime2 via conda? Can I ask what version of Conda and Python you are using? Did you try to use the qiime2 tools export followed by biom convert as in the above example you still get an error? Sorry for all the questions! For clarity, I am using Python 3.9.12, conda 23.3.1 (slightly old) and installed Qiime2 via conda.

I don't know if this tool maybe of help to you GitHub - jbisanz/qiime2R: Import qiime2 artifacts to R

No problem on the questions! I appreciate the help. I am using the Docker container on a Windows machine, which has Python 3.9.19 and conda 24.5.0.

The problem is specifically with the --header-key Taxon portion of the biom convert command, as I just tried biom convert -i //c/Sequencing/Complete_OTU_table.biom -o //c/Sequencing/Complete_OTU_table.txt --to-tsv without --header-key Taxon and it generated a .tsv file for me. That specific option is what concatenates the taxonomy assignments to my OTU table and is very handy, so it would be nice to retain it. With this file and the taxonomy.tsv file created from exporting the taxa.qza file, however, I can conduct a join in R to assign the taxa based on their feature ID to the OTU table.

I do my analyses in R anyway so this step wouldn't be all that burdensome, but it would be nice to have one command to add the taxon assignments to the OTU table and export the entire thing as a .tsv file. Others who haven't troubleshot this issue may be left confused why they can't simply export their complete matrix once they are done with the bioinformatics.


I see, apologies for the confusion! I had someone ask me for as similar thing, they wanted the output to have the columns including the taxa, the sequences and then it's abundance in each sample plus metadata.

I ended up outputting the taxa results with and the abundance tables using qiime tools export :

qiime metadata tabulate \
--m-input-file rep-seqs.qza \
--m-input-file taxonomy_results.qza \
--o-visualization rep-seq-tax.qzv

qiime tools export \
--input-path test_16s_table.qza \
--output-path abundance_table

biom convert -i abundance_table/feature-table.biom \
-o abundance_table/feature-table.tsv --to-tsv

I then using pandas to join on the Feature IDs.

Maybe someone else has a neater single command but that’s the way I went about it.


This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.