CMash: fast, multi-resolution estimation of k-mer-based Jaccard and containment indices
Abstract
K-mer based methods are used ubiquitously in the field of computational biology. However, determining the optimal value of k for a specific application often remains heuristic. Simply reconstructing a new k-mer set with another k-mer size is computationally expensive, especially in metagenomic analysis where data sets are large. Here, we introduce a hashing-based technique that leverages a kind of bottom-m sketch as well as a k-mer ternary search tree (KTST) to obtain k-mer based similarity estimates for a range of k values. By truncating k-mers stored in a pre-built KTST with a large k = kmax value, we can simultaneously obtain k-mer based estimates for all k values up to kmax. This truncation approach circumvents the reconstruction of new k-mer sets when changing k values, making analysis more time and space-efficient. For example, we show that when using a KTST to estimate the containment index between a RefSeq-based microbial reference database and simulated metagenome data for 10 values of k, the running time is close to 10x faster compared to a classic MinHash approach while using less than one-fifth the space to store the data structure. A python implementation of this method, CMash, is available at https://github.com/dkoslicki/CMash. The reproduction of all experiments presented herein can be accessed via https://github.com/KoslickiLab/CMASH-reproducibles.
02 /Specification & Classification
Click any tag to browse matching papers- Citations
- 21
- FWCI
- 1.31
- Field percentile
- top 21%
- Assay
- Research Focus
- Approach
Reproducibility ledger
Nobody has reported trying to reproduce this paper yet. Did you replicate an experiment or run the code? Your report saves the next lab a week.
Sign in to file a reproducibility report.
Related papers
- kache-hash: A dynamic, concurrent, and cache-efficient hash table for streaming k-mer operations
Jamshed Khan, Rob Patro, Prashant Pandey·bioRxiv·Feb 16, 2026
- Cosine Similarity Estimation Using FracMinHash: Theoretical Analysis, Safety Conditions, and Implementation
Mahmudur Rahman Hera, David Koslicki·bioRxiv·May 24, 2024
- Hyper-k-mers: efficient streaming k-mers representation
Igor Martayan, Lucas Robidou, … Antoine Limasset·bioRxiv·Nov 6, 2024
- Optimizing sparse and skew hashing: faster k-mer dictionaries
Giulio Ermanno Pibiri, Rob Patro·BioinformaticsPeer-reviewed·Jul 1, 2026
- Sparse and Skew Hashing of K-Mers
Giulio Ermanno Pibiri·BioinformaticsPeer-reviewed·Apr 14, 2022
- Batch, Prefetch, Skip, Orient, Squeeze: Faster, Smaller k-mer dictionaries via the Spectral Burrows-Wheeler transform
A. C. Diseth, J. N. Alanko, … Simon J. Puglisi·bioRxiv·Nov 10, 2026