.biom to .csv

This is a quick and easy code to convert your .biom file to a .csv file in R.

FYI: biom – biological observation matrix, which is an output which has recorded the number of different OTUs (open taxonomic units), the number of reads which were accounted for per OTU per sample.


OTU_reads <- read_biom(“path_to_feature-table.biom”)
OTU_table <- as.data.frame(as.matrix(biom_data(OTU_reads)))

write.csv(OTU_table, “path_to_save_feature-table.csv”)