Skip to content
Snippets Groups Projects
Commit c7260140 authored by Marco Biasini's avatar Marco Biasini
Browse files

improve error messages for ValidateSEQRESAlignment

parent e1a7044d
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,7 @@ def ValidateSEQRESAlignment(aln, chain=None): ...@@ -15,6 +15,7 @@ def ValidateSEQRESAlignment(aln, chain=None):
:returns: True if all residues (beside gaped ones) are connected, False :returns: True if all residues (beside gaped ones) are connected, False
otherwise. otherwise.
""" """
from ost import LogWarning
from ost import seq from ost import seq
from ost import mol from ost import mol
if aln.GetCount() != 2: if aln.GetCount() != 2:
...@@ -41,11 +42,15 @@ def ValidateSEQRESAlignment(aln, chain=None): ...@@ -41,11 +42,15 @@ def ValidateSEQRESAlignment(aln, chain=None):
i += 1 i += 1
r1 = residues[i-1] r1 = residues[i-1]
r2 = residues[i] r2 = residues[i]
if r1.one_letter_code=='?' or r2.one_letter_code=='?':
continue
if l != '-': if l != '-':
if not mol.InSequence(r1.handle, r2.handle): if not mol.InSequence(r1.handle, r2.handle):
LogWarning('%s and %s are not connected by peptide bond' % (str(r1), str(r2)))
return False return False
else: else:
if mol.InSequence(r1.handle, r2.handle): if mol.InSequence(r1.handle, r2.handle):
LogWarning('%s and %s are connected by peptide bond' % (str(r1), str(r2)))
return False return False
l = s l = s
return True return True
...@@ -98,6 +103,7 @@ def AlignToSEQRES(chain, seqres, try_resnum_first=False, validate=True): ...@@ -98,6 +103,7 @@ def AlignToSEQRES(chain, seqres, try_resnum_first=False, validate=True):
'", while SEQRES is "' + seqres[r1.number.num - 1] + '", while SEQRES is "' + seqres[r1.number.num - 1] +
'" at the corresponding position.') '" at the corresponding position.')
try_resnum_first = False try_resnum_first = False
break
if not try_resnum_first: if not try_resnum_first:
fragments=[residues[0].one_letter_code] fragments=[residues[0].one_letter_code]
for r1, r2 in zip(residues[:-1], residues[1:]): for r1, r2 in zip(residues[:-1], residues[1:]):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment