From 52adb09ceeefadd1ef970a880889e85988e681ec Mon Sep 17 00:00:00 2001 From: Xavier Robin <xavier.robin@unibas.ch> Date: Fri, 1 Dec 2023 15:23:10 +0100 Subject: [PATCH] fix: fail early and clearly with quote chain names --- modules/mol/alg/pymod/scoring.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/mol/alg/pymod/scoring.py b/modules/mol/alg/pymod/scoring.py index 42acf8554..ced6bf225 100644 --- a/modules/mol/alg/pymod/scoring.py +++ b/modules/mol/alg/pymod/scoring.py @@ -179,11 +179,15 @@ class Scorer: for ch in self._model.chains: if ch.GetName().strip() == "": raise RuntimeError("Model chains must have valid chain names") + if ch.GetName().strip() == "'" or ch.GetName().strip() == '"': + raise RuntimeError("Model chains cannot be named with quote signs (' or \"\")") # catch targets which have empty chain names for ch in self._target.chains: if ch.GetName().strip() == "": raise RuntimeError("Target chains must have valid chain names") + if ch.GetName().strip() == "'" or ch.GetName().strip() == '"': + raise RuntimeError("Target chains cannot be named with quote signs (' or \"\")") if resnum_alignments: # In case of resnum_alignments, we have some requirements on -- GitLab