Entering edit mode
8.9 years ago
4doom4
•
0
Hi there,
I aligned two sequences using the following:
from Bio import pairwise2
from Bio.pairwise2 import format_alignment
from Bio.SubsMat import MatrixInfo as matlist
seq1="SKFQQVEQDVKAIEVSLSARIGVSVLDTQNGEYWDYNGNQRFPLTSTFKTIACAKLLYDAEQGKVNPNST"
seq2="HPETLVKVKDAEDQLGARVGYIELDLNSGKILESFRPEERFPLTSTFKVLLCGAVLSRVDAGQEQLGRRI"
matrix = matlist.blosum62
gap_open = -11
gap_extend = -1
alns = pairwise2.align.localds(seq1, seq2, matrix, gap_open, gap_extend)
for a in alns:
print(format_alignment(*a))
So the result is:
SKFQQVEQDVKAIEVSLSARIGVSVLDTQNGEYWD-YNGNQRFPLTSTFKTIACAKLLYDAEQGKVNPNST-
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
--HPETLVKVKDAEDQLGARVGYIELDLNSGKILESFRPEERFPLTSTFKVLLCGAVLSRVDAGQEQLGRRI
Score=98
And hence the begin is 9 but I want the beginning to be 2. Also for the end I want it to be the T/R combination and not K/Q. Any idea how to do this?
Thanks!
Can you please explain what do you mean when you say, I want the beginning/end to be x/y?
Have you calculated the score of the preferred alignment (starting from the first letter of the second sequence, F/H, though to the last letter of the first sequence, T/R)? Can you see how to adjust the scoring to make this win?
Also raised on the Biopython mailing list, see http://lists.open-bio.org/pipermail/biopython/2016-February/015892.html