ihmwg / python-modelcif

Python package for handling ModelCIF mmCIF and BinaryCIF files
MIT License
10 stars 1 forks source link

Reading in then writing out file fails at "atom not in representation" sanity check #20

Closed benmwebb closed 2 years ago

benmwebb commented 2 years ago

For example, adding to the end of examples/mkmodbase.py

with open('output2.cif', 'w') as fh:
    modelcif.dumper.write(fh, [s])

causes the dumper to fail with

ValueError: <ihm.model.Atom object at 0x1028a5040> refers to an asym ID (A) that is not in this model's representation (which includes the following asym IDs: )

This is thrown by python-ihm's sanity checks. python-modelcif models don't have a Representation. We add a dummy one for Models we build ourselves, but clearly this is not working as intended for models we read from a file.