<html>
<head>
<style>
body {
font-family: Verdana, sans-serif;
font-size: 0.8em;
color:#484848;
}
h1, h2, h3 { font-family: "Trebuchet MS", Verdana, sans-serif; margin: 0px; }
h1 { font-size: 1.2em; }
h2, h3 { font-size: 1.1em; }
a, a:link, a:visited { color: #2A5685;}
a:hover, a:active { color: #c61a1a; }
a.wiki-anchor { display: none; }
fieldset.attachments {border-width: 1px 0 0 0;}
hr {
width: 100%;
height: 1px;
background: #ccc;
border: 0;
}
span.footer {
font-size: 0.8em;
font-style: italic;
}
</style>
</head>
<body>
Issue #2776 has been updated by Markus Piotrowski.
<ul>
<li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li>
<li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li>
</ul>
<p>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):<br /><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></p>
<hr />
<h1><a href="https://redmine.open-bio.org/issues/2776#change-15288">Bug #2776: Bio.pairwise2 returns non-optimal alignment in at least some cases</a></h1>
<ul><li>Author: Klaus Kopec</li>
<li>Status: Closed</li>
<li>Priority: Normal</li>
<li>Assignee: Biopython Dev Mailing List</li>
<li>Category: Main Distribution</li>
<li>Target version: 1.49</li>
<li>URL: </li></ul>
<p>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.</p>
<p>Yet, I only encountered the problem with large mismatch values (which I use as I need mismatch free alignments).</p>
<p>simple example (the bug also occured for longer sequences):</p>
<blockquote><blockquote><blockquote>
<p>sequence1 = 'GKG'<br />sequence2 = 'GWG'<br />A = pairwise2.align.globalms(sequence1, sequence2, 5, -100, -5, -5)[0]<br />A<sup><a href="#fn0">0</a></sup></p>
</blockquote></blockquote></blockquote>
<p>'GKG--'</p>
<blockquote><blockquote><blockquote>
<p>A<sup><a href="#fn1">1</a></sup></p>
</blockquote></blockquote></blockquote>
<p>'--GWG'</p>
<blockquote><blockquote><blockquote>
<p>A<sup><a href="#fn2">2</a></sup></p>
</blockquote></blockquote></blockquote>
<p>-15.0</p>
<p>whereas<br />'GK-G'<br />'G-WG'</p>
<p>would get a score of 0</p>
<p>System: Kubuntu 8.10 64Bit, Python 2.6.1, Biopython 1.49 (my pairwise2.py is identical to the current CVS version of it)</p>
<hr />
<span class="footer"><p>You have received this notification because you have either subscribed to it, or are involved in it.<br />To change your notification preferences, please click here and login: <a class="external" href="http://redmine.open-bio.org">http://redmine.open-bio.org</a></p></span>
</body>
</html>