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.
I noticed recently that I lost my metadata column names (both
sample_metadata()
andobservation_metadata()
) after writing a biom object to file and reading it back in withread_biom()
. I've tracked it down to the wayjsonlite::toJSON()
withinbiomformat::write_biom()
writes the json file. The column names are lost while writing. I haven't yet figured out what modifications of arguments injsonlite::toJSON()
need to be made to fix the issue. However, I found that withRJSONIO::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.