Table of Contents
Fetching ...

An Efficient Data Structure and Algorithm for Long-Match Query in Run-Length Compressed BWT

Ahsan Sanaullah, Degui Zhi, Shaojie Zhang

TL;DR

This work tackles the problem of extracting long, informative substring matches between a pattern and a highly repetitive text by introducing long locally maximal exact matches (LEMs) and presenting an index- and algorithmic framework tailored to BWT runs (r). The authors extend the OptBWTR index to OptBWTRL by enabling constant-time PLCP and φ computations via move data structures, maintaining $O(r)$ space, and enabling $O(m+occ)$-time output of all long LEMs given matching statistics, where $m$ is the pattern length and $occ$ the number of long LEMs. A detailed method combines balanced sa_{lcp}-interval extension and long sa_{lcp}-interval advancement, using a dynamic dictionary to output matches with provable expected time bounds and a deterministic variant. The approach yields a linear-time, space-efficient mechanism for identifying long, non-maximal but highly informative pattern–text matches, with significant potential impact for pangenome and haplotype analyses, read-to-pangenome mapping, and seed-based genome alignment in massive datasets. Overall, OptBWTRL enables scalable long LEM querying in compressed space, facilitating deeper similarity insights beyond MEMs/SMEMs in biomedically relevant, ultra-large genomic collections.

Abstract

In this paper, we describe a new type of match between a pattern and a text that aren't necessarily maximal in the query, but still contain useful matching information: locally maximal exact matches (LEMs). There are usually a large amount of LEMs, so we only consider those above some length threshold $\mathcal{L}$. These are referred to as long LEMs. The purpose of long LEMs is to capture substring matches between a query and a text that are not necessarily maximal in the pattern but still long enough to be important. Therefore efficient long LEMs finding algorithms are desired for these datasets. However, these datasets are too large to query on traditional string indexes. Fortunately, these datasets are very repetitive. Recently, compressed string indexes that take advantage of the redundancy in the data but retain efficient querying capability have been proposed as a solution. We therefore give an efficient algorithm for computing all the long LEMs of a query and a text in a BWT runs compressed string index. We describe an $O(m+occ)$ expected time algorithm that relies on an $O(r)$ words space string index for outputting all long LEMs of a pattern with respect to a text given the matching statistics of the pattern with respect to the text. Here $m$ is the length of the query, $occ$ is the number of long LEMs outputted, and $r$ is the number of runs in the BWT of the text. The $O(r)$ space string index we describe relies on an adaptation of the move data structure by Nishimoto and Tabei. We are able to support $LCP[i]$ queries in constant time given $SA[i]$. In other words, we answer $PLCP[i]$ queries in constant time. Long LEMs may provide useful similarity information between a pattern and a text that MEMs may ignore. This information is particularly useful in pangenome and biobank scale haplotype panel contexts.

An Efficient Data Structure and Algorithm for Long-Match Query in Run-Length Compressed BWT

TL;DR

This work tackles the problem of extracting long, informative substring matches between a pattern and a highly repetitive text by introducing long locally maximal exact matches (LEMs) and presenting an index- and algorithmic framework tailored to BWT runs (r). The authors extend the OptBWTR index to OptBWTRL by enabling constant-time PLCP and φ computations via move data structures, maintaining space, and enabling -time output of all long LEMs given matching statistics, where is the pattern length and the number of long LEMs. A detailed method combines balanced sa_{lcp}-interval extension and long sa_{lcp}-interval advancement, using a dynamic dictionary to output matches with provable expected time bounds and a deterministic variant. The approach yields a linear-time, space-efficient mechanism for identifying long, non-maximal but highly informative pattern–text matches, with significant potential impact for pangenome and haplotype analyses, read-to-pangenome mapping, and seed-based genome alignment in massive datasets. Overall, OptBWTRL enables scalable long LEM querying in compressed space, facilitating deeper similarity insights beyond MEMs/SMEMs in biomedically relevant, ultra-large genomic collections.

Abstract

In this paper, we describe a new type of match between a pattern and a text that aren't necessarily maximal in the query, but still contain useful matching information: locally maximal exact matches (LEMs). There are usually a large amount of LEMs, so we only consider those above some length threshold . These are referred to as long LEMs. The purpose of long LEMs is to capture substring matches between a query and a text that are not necessarily maximal in the pattern but still long enough to be important. Therefore efficient long LEMs finding algorithms are desired for these datasets. However, these datasets are too large to query on traditional string indexes. Fortunately, these datasets are very repetitive. Recently, compressed string indexes that take advantage of the redundancy in the data but retain efficient querying capability have been proposed as a solution. We therefore give an efficient algorithm for computing all the long LEMs of a query and a text in a BWT runs compressed string index. We describe an expected time algorithm that relies on an words space string index for outputting all long LEMs of a pattern with respect to a text given the matching statistics of the pattern with respect to the text. Here is the length of the query, is the number of long LEMs outputted, and is the number of runs in the BWT of the text. The space string index we describe relies on an adaptation of the move data structure by Nishimoto and Tabei. We are able to support queries in constant time given . In other words, we answer queries in constant time. Long LEMs may provide useful similarity information between a pattern and a text that MEMs may ignore. This information is particularly useful in pangenome and biobank scale haplotype panel contexts.

Paper Structure

This paper contains 17 sections, 7 theorems, 2 figures.

Key Result

Lemma 1

(i) Let $x$ be the integer satisfying $p^+_x \leq i < p^+_{x+1}$ for some integer $i\in [1,n]$. Then $LCP[ISA[i]] = LCP[ISA[p^+_x]] - (i - p^+_x)$.

Figures (2)

  • Figure 1: BWT and related structures for a text $T=missisismississippi\$$. $SA,LCP,LF,F,$ and $L$ are orderd by position in $SA$ while $ISA,PLCP,\phi,$ and $\phi^{-1}$ are ordered by position in the text.
  • Figure 2: MEMs and LEMs of a pattern (haplotype) vs a text (pangenome). Here, haplotype $i$ is the sequence of characters between $\$_{i-1}$ and $\$_i$. The text is the concatenation of the haplotypes $T="a c t g a c c c a c t g a a a c t c g g g c c c t t \$_1a c t g g g g a c t g a a a c t c g g g c c c t t \$_2\dots"$. MEMs and long LEMs of the pattern (a haplotype not contained in the pangenome) with respect to the text (the pangenome) are highlighted. MEMs are shaded in while LEMs are boxed in. The length threshold $\mathcal{L} = 10$ for the long LEMs. In this example, MEMs are only able to detect relationships among the haplotypes most closely related to the pattern haplotype. Haplotypes similar to the pattern but not maximally similar at any location remain undetected. Notably, haplotype 2 is very similar to the pattern but doesn't contain any MEMs with it. The number of undetected similar haplotypes in biobank scale haplotype panels may be an order of magnitude larger.

Theorems & Definitions (7)

  • Lemma 1
  • Lemma 2
  • Lemma 3
  • Lemma 4
  • Lemma 5
  • Lemma 6
  • Lemma 7