diff --git a/translate2modelcif.py b/translate2modelcif.py index db38384526713ea2de31014a8bd8203a201f3325..89b92b1920229ddaa7da40cfe2305a579df89256 100644 --- a/translate2modelcif.py +++ b/translate2modelcif.py @@ -7,6 +7,7 @@ import sys import requests +import ihm import modelcif import modelcif.dumper import modelcif.reference @@ -236,12 +237,18 @@ def _store_as_modelcif(interaction_name, data_json, file_prfx): id=interaction_name.upper(), model_details=data_json["model_details"], ) - # create target entities, references, ... + # create target entities, references, source... + # for source we assume all chains come from the same taxon + source = ihm.source.Natural( + ncbi_taxonomy_id=data_json["target_entities"][0]["up_ncbi_taxid"], + scientific_name=data_json["target_entities"][0]["up_organism"], + ) for cif_ent in data_json["target_entities"]: # ToDo [input]: Get entity description mdlcif_ent = modelcif.Entity( cif_ent["cif_sequence"], description="entity.pdbx_description", + source=source, references=[ modelcif.reference.UniProt( cif_ent["up_id"], @@ -258,8 +265,10 @@ def _store_as_modelcif(interaction_name, data_json, file_prfx): ) ], ) + system.entities.append(mdlcif_ent) system.target_entities.append(mdlcif_ent) + # audit_authors system.authors.extend(data_json["audit_authors"]) @@ -327,5 +336,5 @@ if __name__ == "__main__": # LocalWords: struct cif utf mmcif fh datetime ost io ToDo chn lst rn idx aa # LocalWords: sqe olc ACDEFGHIKLMNPQRSTVWY RuntimeError upkb txt pylint iter # LocalWords: rspns unicode startswith sline len elif NCBI TaxID ncbi taxid -# LocalWords: seqlen crc ISOFORM DT dt flds isoforms isoform ent LoadPDB +# LocalWords: seqlen crc ISOFORM DT dt flds isoforms isoform ent LoadPDB ihm # LocalWords: mdlcf mdlcif