ihmwg / python-modelcif

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

Support data_id for associated files #32

Closed gtauriello closed 1 year ago

gtauriello commented 1 year ago

Following up on the recent addition of the data_id field to _ma_associated_archive_file_details and _ma_entry_associated_files (see commit added to v1.4.4 of ModelCIF)...

I think one could have a function in modelcif.associated.File which enables an instance of modelcif.data.Data (or its subclasses) to be added to it and the dumper would then use this to assign a data_id in the appropriate table. Do you think this would work?

We have a few use cases in ModelArchive which could benefit from this and one of them is a conversion I am currently doing.

benmwebb commented 1 year ago

It'd be easy enough to have File and its subclasses take an optional data argument. I can take a look.