Skip to content

Commit

Permalink
Merge pull request #732 from Croydon-Brixton/feat/allow_setting_entit…
Browse files Browse the repository at this point in the history
…y_id

feat: allow setting the `label_entity_id` from the AtomArray, if annotated
  • Loading branch information
padix-key authored Jan 8, 2025
2 parents 226f2b4 + 68e593a commit 318db78
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/biotite/structure/io/pdbx/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 318db78

Please sign in to comment.