Skip to content

Commit

Permalink
Missing N or O in AMD Group: Keep going
Browse files Browse the repository at this point in the history
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 #17
  • Loading branch information
speleo3 committed Dec 7, 2020
1 parent 3937cb1 commit f028562
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions propka/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,10 @@ def setup_atoms(self):
# 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')
Expand Down

0 comments on commit f028562

Please sign in to comment.