Abstract
The sharp increase in next-generation sequencing technologies’ capacity has created a demand for algorithms capable of quickly searching a large corpus of biological sequences. The complexity of biological variability and the magnitude of existing data sets have impeded finding algorithms with guaranteed accuracy that efficiently run in practice. Our main contribution is the Tensor Sketch method that efficiently and accurately estimates edit distances. In our experiments, Tensor Sketch had 0.956 Spearman’s rank correlation with the exact edit distance, improving its best competitor Ordered MinHash by 23%, while running almost 5 times faster. Finally, all sketches can be updated dynamically if the input is a sequence stream, making it appealing for large-scale applications where data cannot fit into memory. Conceptually, our approach has three steps: 1) represent sequences as tensors over their sub-sequences, 2) apply tensor sketching that preserves tensor inner products, 3) implicitly compute the sketch. The sub-sequences, which are not necessarily contiguous pieces of the sequence, allow us to outperform k-mer-based methods, such as min-hash sketching over a set of k-mers. Typically, the number of sub-sequences grows exponentially with the sub-sequence length, introducing both memory and time overheads. We directly address this problem in steps 2 and 3 of our method. While the sketching of rank-1 or super-symmetric tensors is known to admit efficient sketching, the sub-sequence tensor does not satisfy either of these properties. Hence, we propose a new sketching scheme that completely avoids the need for constructing the ambient space. Our tensor-sketching technique’s main advantages are three-fold: 1) Tensor Sketch has higher accuracy than any of the other assessed sketching methods used in practice. 2) All sketches can be computed in a streaming fashion, leading to significant time and memory savings when there is overlap between input sequences. 3) It is straightforward to extend tensor sketching to different settings leading to efficient methods for related sequence analysis tasks. We view tensor sketching as a framework to tackle a wide range of relevant bioinformatics problems, and we are confident that it can bring significant improvements for applications based on edit distance estimation.
Introduction
In bioinformatics, the "gold standard" for comparing DNA or protein sequences is the edit distance—the minimum number of insertions, deletions, or substitutions needed to transform one string into another. However, calculating this exactly is computationally expensive ($O(N^2)$), making it impractical for the millions of sequences generated by modern next-generation sequencing.
Existing "alignment-free" methods typically rely on $k$-mers (fixed-length substrings). However, $k$-mers face a significant challenge: if $k$ is too small, random sequences appear deceptively similar; if $k$ is too large, even minor mutations can make closely related sequences appear entirely different. This paper introduces Tensor Sketching, a novel method that captures global similarity through non-contiguous sub-sequences while maintaining high computational efficiency.
Methodology
The authors propose a three-step framework:
- Tensor Representation: Sequences are represented as tensors of their sub-sequences (characters appearing in order but not necessarily adjacent). This is more resilient to mutations than contiguous $k$-mers.
- Tensor Sketching: To handle the exponential growth of possible sub-sequences, the method projects the data into a small, fixed-size "sketch" that preserves similarity.
- Recursive Computation: The core breakthrough is an algorithm that computes these sketches implicitly in $O(N)$ time, avoiding the need to construct massive tensors.
The researchers also developed Tensor Slide Sketch (TSS), a streaming version that updates sketches dynamically as characters are added or removed, ideal for large-scale genomic data.
Experimental Results
The method was evaluated against exact Edit Distance (ED) and popular sketching techniques including MinHash (MH), Weighted MinHash (WMH), and Ordered MinHash (OMH).
As demonstrated in the results table, TSS achieved a 0.956 Spearman’s rank correlation with the exact edit distance, a 23% improvement over Ordered MinHash. Furthermore, TSS proved to be nearly 5 times faster than OMH and reduced computation time by 96.3% compared to exact edit distance calculations. The method also showed superior robustness, maintaining high AUROC scores (e.g., 0.974 at $d_{ed} \le 0.5$) even for distantly related sequences where traditional MinHash accuracy typically declines.
Conclusion
Tensor Sketching offers a significant advancement in alignment-free similarity estimation. By leveraging sub-sequences and an efficient recursive sketching algorithm, it provides a high-accuracy, high-speed alternative to traditional alignment and $k$-mer methods. Its streaming capability and potential for extension to complex structures like de-Bruijn graphs make it a versatile tool for the future of large-scale bioinformatics.
Summary updated