The write.xlsx function fails with "Error: Taxonomy map must be a character matrix." when importing a minimal BIOM file, rather than simply not outputting data that is not present in the object.
To reproduce, use this as test.txt (careful, there are tabs in it):
#OTU ID sample1 sample2
obs1 1.0 0.0
obs2 0.0 2.0
and run
$ biom convert -i test.txt -o test.biom --to-hdf5
$ R
> library('rbiom')
> b <- read.biom('test.biom', tree=FALSE)
> write.xlsx(b, 'test.xlsx')
Error: Taxonomy map must be a character matrix.
As a workaround, I'm running
> b$taxonomy[1,] = c("a")
What is particularly weird is that the taxonomy data injected here is not even emitted in the XLSX -- but then again, maybe I'm not putting it in the right way.
Please consider updating the error handling so that any loaded file can also be saved to XLSX.
The write.xlsx function fails with "Error: Taxonomy map must be a character matrix." when importing a minimal BIOM file, rather than simply not outputting data that is not present in the object.
To reproduce, use this as test.txt (careful, there are tabs in it):
and run
As a workaround, I'm running
What is particularly weird is that the taxonomy data injected here is not even emitted in the XLSX -- but then again, maybe I'm not putting it in the right way.
Please consider updating the error handling so that any loaded file can also be saved to XLSX.