Export BIOM Table to TSV/CSV

I’m having a similar issue. I’d like to export the feature table as a .csv, but it only gets exported as a .biom file, which doesn’t seem to be compatible with phyloseq:

I’ve tried to import it two ways:

rich_sparse_biom = system.file("extdata", "/Users/annaknight/Documents/Microbiome/exported250/feature-table.biom", package = "phyloseq")
> rich_sparse = import_biom(rich_sparse_biom, parseFunction = parse_taxonomy_greengenes)
Error in read_biom(biom_file = BIOMfilename) : 
  Both attempts to read input file:

either as JSON (BIOM-v1) or HDF5 (BIOM-v2).
Check file path, file name, file itself, then try again.

biomot = import_biom(biom_file)
Error in dimnames(x) <- dn : 
  length of 'dimnames' [2] not equal to array extent
In addition: There were 50 or more warnings (use warnings() to see the first 50)

Do you have any suggestions on how to fix this/export as tsv/csv?

Hi @akknight216, unfortunately we can’t help you with phyloseq, because that software is not developed by us. I would suggest contacting them on their support page with any specific questions.

As far as exporting your feature table to TSV, we can modify the instructions prepared by @jairideout:

qiime tools export table.qza --output-dir exported
biom convert -i exported/feature-table.biom -o feature-table.tsv --to-tsv

This uses the biom cli tool to convert the exported HDF5 version of the feature table to a TSV. We have discussed supporting format transformations at export time, so if/when that happens, this command most likely won’t be necessary. Hope that helps!


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