From f028562026cc891ccc7cec69e49d95b5152527eb Mon Sep 17 00:00:00 2001 From: Thomas Holder Date: Mon, 7 Dec 2020 09:26:53 +0100 Subject: [PATCH] Missing N or O in AMD Group: Keep going Print a warning but don't fail if the N or O atoms are missing in an amide group. This is consistent with how other groups handle missing atoms. Closes https://github.com/jensengroup/propka/issues/17 --- propka/group.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/propka/group.py b/propka/group.py index 3488f09..3a284ce 100644 --- a/propka/group.py +++ b/propka/group.py @@ -740,6 +740,10 @@ class AMDGroup(Group): # Identify the oxygen and nitrogen amide atoms the_oxygen = self.atom.get_bonded_elements('O') the_nitrogen = self.atom.get_bonded_elements('N') + if not (the_oxygen and the_nitrogen): + _LOGGER.warning(f"Missing N or O atom: {self}") + self.set_center([self.atom]) + return # add protons to the nitrogen PROTONATOR.protonate_atom(the_nitrogen[0]) the_hydrogens = the_nitrogen[0].get_bonded_elements('H')