Skip to content

Commit

Permalink
Fixing problem reading data for some IdenticalChains...
Browse files Browse the repository at this point in the history
  • Loading branch information
prubach committed Nov 22, 2021
1 parent cae6883 commit 17e50eb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="spyprot",
version='0.7.10',
version='0.7.12',
author="INTERDISCIPLINARY LABORATORY of BIOLOGICAL SYSTEMS MODELLING, University of Warsaw, Warsaw, Poland",
author_email="[email protected], [email protected]",
description="This package provides a set of tools for accessing protein databases and manipulating PDB/CIF files.",
Expand Down
3 changes: 3 additions & 0 deletions spyprot/fetchChainInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,9 @@ def __init__(self, pdbcode, chain):
documents = self.exec_query("pdb_id,entity_id,chain_id,assembly_composition", [('pdb_id', pdbcode)])

for i in range(len(documents)):
if 'chain_id' not in documents[i] or 'entity_id' not in documents[i]:
self.results = (None, None)
continue
chain_id = documents[i]['chain_id']
ent_id = documents[i]['entity_id']
if chain in chain_id:
Expand Down
4 changes: 4 additions & 0 deletions test_fetch_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ def test_fetchChainInfo_IdenticalChains():


def test_fetchChainInfo_IdenticalChainsAndEntityId():
f = IdenticalChainsAndEntityId('7dzp', 'A')
ent_id, chains = f.get()
assert ent_id == None
assert chains == None
f = IdenticalChainsAndEntityId('6wm4', 'Y')
ent_id, chains = f.get()
assert int(ent_id) == 9
Expand Down

0 comments on commit 17e50eb

Please sign in to comment.