From 68e593a81b5656a8a6e29769236691e74a6cc656 Mon Sep 17 00:00:00 2001 From: Simon Mathis Date: Sun, 5 Jan 2025 23:31:08 +0000 Subject: [PATCH] feat: allow setting the `label_entity_id` in the cif from the atom array, if it is annotated. This is a standard category that comes with CIF files (https://mmcif.wwpdb.org/dictionaries/mmcif_pdbx_v50.dic/Items/_atom_site.label_entity_id.html) --- src/biotite/structure/io/pdbx/convert.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/biotite/structure/io/pdbx/convert.py b/src/biotite/structure/io/pdbx/convert.py index 5367c74bd..1da846172 100644 --- a/src/biotite/structure/io/pdbx/convert.py +++ b/src/biotite/structure/io/pdbx/convert.py @@ -836,7 +836,11 @@ def set_structure( ) atom_site["label_comp_id"] = np.copy(array.res_name) atom_site["label_asym_id"] = np.copy(array.chain_id) - atom_site["label_entity_id"] = _determine_entity_id(array.chain_id) + atom_site["label_entity_id"] = ( + np.copy(array.label_entity_id) + if "label_entity_id" in array.get_annotation_categories() + else _determine_entity_id(array.chain_id) + ) atom_site["label_seq_id"] = np.copy(array.res_id) atom_site["pdbx_PDB_ins_code"] = Column( np.copy(array.ins_code),