From 2f03a9fad5facb31976d76a0a144f46cd462780b Mon Sep 17 00:00:00 2001 From: Gabriel Studer <gabriel.studer@unibas.ch> Date: Thu, 4 Aug 2022 15:08:07 +0200 Subject: [PATCH] make warning in AlignToSEQRES more informative, i.e. include chain name just for Bienchen ;) --- modules/seq/alg/pymod/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/seq/alg/pymod/__init__.py b/modules/seq/alg/pymod/__init__.py index 3be1b5845..d0ac795d6 100644 --- a/modules/seq/alg/pymod/__init__.py +++ b/modules/seq/alg/pymod/__init__.py @@ -112,9 +112,12 @@ def AlignToSEQRES(chain, seqres, try_resnum_first=False, validate=True): aln_seq[r1.number.num - 1] = r1.one_letter_code aligned_resnums.add(r1.number.num) else: - LogWarning('Sequence mismatch: chain has "' + r1.one_letter_code + - '", while SEQRES is "' + seqres[r1.number.num - 1] + - '" at the corresponding position.') + msg = 'Sequence mismatch: chain' + if len(view.GetName().strip()): + msg += f' ({view.GetName().strip()})' + msg += f' has {r1.one_letter_code}, while SEQRES is ' + msg += f'{seqres[r1.number.num-1]} at the corresponding position.' + LogWarning(msg) try_resnum_first = False break else: -- GitLab