rcsb / mmtf-cpp

The pure C++ implementation of the MMTF API, decoder and encoder.
MIT License
21 stars 24 forks source link

add json outputter for debugging #34

Open danpf opened 4 years ago

danpf commented 4 years ago

I think this is reasonable to have.... I've had some interest myself in better mmtf 'diff' tools, and had a complaint or two from rosetta users about diffing abilities.

let me know what you think!

i can add an app to do this too if that's of interest

speleo3 commented 4 years ago

insCodeList and altLocList strings get dumped as null bytes: "\u0000". Would look better as empty string, right?

gtauriello commented 4 years ago

Some comments and observations:

So to sum up: If we have such a to_json function as part of the library it should handle unset optional fields. I suggest to drop them since this already happens within GroupType objects (handled automatically via msgpack_encoders.hpp). Also the items above (unneeded conversions, faulty JSON with extra props, unneeded to_json.cpp) should be fixed.