Skip to content

Danpf/fix bond order consistency#10

Merged
gtauriello merged 3 commits into
rcsb:masterfrom
danpf:danpf/fix_bond_order_consistency
Jun 29, 2018
Merged

Danpf/fix bond order consistency#10
gtauriello merged 3 commits into
rcsb:masterfrom
danpf:danpf/fix_bond_order_consistency

Conversation

@danpf

@danpf danpf commented Jun 29, 2018

Copy link
Copy Markdown
Collaborator

We shouldn't require that you have to have both bondOrder and bondAtomList.
At least according to the spec.

This should fix that and I added some tests to make sure it doesn't
happen again

Also added a little better reporting in a few places where is consistent fails

danpf and others added 3 commits June 28, 2018 18:48
We shouldn't require that you have to have both bondOrder and bondAtomList.
At least according to the spec.

This should fix that and I added some tests to make sure it doesn't
happen again.
@gtauriello

Copy link
Copy Markdown
Collaborator

Thanks for catching this. There is one thing though that I am unsure about. I had assumed that all fields of groupType objects (https://github.com/rcsb/mmtf/blob/master/spec.md#grouplist) were required. As a result, the encoder will always write those fields and the decoder throws an error if any of them is missing. In the example files, groups with missing bonds just had empty lists there and that works fine. I guess that's ok, but I opened an issue in the mmtf repo to clarify...

Again: this is only about whether or not it is ok for fields within a group to be missing from the MMTF file. I think that your proposed changes for consistency checks are ok.

btw: do you know of any example MMTF file, where a group has a non-empty bondAtomList and an empty bondOrderList? Just wondering if this was spotted somewhere...

@danpf

danpf commented Jun 29, 2018

Copy link
Copy Markdown
Collaborator Author

Thanks for your updates @gtauriello

I had assumed that all fields of groupType objects ... were required

This is definitely something that's not really clear from the documentation. I sort of assumed that the optional stuff carried over from the StructureData class but I probably shouldn't have.

btw: do you know of any example MMTF file, where a group has a non-empty bondAtomList and an empty bondOrderList? Just wondering if this was spotted somewhere...

No this was an application specific problem I ran into. Haven't had any problems with real mmtf files, but reworking old scripts to fit the spec

I once saw that schrodinger has their own mmtf implementation and they have scripts from pdb->mmtf which obviously ignore bonds. I don't know if that counts as evidence against the necessity of the group data though.

@gtauriello

Copy link
Copy Markdown
Collaborator

Ok. For now I would say that we keep it like this and just allow for those groupType sub fields to contain empty lists as you did. Dependent on what comes out in mmtf repo issue, we can adapt the encoder/decoder to even drop the empty lists and allow for them to be missing.

@gtauriello
gtauriello merged commit 11497de into rcsb:master Jun 29, 2018
@pwrose

pwrose commented Jun 29, 2018 via email

Copy link
Copy Markdown
Collaborator

@gtauriello

Copy link
Copy Markdown
Collaborator

Since this is more general than the C++ implementation, it probably makes sense to continue the discussion in the mmtf repo: rcsb/mmtf#33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants