From d413ee32a353d7a191d742fa9a3bdcca58a9eec2 Mon Sep 17 00:00:00 2001 From: James Krieger Date: Thu, 19 Dec 2024 19:48:41 +0000 Subject: [PATCH] handle no KRED better --- prody/proteins/interactions.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/prody/proteins/interactions.py b/prody/proteins/interactions.py index 27b84533e..0e1443181 100644 --- a/prody/proteins/interactions.py +++ b/prody/proteins/interactions.py @@ -1004,6 +1004,10 @@ def calcSaltBridges(atoms, **kwargs): distA = kwargs.pop('distA', distSB) atoms_KRED = atoms.select('protein and ((resname ASP GLU LYS ARG and not backbone and not name OXT NE "C.*" and noh) or (resname HIS HSE HSD HSP and name NE2))') + if atoms_KRED is None: + LOGGER.warn('There are no side chain heavy atoms for residues K, R, E, D and H, so not salt bridges are calculated') + return [] + charged_residues = list(set(zip(atoms_KRED.getResnums(), atoms_KRED.getChids()))) LOGGER.info('Calculating salt bridges.')