Skip to content

Commit e606d67

Browse files
committed
Fix StructureQuery
1 parent 2018578 commit e606d67

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/biotite/database/rcsb/query.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,9 @@ class StructureQuery(SingleQuery):
439439
Examples
440440
--------
441441
442-
>>> query = StructureQuery("1L2Y", chain="A")
442+
>>> query = StructureQuery("1GYA", assembly="1")
443443
>>> print(sorted(search(query)))
444-
['1L2Y', '1RIJ', '2JOF', '2LDJ', '2M7D', '7MQS', '9DPF']
444+
['1CDB', '1GYA', '1QA9']
445445
"""
446446

447447
def __init__(self, pdb_id, chain=None, assembly=None, strict=True):
@@ -452,7 +452,7 @@ def __init__(self, pdb_id, chain=None, assembly=None, strict=True):
452452
):
453453
raise TypeError("Either the chain ID or assembly ID must be set")
454454
elif chain is None:
455-
self._value = {"entry_id": pdb_id, "asssembly_id": assembly}
455+
self._value = {"entry_id": pdb_id, "assembly_id": assembly}
456456
else:
457457
self._value = {"entry_id": pdb_id, "asym_id": chain}
458458

tests/database/test_rcsb.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,9 @@ def test_search_sequence():
196196

197197

198198
@pytest.mark.skipif(cannot_connect_to(RCSB_URL), reason="RCSB PDB is not available")
199-
def test_search_structure():
200-
query = rcsb.StructureQuery("1L2Y", chain="A")
199+
@pytest.mark.parametrize("chain, assembly", [("A", None), (None, "1")])
200+
def test_search_structure(chain, assembly):
201+
query = rcsb.StructureQuery("1L2Y", chain=chain, assembly=assembly)
201202
test_ids = rcsb.search(query)
202203
assert "1L2Y" in test_ids
203204

0 commit comments

Comments
 (0)