[Biopython-dev] [Biopython (old issues only) - Bug #2776] (Closed) Bio.pairwise2 returns non-optimal alignment in at least some cases

redmine at redmine.open-bio.org redmine at redmine.open-bio.org
Thu Jul 21 10:02:59 UTC 2016


Issue #2776 has been updated by Markus Piotrowski.

Status changed from New to Closed
% Done changed from 0 to 100

Actually, this was a limitation of the former implementation of the Gotoh algorithm in pairwise2. This has been changed with a different implementation, and now this works as expected (coming in Biopython 1.68):
<pre>
>>> from Bio import pairwise2
>>> seq1 = 'GKG'
>>> seq2 = 'GWG'
>>> align = pairwise2.align.globalms(seq1, seq2, 5, -100, -5, -5)[0]
>>> align
('GK-G', 'G-WG', 0.0, 0, 4)
>>> print pairwise2.format_alignment(*align)
GK-G
||||
G-WG
  Score=0
</pre>

----------------------------------------
Bug #2776: Bio.pairwise2 returns non-optimal alignment in at least some cases
https://redmine.open-bio.org/issues/2776#change-15288

* Author: Klaus Kopec
* Status: Closed
* Priority: Normal
* Assignee: Biopython Dev Mailing List
* Category: Main Distribution
* Target version: 1.49
* URL: 
----------------------------------------
At least in some cases, Bio.pairwise2 returns an alignment that is not the one with the highest score for the input parameters. This occurs in localXX and globalXX.

Yet, I only encountered the problem with large mismatch values (which I use as I need mismatch free alignments).

simple example (the bug also occured for longer sequences):
>>> sequence1 = 'GKG'
>>> sequence2 = 'GWG'
>>> A = pairwise2.align.globalms(sequence1, sequence2, 5, -100, -5, -5)[0]
>>> A[0]
'GKG--'
>>> A[1]
'--GWG'
>>> A[2]
-15.0

whereas
'GK-G'
'G-WG'

would get a score of 0


System: Kubuntu 8.10 64Bit, Python 2.6.1, Biopython 1.49 (my pairwise2.py is identical to the current CVS version of it)



-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here and login: http://redmine.open-bio.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython-dev/attachments/20160721/efb00cbf/attachment-0001.html>


More information about the Biopython-dev mailing list