Locality-Sensitive Bucketing Functions for the Edit Distance

Ke Chen, Mingfu Shao · DOI

TL;DR

This paper introduces Locality-Sensitive Bucketing (LSB), a generalization of locality-sensitive hashing (LSH) that allows a single sequence to be assigned to multiple buckets. By relaxing the "one-hash-per-item" rule, the authors provide a robust theoretical framework for grouping similar sequences under the edit distance metric, even when dealing with the high error rates typical of modern long-read sequencing technologies.

What Problem Does This Paper Address?

In bioinformatics, "bucketing" is a crucial preprocessing step used to group similar DNA or protein sequences together to avoid the prohibitive cost of comparing every sequence against every other sequence (all-vs-all comparison).

Traditional methods rely on $k$-mer matching (exact short substrings). However, these fail when sequences have high error rates—common in third-generation sequencing like PacBio or Oxford Nanopore—because even a few errors can destroy all identical $k$-mers. Locality-Sensitive Hashing (LSH) was designed to fix this by ensuring similar items "collide" in the same bucket with high probability. Unfortunately, designing LSH functions for edit distance (which accounts for insertions, deletions, and substitutions) is notoriously difficult, often resulting in "gaps" where similar sequences are missed or dissimilar ones are incorrectly grouped.

Methods

The authors propose Locality-Sensitive Bucketing (LSB). Unlike LSH, which maps a sequence to exactly one bucket, an LSB function maps a sequence to a subset of buckets.

The core of their approach is the definition of $(d_1, d_2)$-sensitivity:

  1. Sensitivity: If two sequences are within an edit distance of $d_1$, they must share at least one bucket.
  2. Specificity: If two sequences are at an edit distance of at least $d_2$, they must share zero buckets.

The paper provides:

  • Optimal $(1, 2)$-sensitive functions: They prove that for a sequence of length $n$ to be $(1, 2)$-sensitive, it must be mapped to at least $n$ buckets. They provide an algorithm to achieve this.
  • $(r, r)$-guaranteed subsets: They explore using a subset of all possible sequences as bucket labels. They develop a recursive algorithm to partition the space of all sequences into optimal subsets that "guarantee" that similar sequences will find a common neighbor within a certain radius.
  • Gapped LSBs: They construct functions for higher distances, such as $(1, 3)$-sensitive and $(3, 5)$-sensitive functions, and analyze their efficiency.

Datasets

The paper is primarily theoretical and uses synthetic datasets for validation rather than specific biological databases.

  • Evaluation Data: The authors generated 100,000 random pairs of sequences of length 20.
  • Testing Procedure: They varied the edit distance ($d$) from 1 to 6 and measured the frequency with which pairs shared a bucket under different LSB configurations to verify their theoretical sensitivity and specificity bounds.

Key Insights and Ideas

  • The Power of Multi-Bucketing: The "aha moment" is that the mathematical constraints of LSH are too rigid for edit distance. By allowing a sequence to live in multiple buckets, you can "cover" the neighborhood of a sequence more effectively, making it much easier to satisfy sensitivity requirements.
  • Lower Bounds: The authors don't just provide algorithms; they prove the mathematical limits. For example, they show that any $(1, 2)$-sensitive function must put a sequence into at least $n$ buckets, providing a benchmark for "perfect" efficiency.
  • Recursive Partitioning: They discovered a way to partition the entire metric space of sequences into subsets ($B^i_n$) such that each subset is a "minimum (1, 1)-guaranteed subset." This allows for an $O(n)$ membership query, meaning you can check if a sequence belongs to a bucket label set very quickly without storing the whole set.

Key Results

  • Theoretical Optimality: The authors successfully constructed $(1, 2)$-sensitive bucketing functions that meet the proven lower bounds for both the total number of buckets and the number of buckets per sequence.
  • Gap Performance: Experimental results (Figure 1 and 2 in the paper) confirm that their gapped LSB functions behave exactly as predicted. For instance, in a $(3, 5)$-sensitive setup, sequences with distance $\le 3$ always shared a bucket, while those with distance $\ge 5$ never did.
  • Efficiency: They demonstrated that $(1, 3)$-sensitive functions can be significantly more efficient (requiring fewer buckets per sequence) than $(1, 2)$-sensitive ones, offering a trade-off between precision and computational cost.

Limitations and Future Work

  • Scaling to Large $d$: The current constructions are optimized for small edit distances ($d_1, d_2$). Extending these optimal constructions to much larger distances (e.g., $d_1=10, d_2=20$) remains a challenge.
  • Sequence Length: The proofs and algorithms currently focus on fixed-length sequences ($n$). Real-world biological sequences vary in length, which would require further generalization of the LSB framework.
  • Practical Implementation: While the paper provides the theoretical foundation and a GitHub implementation for the subsets, integrating this into a high-performance sequence aligner (like Minimap2) is a significant next step for the bioinformatics community.

Summary updated

BibTeX
@misc{chen2022locality,
  author = {Ke Chen and Mingfu Shao},
  title = {{Locality-Sensitive Bucketing Functions for the Edit Distance}},
  year = {2022},
  eprint = {2206.03097},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2206.03097},
}
Figure