From 1b7c3cf2ff96b8c93e73638ab914414a4b926e1e Mon Sep 17 00:00:00 2001 From: James Krieger Date: Mon, 7 Oct 2024 10:50:07 +0100 Subject: [PATCH] reorder to use else for nonwater --- prody/proteins/waterbridges.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/prody/proteins/waterbridges.py b/prody/proteins/waterbridges.py index 5fb15737e..7aa643c9e 100644 --- a/prody/proteins/waterbridges.py +++ b/prody/proteins/waterbridges.py @@ -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])