ihmwg / python-ihm

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

Have make-mmcif.py handle PyMOL output files #67

Closed benmwebb closed 2 years ago

benmwebb commented 2 years ago

PyMOL tends to output mmCIF files containing just the _atom_site table. Each row in the table uses . for both label_asym_id and label_entity_id. This makes python-ihm think the model contains only chain with no ID, and that the Entity for it is None, which causes a failure when trying to write out the new file.

While this output is clearly far from valid, we should make a best effort to make sense of it. We could do this by reading auth_asym_id to determine the chain IDs and label_comp_id to get the residue names (and thus the entity sequence). Our older code using BioPython does successfully parse these files, so we can steal the logic from there to populate the sequence.