From 51d69fc121506e6e74a71979eae2ce6720473d2e Mon Sep 17 00:00:00 2001 From: James Krieger Date: Tue, 16 Apr 2024 13:30:22 +0200 Subject: [PATCH] add no waters align error --- prody/proteins/waterbridges.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/prody/proteins/waterbridges.py b/prody/proteins/waterbridges.py index ec11c20df..a01c9f114 100644 --- a/prody/proteins/waterbridges.py +++ b/prody/proteins/waterbridges.py @@ -1135,6 +1135,9 @@ def findClusterCenters(file_pattern, **kwargs): sel_waters.append(j) coords_wat = np.array([sel_waters], dtype=float) + if coords_wat.shape[0] == 0: + raise ValueError('No waters were selected. You may need to align your trajectory') + selectedWaters.setCoords(coords_wat) selectedWaters.setNames(['DUM']*len(selectedWaters)) selectedWaters.setResnums(range(1, len(selectedWaters)+1))