Efficient Computation of Sequence Mappability

Abstract Sequence mappability is an important task in genome resequencing. In the ( k , m )-mappability problem, for a given sequence T of length n , the goal is to compute a table whose i th entry is the number of indices $$j \ne i$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>j</mml:mi> <mml:mo>≠</mml:mo> <mml:mi>i</mml:mi> </mml:mrow> </mml:math> such that the length- m substrings of T starting at positions i and j have at most k mismatches. Previous works on this problem focused on heuristics computing a rough approximation of the result or on the case of $$k=1$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>k</mml:mi> <mml:mo>=</mml:mo> <mml:mn>1</mml:mn> </mml:mrow> </mml:math> . We present several efficient algorithms for the general case of the problem. Our main result is an algorithm that, for $$k=O(1)$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>k</mml:mi> <mml:mo>=</mml:mo> <mml:mi>O</mml:mi> <mml:mo>(</mml:mo> <mml:mn>1</mml:mn> <mml:mo>)</mml:mo> </mml:mrow> </mml:math> , works in $$O(n)$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>O</mml:mi> <mml:mo>(</mml:mo> <mml:mi>n</mml:mi> <mml:mo>)</mml:mo> </mml:mrow> </mml:math> space and, with high probability, in $$O(n \cdot \min \{m^k,\log ^k n\})$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>O</mml:mi> <mml:mo>(</mml:mo> <mml:mi>n</mml:mi> <mml:mo>·</mml:mo> <mml:mo>min</mml:mo> <mml:mrow> <mml:mo>{</mml:mo> <mml:msup> <mml:mi>m</mml:mi> <mml:mi>k</mml:mi> </mml:msup> <mml:mo>,</mml:mo> <mml:msup> <mml:mo>log</mml:mo> <mml:mi>k</mml:mi> </mml:msup> <mml:mi>n</mml:mi> <mml:mo>}</mml:mo> </mml:mrow> <mml:mo>)</mml:mo> </mml:mrow> </mml:math> time. Our algorithm requires a careful adaptation of the k -errata trees of Cole et al. [STOC 2004] to avoid multiple counting of pairs of substrings. Our technique can also be applied to solve the all-pairs Hamming distance problem introduced by Crochemore et al. [WABI 2017]. We further develop $$O(n^2)$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>O</mml:mi> <mml:mo>(</mml:mo> <mml:msup> <mml:mi>n</mml:mi> <mml:mn>2</mml:mn> </mml:msup> <mml:mo>)</mml:mo> </mml:mrow> </mml:math> -time algorithms to compute all ( k , m )-mappability tables for a fixed m and all $$k\in \{0,\ldots ,m\}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>k</mml:mi> <mml:mo>∈</mml:mo> <mml:mo>{</mml:mo> <mml:mn>0</mml:mn> <mml:mo>,</mml:mo> <mml:mo>…</mml:mo> <mml:mo>,</mml:mo> <mml:mi>m</mml:mi> <mml:mo>}</mml:mo> </mml:mrow> </mml:math> or a fixed k and all $$m\in \{k,\ldots ,n\}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>m</mml:mi> <mml:mo>∈</mml:mo> <mml:mo>{</mml:mo> <mml:mi>k</mml:mi> <mml:mo>,</mml:mo> <mml:mo>…</mml:mo> <mml:mo>,</mml:mo> <mml:mi>n</mml:mi> <mml:mo>}</mml:mo> </mml:mrow> </mml:math> . Finally, we show that, for $$k,m = \Theta (\log n)$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>k</mml:mi> <mml:mo>,</mml:mo> <mml:mi>m</mml:mi> <mml:mo>=</mml:mo> <mml:mi>Θ</mml:mi> <mml:mo>(</mml:mo> <mml:mo>log</mml:mo> <mml:mi>n</mml:mi> <mml:mo>)</mml:mo> </mml:mrow> </mml:math> , the ( k , m )-mappability problem cannot be solved in strongly subquadratic time unless the Strong Exponential Time Hypothesis fails. This is an improved and extended version of a paper presented at SPIRE 2018.