Skip to content

Commit

Permalink
reorder to use else for nonwater
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmkrieger committed Oct 7, 2024
1 parent 7d5a566 commit 1b7c3cf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions prody/proteins/waterbridges.py
Original file line number Diff line number Diff line change
Expand Up @@ -1334,13 +1334,12 @@ def findClusterCenters(file_pattern, **kwargs):
removeResid = []
removeCoords = []
for ii in range(len(coords_all)):
if 'water' not in selection.split():
sel = coords_all.select(str(selection)+' within '+str(distC)+' of center',
center=coords_all.getCoords()[ii])

if 'water' in selection.split() or np.any([water in selection.split() for water in DEFAULTS['water']]):
sel = coords_all.select('water within '+str(distC)+' of center',
center=coords_all.getCoords()[ii])
else:
sel = coords_all.select(str(selection)+' within '+str(distC)+' of center',
center=coords_all.getCoords()[ii])

if sel is not None and len(sel) <= int(numC):
removeResid.append(coords_all.getResnums()[ii])
Expand Down

0 comments on commit 1b7c3cf

Please sign in to comment.