ihmwg / python-ihm

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

Add support for collection tables #108

Closed benmwebb closed 1 year ago

benmwebb commented 1 year ago

Add functionality to tag a System as being part of a collection, by using the new ihm_entry_collection table, perhaps by adding a Collection object referenced from the system.

@brindakv if I recall correctly, the related ihm_entry_collection_mapping table would be populated by and maintained by the archive, not used in individual PDB-Dev entries? So no need for python-ihm to explicitly support it.

brindakv commented 1 year ago

Yes, ihm_entry_collection_mapping table would be populated by and maintained by the archive. But the archive uses python-ihm too :-)

benmwebb commented 1 year ago

Yes, ihm_entry_collection_mapping table would be populated by and maintained by the archive. But the archive uses python-ihm too :-)

But is the intention that this table be duplicated in every file belonging to that collection, or would you maintain a separate mapping file? e.g. if collection foo contains entries a, b and c, would the ihm_entry_collection_mapping table be included in a.cif, b.cif and c.cif, together with the other PDBx/IHM tables in those files, or only by itself in foo.cif ? In the former case, the Collection class could take an optional list of entries. In the latter case, it would be easy to write a script (using python-ihm if you like) to write out just that table.

brindakv commented 1 year ago

But is the intention that this table be duplicated in every file belonging to that collection, or would you maintain a separate mapping file? e.g. if collection foo contains entries a, b and c, would the ihm_entry_collection_mapping table be included in a.cif, b.cif and c.cif, together with the other PDBx/IHM tables in those files, or only by itself in foo.cif ? In the former case, the Collection class could take an optional list of entries. In the latter case, it would be easy to write a script (using python-ihm if you like) to write out just that table.

At present, we need the latter scenario (only foo.cif). This collection file will be identified using _ihm_entry_collection.id provided in a.cif, b.cif and c.cifand available for download from each entry page.

benmwebb commented 1 year ago

Both table examples are looped in the dictionary, and I don't see any prohibition against it, so I assume a given entry can be a member of multiple collections?

brindakv commented 1 year ago

Both table examples are looped in the dictionary, and I don't see any prohibition against it, so I assume a given entry can be a member of multiple collections?

Yes, based on our discussion here.