[Biopython] How does pairwise2 alignement returns begin on first matching amino acid?

Peter Cock p.j.a.cock at googlemail.com
Thu Feb 11 09:51:45 UTC 2016


Hi Ebert,

I just replied on BioStars: 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?

Peter

On Tue, Feb 2, 2016 at 9:11 PM, Ebert Maximilian <m.ebert at umontreal.ca> wrote:
> 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 (hard to see in text mode here is a link to biostars forum entry https://www.biostars.org/p/175229/):
>
> 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!
>
> _______________________________________________
> Biopython mailing list  -  Biopython at mailman.open-bio.org
> http://mailman.open-bio.org/mailman/listinfo/biopython


More information about the Biopython mailing list