Skip to content

Commit

Permalink
make distance cutoff uniform for query types
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniBodor committed Oct 31, 2023
1 parent ab408a5 commit 6b63b9b
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions deeprank2/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ def __post_init__(self):
if not isinstance(self.chain_ids, list):
self.chain_ids = [self.chain_ids]

if not self.distance_cutoff:
if self.resolution == 'atom':
self.distance_cutoff = 5.5
if self.resolution == 'residue':
self.distance_cutoff = 10

# convert None to empty type (e.g. list, dict) for arguments where this is expected
for f in fields(self):
value = getattr(self, f.name)
Expand Down Expand Up @@ -244,9 +250,6 @@ def __post_init__(self):
+ f"but {len(self.chain_ids)} was/were given.")
self.variant_chain_id = self.chain_ids[0]

if not self.distance_cutoff:
self.distance_cutoff = 4.5

@property
def residue_id(self) -> str:
"""String representation of the residue number and insertion code."""
Expand Down Expand Up @@ -331,12 +334,6 @@ def __post_init__(self):
raise ValueError("`chain_ids` must contain exactly 2 chains for `ProteinProteinInterfaceQuery` objects, "
+ f"but {len(self.chain_ids)} was/were given.")

if not self.distance_cutoff:
if self.resolution == 'atom':
self.distance_cutoff = 5.5
if self.resolution == 'residue':
self.distance_cutoff = 10

def get_query_id(self) -> str:
"""Returns the string representing the complete query ID."""
return (
Expand Down

0 comments on commit 6b63b9b

Please sign in to comment.