On-Line Pattern Matching on Similar Texts

Roberto Grossi, Costas S. Iliopoulos, Chang Liu, Nadia Pisanti, Solon P. Pissis, Ahmad Retha, Giovanna Rosone, Fatima Vayani, Luca VersariCPM 2017 · OpenReview

TL;DR

This paper tackles the challenge of efficiently searching for patterns within "elastic-degenerate texts" – a data structure representing multiple similar sequences, like those found in human genetic variation data. The authors introduce two novel algorithms for "on-line" pattern matching, meaning they process the text sequentially without needing a pre-built index, offering practical advantages for real-world applications.

What Problem Does This Paper Address?

Imagine you have a collection of DNA sequences that are very similar but have slight variations (substitutions, insertions, deletions). Representing all these variations efficiently is crucial, especially in fields like cataloging human genetic variation. While "off-line" methods (which build a comprehensive index beforehand) have been well-studied for pattern matching in such data, the "on-line" version – where you process the text as it comes, without a full pre-built index – has been less explored. This on-line approach is important because it can be combined with partial indexes for practical trade-offs, and it's a more fundamental problem. The paper aims to fill this gap by developing efficient on-line algorithms for this specific type of data.

Methods

The paper presents two main algorithms:

  • Algorithm EDSM: This algorithm involves a preprocessing step to build a suffix tree of the pattern. It then scans the elastic-degenerate text, maintaining lists of potential pattern prefix matches. The core idea is to efficiently extend partial matches and check for full occurrences as the text is processed.
  • Algorithm EDSM-BV (Bit-Vector Algorithm): This is a more optimized version that leverages bit-level operations. It uses bit vectors to represent occurrences of pattern prefixes and to efficiently update the state of potential matches. This approach aims for faster processing, especially for shorter patterns, by using bitwise operations for speed.

Both algorithms build upon existing concepts like suffix trees and border tables, but their novelty lies in their adaptation and application to the on-line elastic-degenerate string matching problem.

Datasets

The authors used two types of datasets for evaluation:

  • Synthetic Data: ED texts were generated randomly with varying lengths (100,000 to 1,600,000 characters) and a 10% rate of degenerate positions. Patterns of lengths 8, 16, 32, and 64 were used.
  • Real Data: Human genomic data from the 1,000 Genomes Project (Phase 3) was used, specifically focusing on the ten smallest chromosomes. This data, in Variant Call Format (VCF), naturally represents variations. Synthetic patterns were used with this real data.

Key Insights and Ideas

  • On-line is Fundamental: The paper highlights that while off-line indexing is powerful, on-line algorithms offer unique advantages for practical scenarios and can serve as building blocks for more complex systems.
  • Bit-Vector Optimization: The EDSM-BV algorithm demonstrates the power of bit-level operations for accelerating pattern matching, particularly when dealing with the combinatorial nature of elastic-degenerate texts.
  • Trade-offs in Complexity: The paper presents algorithms with different time complexities, allowing for choices based on pattern length and desired performance. EDSM-BV is shown to be particularly effective for shorter patterns.
  • Practical Relevance: The experimental results validate the theoretical findings, showing that the proposed algorithms perform well in practice, especially EDSM-BV, which can be orders of magnitude faster than existing methods.

Key Results

  • Algorithm EDSM: Achieves a time complexity of O(nm² + N) after O(m) preprocessing, where 'n' is text length, 'm' is pattern length, and 'N' is text size.
  • Algorithm EDSM-BV: Offers a significant improvement, achieving O(N · [m]) time complexity, making it linear in the text size for short patterns. Its preprocessing time is O(m · [m]).
  • Experimental Validation: Figures 1 and 2 show that EDSM-BV consistently outperforms both EDSM and a previously published algorithm (IKP) on synthetic and real-world genomic data, especially for shorter patterns. EDSM-BV can be up to two orders of magnitude faster.

Limitations and Future Work

  • Algorithm EDSM Complexity: The O(nm² + N) complexity of the EDSM algorithm, while improved from prior work, still has a significant m² factor. The authors suggest an open problem is to either improve this algorithm or prove conditional lower bounds.
  • Future Applications: The authors propose applying these on-line solutions to fast average-case approximate pattern matching and multiple pattern matching on similar texts.

Summary updated

Abstract

Pattern matching on a set of similar texts has received much attention, especially recently, mainly due to its application in cataloguing human genetic variation. In particular, many different algorithms have been proposed for the off-line version of this problem; that is, constructing a compressed index for a set of similar texts in order to answer pattern matching queries efficiently. However, the on-line, more fundamental, version of this problem is a rather undeveloped topic. Solutions to the on-line version can be beneficial for a number of reasons; for instance, efficient on-line solutions can be used in combination with partial indexes as practical trade-offs. We make here an attempt to close this gap via proposing two efficient algorithms for this problem. Notably, one of the algorithms requires time linear in the size of the texts' representation, for short patterns. Furthermore, experimental results confirm our theoretical findings in practical terms.
BibTeX
@inproceedings{grossi2017line,
  author = {Roberto Grossi and Costas S. Iliopoulos and Chang Liu and Nadia Pisanti and Solon P. Pissis and Ahmad Retha and Giovanna Rosone and Fatima Vayani and Luca Versari},
  title = {{On-Line Pattern Matching on Similar Texts}},
  booktitle = {CPM},
  year = {2017},
  url = {https://openreview.net/forum?id=pxTUuVGPB-j},
}
Figure