ihmwg / python-ihm

Python package for handling IHM mmCIF and BinaryCIF files
MIT License
14 stars 7 forks source link

Add pdbx_PDB_ins_code to AtomSite and write _atom_site.pdbx_PDB_ins_code in dump_atoms #65

Closed jkosinski closed 2 years ago

jkosinski commented 2 years ago

BioPython mmCIF parser, https://github.com/biopython/biopython/blob/master/Bio/PDB/MMCIFParser.py, requires _atom_site.pdbx_PDB_ins_code to be present but this field is not present in IHM's AtomSite and dumper, making the IHM files invalid for BioPython. Would it be possible to add pdbx_PDB_ins_code as an option?

benmwebb commented 2 years ago

This has to be a bug in BioPython and should be reported there. Insertion codes are not required in the PDBx dictionary: https://mmcif.wwpdb.org/dictionaries/mmcif_pdbx_v50.dic/Items/_atom_site.pdbx_PDB_ins_code.html

It would certainly be straightforward to write out atom_site.pdbx_PDB_ins_code but they would all be blank (at least for now) because we don't assign insertion codes.

brindakv commented 2 years ago

@benmwebb, _atom_site.pdbx_PDB_ins_code is not a mandatory field according to PDBx/mmCIF. However, it might be good to support reading and writing it out an as optional field.

jkosinski commented 2 years ago

I reported it to BioPython and they said would fix. But if no problem for Ben to introduce it soon in python-ihm, that would be very helpful, as we use python-ihm to generate CIFs for some pipelines which use biopython and now crash (not sure how fast biopython will be as they have a longer list of issues on the list ;-)

On Tue, Nov 23, 2021 at 2:22 PM Brinda Vallat @.***> wrote:

@benmwebb https://github.com/benmwebb, _atom_site.pdbx_PDB_ins_code is not a mandatory field according to PDBx/mmCIF. However, it might be good to support reading and writing it out an as optional field.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ihmwg/python-ihm/issues/65#issuecomment-976526228, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMDPONMGDABP7FTC62VZY3UNOISVANCNFSM5IQ4OQ4Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

benmwebb commented 2 years ago

I already resolved and closed this issue; it was very straightforward to add.

jkosinski commented 2 years ago

Thanks Ben!!

On Tue, Nov 23, 2021 at 6:26 PM Ben Webb @.***> wrote:

I already resolved and closed this issue; it was very straightforward to add.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ihmwg/python-ihm/issues/65#issuecomment-976888079, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMDPONLNVFFA6VCUNMJDCTUNPFGDANCNFSM5IQ4OQ4Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.