#k-mer #dna #indexing #transform #structure #subset #sequence

sbwt

Indexing sets of DNA k-mers with the spectral Burrow-Wheeler transform

12 releases

new 0.3.7 Dec 13, 2024
0.3.4 Nov 15, 2024
0.2.1 Jun 5, 2024
0.1.1 Mar 12, 2024

#668 in Data structures

Download history 4/week @ 2024-08-26 308/week @ 2024-09-16 106/week @ 2024-09-23 59/week @ 2024-09-30 159/week @ 2024-10-07 15/week @ 2024-10-14 28/week @ 2024-10-28 10/week @ 2024-11-04 103/week @ 2024-11-11 45/week @ 2024-11-18 2/week @ 2024-11-25 25/week @ 2024-12-02 482/week @ 2024-12-09

562 downloads per month
Used in 2 crates

MIT license

245KB
4K SLoC

SBWT: A Burrows-Wheeler transform for DNA k-mers

This crate provides an implementation of the Bit Matrix SBWT data structure, as described in Small Searchable k-Spectra via Subset Rank Queries on the Spectral Burrows-Wheeler Transform, for the DNA alphabet ACGT. The data structure uses a variant of the Burrows-Wheeler transform to compress a set of k-mers in way that allows fast lookup queries. If the input k-mers are consecutive k-mers from longer underlying sequences, the index takes typically around 5 bits per distinct k-mer, supporting k-mer lookup queries at a speed of around 1 μs / k-mer on modern hardware.

Queries can be further sped up by using the Longest common suffix array, (see here) taking roughly log(k) bits of space per k-mer. The LCS array also enables the computation of k-bounded matching statistics and shortest frequency-bounded suffixes (both described here). Finally, the crate provides an interface for traversing the node-centric de Bruijn graph of the k-mers.

API documentation available at https://docs.rs/sbwt/latest/sbwt/.

A CLI for key features of the API can be found at https://github.com/jnalanko/sbwt-rs-cli. The API is developed together with the CLI at https://github.com/jnalanko/sbwt-rs-cli/tree/master/api.

Changes between releases are documented in the changelog.

Dependencies

~14MB
~238K SLoC