From 26a50d11cdd723d0f8ee1b5bd901953fa1b8120a Mon Sep 17 00:00:00 2001 From: Nazanin Donyapour Date: Tue, 26 Dec 2023 13:27:57 -0500 Subject: [PATCH] fix add missing residues error --- pdbfixer/pdbfixer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pdbfixer/pdbfixer.py b/pdbfixer/pdbfixer.py index 431b021..35aa11b 100644 --- a/pdbfixer/pdbfixer.py +++ b/pdbfixer/pdbfixer.py @@ -1263,6 +1263,10 @@ def main(): if options.residues: if options.verbose: print('Finding missing residues...') fixer.findMissingResidues() + for residueNames in fixer.missingResidues.values(): + for residueName in residueNames: + if residueName not in fixer.templates: + raise(KeyError("Cannot find residue %s in template library!" % residueName)) else: fixer.missingResidues = {} if options.nonstandard: