Skip to content

Commit a18e793

Browse files
authored
tolerate CIF files with missing/inapplicable symbols in entity_id field (#34)
Bugfix to tolerate CIF files with missing/inapplicable symbols in entity_id field
1 parent 805a27a commit a18e793

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/atomworks/io/utils/non_rcsb.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ def initialize_chain_info_from_atom_array(
174174
if "label_entity_id" in atom_array.get_annotation_categories():
175175
# (Entity ID is the same for all atoms in the chain)
176176
atom_level_chain_identifiers = atom_array.chain_iid if use_chain_iids else atom_array.chain_id
177-
chain_info_dict[chain_identifier]["rcsb_entity"] = int(
178-
atom_array.label_entity_id[atom_level_chain_identifiers == chain_identifier][0]
179-
)
177+
representative_entity_id = atom_array.label_entity_id[atom_level_chain_identifiers == chain_identifier][0]
178+
if representative_entity_id not in [".", "?"]:
179+
chain_info_dict[chain_identifier]["rcsb_entity"] = int(representative_entity_id)
180180

181181
if infer_chain_type:
182182
chain_info_dict[chain_identifier]["chain_type"] = chain_type

0 commit comments

Comments
 (0)