Metannot: A succinct data structure for compression of colors in dynamic de Bruijn graphs

Harun Mustafa, André Kahles, Mikhail Karasikov, Gunnar RätschbioRxiv 2017

Abstract

Much of the DNA and RNA sequencing data available is in the form of high-throughput sequencing (HTS) reads and is currently unindexed by established sequence search databases. Recent succinct data structures for indexing both reference sequences and HTS data, along with associated metadata, have been based on either hashing or graph models, but many of these structures are static in nature, and thus, not well-suited as backends for dynamic databases. We propose a parallel construction method for and novel application of the wavelet trie as a dynamic data structure for compressing and indexing graph metadata. By developing an algorithm for merging wavelet tries, we are able to construct large tries in parallel by merging smaller tries constructed concurrently from batches of data. When compared against general compression algorithms and those developed specifically for graph colors (VARI and Rainbowfish), our method achieves compression ratios superior to gzip and VARI, converging to compression ratios of 6.5% to 2% on data sets constructed from over 600 virus genomes. While marginally worse than compression by bzip2 or Rainbowfish, this structure allows for both fast extension and query. We also found that additionally encoding graph topology metadata improved compression ratios, particularly on data sets consisting of several mutually-exclusive reference genomes. It was also observed that the compression ratio of wavelet tries grew sublinearly with the density of the annotation matrices. This work is a significant step towards implementing a dynamic data structure for indexing large annotated sequence data sets that supports fast query and update operations. At the time of writing, no established standard tool has filled this niche.

Introduction

High-throughput sequencing (HTS) has created a massive bottleneck in bioinformatics: the rate of DNA/RNA data generation far exceeds our capacity to index and search it. To manage this, researchers often employ de Bruijn graphs, where sequences are decomposed into overlapping fragments called $k$-mers. To make these graphs biologically meaningful, they must be "colored" with metadata—essentially an annotation matrix where rows represent graph edges and columns represent metadata categories (e.g., sample origin, tissue type, or species).

Existing tools like VARI and Rainbowfish offer significant compression for these matrices but are fundamentally static. Adding new data typically requires a full recomputation of the index. Metannot addresses this gap by introducing a dynamic succinct data structure based on the wavelet trie, supporting both fast queries and incremental updates.

Methods: The Wavelet Trie and Topology-Aware Compression

The core innovation of Metannot is the application of the wavelet trie to genomic metadata. Unlike a standard wavelet tree, which is optimized for fixed alphabets, a wavelet trie compresses bit vectors by exploiting common contiguous subsequences (prefixes). In genomics, evolutionary relationships between sequences result in abundant shared prefixes, making this structure highly efficient.

Relationship between the genomic sequence trie and the compressed wavelet trie representation.

Metannot is built upon the Bowe-Onodera-Sadakane-Shibuya (BOSS) representation for efficient graph topology storage. To further enhance compression, the authors introduced "backbone bits." By using reference genomes to establish artificial correlations within the bit vectors, the wavelet trie can achieve significantly higher compression ratios—up to a 3x improvement in some viral datasets.

Parallel Construction and Merging

To enable scalability and dynamic updates, the authors developed a novel algorithm for merging wavelet tries. This allows for a parallel construction pipeline where sequencing data is processed in batches to create smaller tries, which are then merged into a single master trie.

Algorithm for merging two wavelet tries, enabling parallel construction from data batches.

The merging of two tries $T_1$ and $T_2$ is performed in $O(\max(|V_1|, |V_2|))$ time, where $|V|$ is the number of nodes. This efficiency ensures that the database can be updated incrementally without the prohibitive costs associated with rebuilding static structures.

Results and Performance

The authors evaluated Metannot on diverse datasets, including viral genomes (Virus100 and Virus1000), bacterial strains (Lactobacillus), and human chromosomal data (chr22 and hg19).

  • Compression Performance: Metannot achieved compression ratios between 2% and 6.5% on the Virus1000 dataset. It consistently outperformed general-purpose tools like gzip and specialized static tools like VARI.
  • Benchmarking: While raw storage efficiency was slightly lower than bzip2 or Rainbowfish, Metannot is the only structure in this class that supports dynamic updates.
  • Scaling: A key finding was that the compression ratio grows sublinearly with the density of the annotation matrix. This suggests that the structure becomes relatively more efficient as the database grows larger and more complex.

Conclusion and Future Directions

Metannot represents a significant step toward dynamic indexing of large-scale genomic datasets. While its efficiency depends on the presence of shared prefixes in metadata, its ability to handle parallel updates makes it a unique solution in the current landscape of succinct data structures.

Future work will focus on automating the selection of "backbone" paths through graph topology analysis and developing hybrid states that can transition between high-speed query modes and update-friendly dynamic modes.

Summary updated

BibTeX
@misc{mustafa2017metannot,
  author = {Harun Mustafa and André Kahles and Mikhail Karasikov and Gunnar Rätsch},
  title = {{Metannot: A succinct data structure for compression of colors in dynamic de Bruijn graphs}},
  year = {2017},
  doi = {10.1101/236711},
  howpublished = {bioRxiv},
}
Figure