biopython: How does pairwise2 alignement returns begin on first matching amino acid?
0
0
Entering edit mode
8.2 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!

python biopython blast pairwise2 alignment • 3.2k views
ADD COMMENT
0
Entering edit mode

Can you please explain what do you mean when you say, I want the beginning/end to be x/y?

ADD REPLY
0
Entering edit mode

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?

ADD REPLY
0
Entering edit mode

Also raised on the Biopython mailing list, see http://lists.open-bio.org/pipermail/biopython/2016-February/015892.html

ADD REPLY

Login before adding your answer.

Traffic: 1996 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6