joey711 / biomformat-oldfork

This is deprecated. Please post issues at the BioC-synced joey711/biomformat
https://github.com/joey711/biomformat
1 stars 1 forks source link

Lose metadata colnames when writing biom object to file #3

Open altrickter opened 8 years ago

altrickter commented 8 years ago

I noticed recently that I lost my metadata column names (both sample_metadata() and observation_metadata() ) after writing a biom object to file and reading it back in with read_biom(). I've tracked it down to the way jsonlite::toJSON() within biomformat::write_biom() writes the json file. The column names are lost while writing. I haven't yet figured out what modifications of arguments in jsonlite::toJSON() need to be made to fix the issue. However, I found that with RJSONIO::toJSON() the issue is resolved.

Here's a demo of the issue in this gist with an example adapted from the write_biom() help docs: https://gist.github.com/altrickter/978e23dd3bded3cabd75286b994a6a0f.