MaxGeomHash: An Algorithm for Variable-Size Random Sampling of Distinct Elements

Read the full article See related articles

Discuss this preprint

Start a discussion What are Sciety discussions?

Listed in

This article is not in any list yet, why not save it to one of your lists.
Log in to save this article

Abstract

With the surge in sequencing data generated from an ever-expanding range of biological studies, designing scalable computational techniques has become essential. One effective strategy to enable large-scale computation is to split long DNA or protein sequences into k -mers, and summarize large k -mer sets into compact random samples (a.k.a. sketches ). These random samples allow for rapid estimation of similarity metrics such as Jaccard or cosine, and thus facilitate scalable computations such as fast similarity search, classification, and clustering. Popular sketching tools in bioinformatics include Mash and sourmash. Mash uses the MinHash algorithm to generate fixed-size sketches; while sourmash employs FracMinHash, which produces sketches whose size scales linearly with the total number of k -mers.

Here, we introduce a novel sketching algorithm, MaxGeomHash, which for a specified integer parameter b ≥ 1, will produce, without prior knowledge of n (the number of k -mers) a random sample of size b lg( n/b ) + 𝒪 ( b ). Notably, this is the first permutation-invariant and parallelizable sketching algorithm to date that can produce sub-linear sketches, to the best of our knowledge. We also introduce a variant, α -MaxGeomHash, that produces random samples of size Θ ( n α ) for a given α ∈ (0, 1). We study the algorithm’s properties, analyze generated sample sizes, verify theoretical results empirically, provide a fast implementation, and investigate similarity estimate quality. With intermediate-sized samples between constant (MinHash) and linear (FracMinHash), MaxGeomHash balances efficiency (smaller samples need less storage and processing) with accuracy (larger samples yield better estimates). On genomic datasets, we demonstrate that MaxGeomHash sketches can be used to compute a similarity tree (proxy for a phylogenetic tree) more accurately than MinHash, and more efficiently than FracMin-Hash.

Our C++ implementation is available at: github.com/mahmudhera/kmer-sketch . Code to reproduce the analyses and experiments is at: github.com/KoslickiLab/MaxGeomHash .

Article activity feed