Skip to content
Snippets Groups Projects
Commit d8c4242e authored by Bienchen's avatar Bienchen
Browse files

Added handling of 'X', '?' to AlignToSeqres

parent 3446577b
No related branches found
No related tags found
No related merge requests found
...@@ -85,6 +85,10 @@ def AlignToSEQRES(chain, seqres, try_resnum_first=False, validate=True): ...@@ -85,6 +85,10 @@ def AlignToSEQRES(chain, seqres, try_resnum_first=False, validate=True):
:returns: The alignment of the residues in the chain and the SEQRES entries. :returns: The alignment of the residues in the chain and the SEQRES entries.
:rtype: :class:`~ost.seq.AlignmentHandle` :rtype: :class:`~ost.seq.AlignmentHandle`
""" """
def IsEqual(olc1, olc2):
return olc1 in ('X', '?') or olc2 in ('X', '?') or olc1 == olc2
from ost import seq from ost import seq
from ost import mol from ost import mol
from ost import LogWarning from ost import LogWarning
...@@ -96,7 +100,7 @@ def AlignToSEQRES(chain, seqres, try_resnum_first=False, validate=True): ...@@ -96,7 +100,7 @@ def AlignToSEQRES(chain, seqres, try_resnum_first=False, validate=True):
aln_seq = seq.CreateSequence('atoms', '-'*len(seqres)) aln_seq = seq.CreateSequence('atoms', '-'*len(seqres))
for r1 in residues: for r1 in residues:
if r1.number.num <= len(seqres) and r1.number.num > 0: if r1.number.num <= len(seqres) and r1.number.num > 0:
if seqres[r1.number.num - 1] == r1.one_letter_code: if IsEqual(seqres[r1.number.num - 1], r1.one_letter_code):
aln_seq[r1.number.num - 1] = r1.one_letter_code aln_seq[r1.number.num - 1] = r1.one_letter_code
else: else:
LogWarning('Sequence mismatch: chain has "' + r1.one_letter_code + LogWarning('Sequence mismatch: chain has "' + r1.one_letter_code +
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment