bioRxivBioinformaticsPreprint
DynamicDemiLog: A Single Sketch for Ultrafast Similarity, Frequency, and Cardinality Estimation
Abstract
Probabilistic cardinality estimators (HyperLogLog), similarity sketches (MinHash), and frequency estimators (Count-Min Sketch) are fundamental approximate data structures that each target one primary problem. We present DynamicDemiLog (DDL), a sketch that unifies cardinality estimation, set similarity, containment, element frequency and composition in one tiny data structure built from a single pass over the input stream. Using an inverted index over 200,687 RefSeq sketches (159,567 organisms), DDL performs all-to-all sketch similarity comparison of the full database in 30 seconds (128 threads, indexed) -- over 375x faster per query than Mashs brute-force all-to-all comparison of 91,282 sketches, or 31x faster without the index, at double the sketch resolution. DDL extends the LogLog register with a mantissa: each register stores a floating-point-encoded hash value consisting of an integer exponent (the leading-zero count) and a fractional mantissa (the sub-leading-zero bits), rather than the integer leading-zero count alone. This preserves enough hash information for meaningful register-by-register comparison -- a property that standard 6-bit registers lack -- while improving on LogLogs cardinality estimation machinery, including DynamicLogLogs early exit mask for high-throughput streaming. With a default 10 mantissa bits (16-bit registers, 2,048 buckets, 4 KB), DDL achieves a per-register false-match rate of 0.018% on unrelated random same-size sets (compared to 17.0% for LL6, a basic HyperLogLog implementation), enabling Weighted Kmer Identity (WKID), Average Nucleotide Identity (ANI), containment, and completeness estimation from register comparison alone. A 16-bit per-register observation counter provides element frequency information at trivial additional computation cost, and an additional byte tracks element composition (GC content, for biological data). Furthermore, DDLs high-specificity registers enable an inverted index structure (DDLIndex) that answers similarity queries against a database of N sketches in O(B + M) time, where M is the number of matching index entries, compared to O(N xB) for pairwise comparison. DDL achieves a 930x reduction in false register matches compared to LL6 (Section 11.1), accurately estimates ANI between full and partial genomes down to approximately 79% identity (at k=25, B=2,048), and maintains near-zero spurious similarity on unrelated inputs -- all at similar construction speed to LL6, and 3.5x faster than SetSketch.
- Citations
- 0
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
- Efficient cardinality estimation for k-mers in large DNA sequencing data sets
Luiz C. Irber, C. Titus Brown·bioRxiv·Jun 7, 2016
- Dashing: Fast and Accurate Genomic Distances with HyperLogLog
Daniel N. Baker, Ben Langmead·Genome biologyPeer-reviewed·Dec 1, 2019
- Compressed inverted indexes for scalable sequence similarity
Florian Ingels, Léa Vandamme, … Antoine Limasset·bioRxiv·Nov 21, 2025
- Optimizing sparse and skew hashing: faster k-mer dictionaries
Giulio Ermanno Pibiri, Rob Patro·BioinformaticsPeer-reviewed·Jul 1, 2026
- Dashing 2: genomic sketching with multiplicities and locality-sensitive hashing
Daniel N. Baker, Ben Langmead·Genome ResearchPeer-reviewed·Jul 6, 2023
- Sparse and Skew Hashing of K-Mers
Giulio Ermanno Pibiri·BioinformaticsPeer-reviewed·Apr 14, 2022