The ModelCIF dictionary does not require an Entity for each Template - in fact the entity ID in a template is supposed to be that of the entity in the template's own mmCIF file, not a parent-child relationship to the entity table in this file.
Replace the entity argument to Template with at least some of Entity's own arguments, namely the primary sequence and an alphabet, and add an optional entity_id argument. Either copy Entity's logic for mapping sequence to chemical components, determining poly/non-poly, etc., or create an internal Entity object to handle that logic and pass through methods/attributes as necessary.
We may also need to modify modelcif.reader to get template sequence from MA rather than PDBx categories.
The ModelCIF dictionary does not require an
Entity
for eachTemplate
- in fact the entity ID in a template is supposed to be that of the entity in the template's own mmCIF file, not a parent-child relationship to theentity
table in this file.Replace the
entity
argument toTemplate
with at least some ofEntity
's own arguments, namely the primary sequence and an alphabet, and add an optionalentity_id
argument. Either copyEntity
's logic for mapping sequence to chemical components, determining poly/non-poly, etc., or create an internalEntity
object to handle that logic and pass through methods/attributes as necessary.We may also need to modify
modelcif.reader
to get template sequence from MA rather than PDBx categories.