<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Wfa on CuriousCoding</title><link>https://curiouscoding.nl/tags/wfa/</link><description>Recent content in Wfa on CuriousCoding</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 17 Nov 2022 00:00:00 +0100</lastBuildDate><atom:link href="https://curiouscoding.nl/tags/wfa/index.xml" rel="self" type="application/rss+xml"/><item><title>The complexity and performance of WFA and band doubling</title><link>https://curiouscoding.nl/posts/wfa-edlib-perf/</link><pubDate>Thu, 17 Nov 2022 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/wfa-edlib-perf/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#complexity-analysis" &gt;Complexity analysis&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#complexity-of-edit-distance" &gt;Complexity of edit distance&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#complexity-of-affine-cost-alignment" &gt;Complexity of affine cost alignment&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#comparison" &gt;Comparison&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#implementation-efficiency" &gt;Implementation efficiency&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#band-doubling-for-affine-scores-was-never-implemented" &gt;Band doubling for affine scores was never implemented&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#wfa-vs-band-doubling-for-affine-costs" &gt;WFA vs band doubling for affine costs&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#future-work" &gt;Future work&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This note explores the complexity and performance of band doubling (Edlib) and WFA under varying cost models.&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://github.com/Martinsos/edlib" class="external-link" target="_blank" rel="noopener"&gt;Edlib&lt;/a&gt; (&lt;a href="#citeproc_bib_item_5"&gt;Šošić and Šikić 2017&lt;/a&gt;) uses band doubling and runs in \(O(ns)\) time, for sequence length \(n\)&#10;and edit distance \(s\) between the two sequences.&lt;/p&gt;</description></item><item><title>Linear memory WFA?</title><link>https://curiouscoding.nl/posts/linear-memory-wfa/</link><pubDate>Wed, 17 Aug 2022 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/linear-memory-wfa/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#motivation" &gt;Motivation&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#path-traceback-two-strategies" &gt;Path traceback: two strategies&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#observations" &gt;Observations&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#what-information-is-needed-for-path-tracing" &gt;What information is needed for path tracing&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#a-pragmatic-solution" &gt;A pragmatic solution&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#another-interpretation" &gt;Another interpretation&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#affine-costs" &gt;Affine costs&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;&lt;a id="figure--result"&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;figure&gt;&lt;a href="https://curiouscoding.nl/ox-hugo/simple-final.png"&gt;&lt;img src="https://curiouscoding.nl/ox-hugo/simple-final.png"&#10;&#9;&#9;&#9;alt="Figure 1: Only the red substitutions and blue indel need to be stored to trace the entire path."&gt;&lt;/a&gt;&lt;figcaption&gt;&#10;&#9;&#9;&#9;&lt;p&gt;&lt;span class="figure-number"&gt;Figure 1: &lt;/span&gt;Only the red substitutions and blue indel need to be stored to trace the entire path.&lt;/p&gt;&#10;&#9;&#9;&lt;/figcaption&gt;&#10;&lt;/figure&gt;</description></item><item><title>Transforming match bonus into cost</title><link>https://curiouscoding.nl/posts/alignment-scores-transform/</link><pubDate>Tue, 16 Aug 2022 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/alignment-scores-transform/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#tricks-with-match-bonus-or-how-to-fool-dijkstra-s-limitations" &gt;Tricks with match bonus or how to fool Dijkstra&amp;rsquo;s limitations&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#edit-graph" &gt;Edit graph&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#algorithms" &gt;Algorithms&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#potentials" &gt;Potentials&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#multiple-variants" &gt;Multiple variants&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#some-notes-on-algorithms" &gt;Some notes on algorithms&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#wfa" &gt;WFA&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#a" &gt;A*&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#extending-to-different-cost-models" &gt;Extending to different cost models&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#affine-costs" &gt;Affine costs&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#substitution-matrices" &gt;Substitution matrices&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#but-not-local-alignment" &gt;But not local alignment&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#evaluations" &gt;Evaluations&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#unequal-string-length" &gt;Unequal string length&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#equal-string-lengths" &gt;Equal string lengths&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;h2 id="tricks-with-match-bonus-or-how-to-fool-dijkstra-s-limitations"&gt;&#10; Tricks with match bonus or how to fool Dijkstra&amp;rsquo;s limitations&#10; &lt;a class="heading-link" href="#tricks-with-match-bonus-or-how-to-fool-dijkstra-s-limitations"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;&lt;em&gt;The reader is assumed to have basic knowledge about pairwise alignment and graph theory.&lt;/em&gt;&lt;/p&gt;</description></item><item><title>The BiWFA meeting condition</title><link>https://curiouscoding.nl/posts/biwfa-meeting-condition/</link><pubDate>Mon, 11 Jul 2022 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/biwfa-meeting-condition/</guid><description>&lt;p&gt;&lt;strong&gt;cross references:&lt;/strong&gt; &lt;a href="https://github.com/smarco/BiWFA-paper/issues/8" class="external-link" target="_blank" rel="noopener"&gt;BiWFA GitHub issue&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;It seems that getting the meeting/overlap condition of BiWFA&#10;(Marco-Sola et al. (&lt;a href="#citeproc_bib_item_1"&gt;2023&lt;/a&gt;), Algorithm 1 and Lemma 2.1) correct is tricky.&lt;/p&gt;&#10;&lt;p&gt;Let \(p := \max(x, o+e)\) be the maximal cost of any edge in the edit graph.&#10;As in the BiWFA paper, let \(s_f\) and \(s_r\) be the distances of the &lt;em&gt;forward&lt;/em&gt; and&#10;&lt;em&gt;reverse&lt;/em&gt; fronts computed so far.&lt;/p&gt;&#10;&lt;p&gt;We prove the following lemma:&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Lemma&lt;/strong&gt;&#10;Once BiWFA has expanded the forward and reverse fronts up to \(s_f\) and \(s_r\) and&#10;has found &lt;em&gt;some&lt;/em&gt; path of cost \(s \leq s_f + s_r\),&#10;expanding the fronts until \(s&amp;rsquo;_f + s&amp;rsquo;_r \geq s+p+o\) is guaranteed to find a&#10;&lt;em&gt;shortest&lt;/em&gt; path.&lt;/p&gt;</description></item><item><title>Variations on the WFA recursion</title><link>https://curiouscoding.nl/posts/wfa-variations/</link><pubDate>Sun, 17 Apr 2022 03:14:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/wfa-variations/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#gap-open" &gt;Gap open&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#gap-close" &gt;Gap close&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#symmetric-alternatives" &gt;Symmetric alternatives&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#another-symmetry" &gt;Another symmetry&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#conclusions" &gt;Conclusions&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;&lt;strong&gt;cross references:&lt;/strong&gt; &lt;a href="https://github.com/smarco/BiWFA-paper/issues/4" class="external-link" target="_blank" rel="noopener"&gt;BiWFA GitHub issue&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;In this post I will explore some variations of the recursion used by WFA/BiWFA&#10;for the affine version of the diagonal transition algorithm.&#10;In particular, we will go over a &lt;em&gt;gap-close&lt;/em&gt; variant, and look into some more symmetric&#10;formulations.&lt;/p&gt;&#10;&lt;h2 id="gap-open"&gt;&#10; Gap open&#10; &lt;a class="heading-link" href="#gap-open"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;WFA (&lt;a href="#citeproc_bib_item_3"&gt;Marco-Sola et al. 2021&lt;/a&gt;) introduces the affine cost variant of the classic diagonal&#10;transition method.&#10;Let us call it a &lt;strong&gt;gap-open&lt;/strong&gt; variant, because the gap-open cost \(o\) is payed when&#10;opening the gap, that is, when jumping from the \(M\) &lt;em&gt;layer&lt;/em&gt; to the \(I\) or \(D\) &lt;em&gt;layer&lt;/em&gt;.&lt;/p&gt;</description></item></channel></rss>