Conversation
|
|
||
| *Type*: [Map](#types) | ||
|
|
||
| *Description*: A field meant to store information on specific bonds. Must have the same length as [numBonds](#numbonds). |
There was a problem hiding this comment.
If it must be of same length as numBonds then it can be an array instead of a map, right?
There was a problem hiding this comment.
Sorry I will think of a way to rephrase this, the idea is that you have keys with the values being arrays with length numBonds if that makes sense!
There was a problem hiding this comment.
So, a map where the keys are integers in [0, numBonds - 1].
There was a problem hiding this comment.
One note, using maps is more flexible but does not easily allow for the bespoke array compression techniques.
There was a problem hiding this comment.
it would be like:
for something with 5 atoms
atomProperties: {
"colorList": ["#ff0000", "#008000", "#ff0000", "#008000", "#ff0000"],
"representationList": [0, 0, 0, 1, 1]
}
extraProperties: {
"availableRepresentations": {0: "lines", 1: "spheres", 2: "surface", 3: "ball and stick", 4: "cartoon"}
}
There was a problem hiding this comment.
availableRepresentations in this case doesn't have to be 5, while colorList and representationList do have to have len(5)
There was a problem hiding this comment.
@arose You can also find a bigger example in the original discussion thread
There was a problem hiding this comment.
From the examples it looks to me the type should be Array (or List) and not Map.
spec.md
Outdated
|
|
||
| *Description*: A field meant to store information on specific bonds. Must have the same length as [numBonds](#numbonds). | ||
|
|
||
| *Convention key:value pairs* |
There was a problem hiding this comment.
A description of what is meant exactly by 'convention' would be good.
There was a problem hiding this comment.
I will also rephrase this, I think I will change this to reserved key:value pairs and add a little explanation at the of the extra data header.
The idea was to have some key: value pairs locked so that you could save things like camera positions/color schemes between applications. (ie everyone use cameraOrientation not app1_camera_orientation and app2_camera_orientation).
|
|
||
| *Type*: [Map](#types) | ||
|
|
||
| *Description*: A field meant to store information on specific bonds. Must have the same length as [numBonds](#numbonds). |
There was a problem hiding this comment.
@arose You can also find a bigger example in the original discussion thread
spec.md
Outdated
| *Type*: [Map](#types) | ||
|
|
||
| *Description*: A field meant to store any information at all. There are no length restrictions associated with this field. We | ||
| encourage you to apply our encoding techniques to your application data to reduce file sizes! |
There was a problem hiding this comment.
I would propose to move this encouragement to the parent section, since it makes a lot of sense to use encoding techniques for any of the other extra data fields too (especially large ones like bondProperties, atomProperties and groupProperties).
|
I like it, I have one more request for the spec. I think the type of the 'second level' of the maps should be defined more clearly, i.e. Map<String, SECOND_LEVEL_TYPE>. So atomProperties, bondProperties, groupProperties, chainProperties and modelProperties are maps of type Map<String, Array>. And the array must be of the same length as the corresponding num* filed. And extraProperties is a Map<String, String|Float|Integer|Map|Array|Binary> How about adding a note about more specific Map types to the types section and then define the map type exactly for all the *Properties fields? |
|
I like the idea of specifying the second level type to be some type of list but I would have it as |
|
@arose @gtauriello I think I addressed both of your concerns. Let me know if that is what you had in mind! |
|
Looks verbose but very clear. I did observe some issues when looking at the full use case example though (see comments below). |
spec.md
Outdated
| ... | ||
| "structureProperties": { | ||
| "foo_id": "ABC", | ||
| }, |
There was a problem hiding this comment.
There is an inconsistency with the specs here. We don't have a structureProperties field. I guess that properties at the structure level should go into extraProperties?
At least, I don't see the use case for having a structureProperties field vs adding structure-level properties in extraProperties.
There was a problem hiding this comment.
oops good point. Yes I'm ok with just wrapping it all into extraProperties. it would be sort of a useless field.
spec.md
Outdated
|
|
||
| Example | ||
|
|
||
| ``` |
There was a problem hiding this comment.
Visual detail: I think you can use ```python for a nice syntax highlighting here. I assume you removed the json highlighting since comments and ... would have looked bad there...
| }, | ||
| "extraProperties": { | ||
| "pymol_bondTypes": {0: "metal", 1: "single", 2: "double", 3: "triple", 4: "aromatic"} | ||
| } |
There was a problem hiding this comment.
One note on type restrictions for extraProperties: the example here doesn't fit since the key is an Integer and not a String. So we should either drop any second level type restriction on extraProperties or change the example. I vote for the former...
There was a problem hiding this comment.
I think the spec of Map<String, String|Float|Integer|Map|Array|Binary> sort of implies 'anything goes' but I can add a note to mention that there are no restrictions on the second level of extraProperties
There was a problem hiding this comment.
Oops you are right. I was looking at the third level here. Please ignore my comment above.
There was a problem hiding this comment.
oh well i added an example anyway! I think it is ok to be extra verbose for now and then once we have some experience working with this we can make some changes.
|
lgtm, thanks @danpf! @gtauriello ok too? If so I will merge it. |
* New fields as in rcsb/mmtf#36 * msgpack zone kept in StructureData to deal with extra data * Updated MapDecoder to init from maps as well * Extended tests and copy, =, ==, != functions for StructureData
* New fields as in rcsb/mmtf#36 * msgpack zone kept in StructureData to deal with extra data * Updated MapDecoder to init from maps as well * Extended tests and copy, =, ==, != functions for StructureData
This PR gives applications/users places to store their own data that's associate with their mmtf files.
Up for discussion:
Any
Convention key:value pairsthat you would like to see added.Any
Conventionencode types you'd like to addDo you like the format?
Other conventions to think about adding:
If you are interested there is already a working implementation of this in:
https://github.com/danpf/mmtf-cpp/tree/rcsb_extraData
This is meant to clear up issue:
#32