Skip to content

Commit

Permalink
Optionally retrieve entity ids for released pdbs
Browse files Browse the repository at this point in the history
  • Loading branch information
Pawel Rubach committed Jun 14, 2024
1 parent 28038e6 commit fb3343a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
14 changes: 10 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
tqdm==4.31.1
tqdm
#==4.31.1
lxml
requests>=2.20.0
psutil>=5.6.6
subprocess32==3.5.4
wget==3.2
subprocess32
#==3.5.4
#
wget
#==3.2
biopython>=1.78
pysolr==3.10.0b2
pysolr
#==3.10.0b2
setuptools
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.8.8',
version='0.9.0',
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
13 changes: 9 additions & 4 deletions spyprot/fetchChainInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,16 +826,17 @@ class ReleasedPDBs(PDBeSolrSearch):
Return empty list if None found
example:
a = ReleasedProteins("2020-10-10", "2020-11-10").get()
a = ReleasedPDBs("2020-10-10", "2020-11-10").get()
Parameters
==========
from_date: datetime or string in format YYYY-MM-DD
to_date: datetime or string in format YYYY-MM-DD
uniq_chains: if True return a list of tuples containing (PDBCode, Chain), else return just PDBCodes.
uniq_chains: (default: True) if True return a list of tuples containing (PDBCode, Chain), else return just PDBCodes.
with_entity_id: (default: False) if True add entity_id to the returned tuple (PDBCode, EntityId, Chain) - to work must be combined with "uniq_chains" set to True
'''

def __init__(self, from_date, to_date='', uniq_chains=True, only_prot=True, only_rna=False):
def __init__(self, from_date, to_date='', uniq_chains=True, only_prot=True, only_rna=False, with_entity_id=False):
super().__init__()
if type(from_date) is datetime.date:
from_date = from_date.strftime("%Y-%m-%d")
Expand All @@ -860,8 +861,12 @@ def __init__(self, from_date, to_date='', uniq_chains=True, only_prot=True, only
for i in range(len(documents)):
pid = documents[i]['pdb_id']
chain_id = documents[i]['chain_id']
entity_id = documents[i]['entity_id']
if uniq_chains:
self.results.append((pid, sorted(chain_id)[0]))
if with_entity_id:
self.results.append((pid, entity_id, sorted(chain_id)[0]))
else:
self.results.append((pid, sorted(chain_id)[0]))
else:
if pid not in self.results:
self.results.append(pid)
Expand Down

0 comments on commit fb3343a

Please sign in to comment.