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

[email protected]
Newsgroups gmane.comp.python.bio.devel
Message-ID <redmine.journal-15288.20160721100259.210b52adf52e34ea@redmine.open-bio.org>
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

_______________________________________________
Biopython-dev mailing list
[email protected]
http://mailman.open-bio.org/mailman/listinfo/biopython-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.