Closed peterjc closed 1 year ago
Desired output (e.g. with #910):
$ biom export-metadata -i example-json.biom --sample-metadata-fp /dev/stdout --observation-metadata-fp /dev/stdout
lions tigers bears
S0 S0i S0ii S0iii
S1 S1i S1ii S1iii
S2 S2i S2ii S2iii
S3 S3i S3ii S3iii
heads shoulders knees toes
O0 O0i O0ii O0iii O0iv
O1 O1i O1ii O1iii O1iv
O2 O2i O2ii O2iii O2iv
O3 O3i O3ii O3iii O3iv
O4 O4i O4ii O4iii O4iv
O5 O5i O5ii O5iii O5iv
O6 O6i O6ii O6iii O6iv
O7 O7i O7ii O7iii O7iv
O8 O8i O8ii O8iii O8iv
O9 O9i O9ii O9iii O9iv
This produces a simple 4 sample, 10 observation test case with all observations having metadata for headers, shoulders, knees and toes (non-alphabetical order as per the song), and all samples having metadata lions, tigers, and bears (oh my - again, non-alphabetical ordering):
The exported metadata does not respect the original order:
On the bright side, the table itself seems to respect the order, as does the raw JSON output - line breaks added by hand:
I'm not familiar enough with HDF5 to check that directly.
I think the bug is in Table method
metadata_to_dataframe
which usessorted(...)