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 Nov 3, 2023
1 parent a2640b6 commit 6480644
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 @@ -72,6 +72,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 @@ -245,9 +251,6 @@ def __post_init__(self):
+ f"but {len(self.chain_ids)} 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 @@ -332,12 +335,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 6480644

Please sign in to comment.