Skip to content

Commit

Permalink
fix parsing entity ID with numeric values (#571)
Browse files Browse the repository at this point in the history
* fix parsing entity ID with numeric values

* add test to parse problematic structure
  • Loading branch information
BradyAJohnston authored Aug 11, 2024
1 parent 292f0cf commit 735c994
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion molecularnodes/entities/molecule/pdbx.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def entity_ids(self):
return self.file.block.get("entity").get("pdbx_description").as_array().tolist()

def _get_entity_id(self, array, file):
chain_ids = file.block["entity_poly"]["pdbx_strand_id"].as_array()
chain_ids = file.block["entity_poly"]["pdbx_strand_id"].as_array(str)

# the chain_ids are an array of individual items np.array(['A,B', 'C', 'D,E,F'])
# which need to be categorised as [1, 1, 2, 3, 3, 3] for their belonging to individual
Expand Down
5 changes: 5 additions & 0 deletions tests/test_pdbx.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ def test_ss_label_to_int():
]


def test_entity_parsing():
mn.entities.fetch("6VBU", format="bcif")
assert True


def test_get_ss_from_mmcif(snapshot_custom: NumpySnapshotExtension):
mol = mn.entities.load_local(data_dir / "1cd3.cif")

Expand Down

0 comments on commit 735c994

Please sign in to comment.