Skip to content

Read clustering

Group long transcriptome reads by the gene they came from, without a reference genome. Reads are visited from most to least reliable. Each read either joins the first representative whose minimizers cover most of it, or becomes a new representative and adds its minimizers to the index. This private workload runs that greedy loop over four minimizer index layouts, one of them built from `knotkit/inverted-index`, and checks every assignment against an independent reference.

Group long transcriptome reads by the gene they came from, without a reference genome. Reads are visited from most to least reliable. Each read either joins the first representative whose minimizers cover most of it, or becomes a new representative and adds its minimizers to the index. This private workload runs that greedy loop over four minimizer index layouts, one of them built from knotkit/inverted-index, and checks every assignment against an independent reference.

inline-singleton clusters in 300.1 ms and retains 5,367,998 bytes per index; map-of-sets takes 322.5 ms and retains 26,328,798

  • knotkit/inverted-index: Indexes records by exact keys and scans sorted record IDs for one key or the union of several, using packed posting lists
  • knotkit/deque: Queues elements at both ends in O(1) amortized time, over array and Float64Array ring buffers, with an optional fixed capacity that turns the queue into a sliding window
{"v":1,"box":[83.0087,94.1597,1043,437.3555],"x":{"s":"log","lim":[0.837104833413,62.1188624464],"inv":false,"g":0,"t":"Representative IDs per minimizer (posting length)","tk":[[1,"1"],[2,"2"],[5,"5"],[10,"10"],[20,"20"],[52,"52"]],"b":10},"y":{"s":"log","lim":[0.612111623916,89179.8127452],"inv":false,"g":0,"tk":[[1,"1"],[10,"10"],[100,"100"],[1000,"1,000"],[10000,"10,000"],[54588,"54,588"]],"b":10},"ti":"73.4% of 74,391 minimizers hold one posting; 2 hold 52","a":[{"k":"scatter","c":"#1d5fa6","s":"xy","d":[1,54588,2,9005,3,3642,4,2015,5,1130,6,765,7,586,8,482,9,361,10,216,11,217,12,160,13,171,14,134,15,133,16,101,17,72,18,72,19,44,20,42,21,38,22,39,23,30,24,39,25,28,26,34,27,26,28,18,29,16,30,14,31,13,32,11,33,12,34,11,35,12,36,13,37,9,38,7,39,17,40,8,41,9,42,6,43,11,44,3,45,5,46,5,47,4,48,4,49,7,50,3,51,1,52,2],"p":[122.64,108.33,277.14,160.35,367.52,186.48,431.64,203.56,481.38,220.26,522.02,231.52,556.38,239.21,586.15,244.85,612.4,253.2,635.88,268.02,657.13,267.89,676.52,276.69,694.36,274.77,710.88,281.81,726.26,282.02,740.65,289.97,754.16,299.74,766.9,299.74,778.95,313.95,790.39,315.3,801.26,318.18,811.63,317.43,821.54,325.01,831.02,317.43,840.12,327,848.87,321.39,857.28,329.14,865.38,339.75,873.21,343.15,880.76,347.01,888.07,349.15,895.15,353.97,902.01,351.46,908.66,353.97,915.12,351.46,921.4,349.15,927.51,359.76,933.45,367.02,939.24,341.4,944.89,363.16,950.39,359.76,955.76,371.47,961.01,353.97,966.13,391.47,971.14,376.73,976.04,376.73,980.83,383.17,985.53,383.17,990.12,367.02,994.63,391.47,999.04,423.19,1003.37,403.18],"r":3.07},{"k":"segments","c":"#8c8c84"},{"k":"segments","c":"#8c8c84"},{"k":"annotation","c":"#2b2b28"},{"k":"annotation","c":"#5c5c57"}],"lg":[]} 1 2 5 10 20 52 Representative IDs per minimizer (posting length) 1 10 100 1,000 10,000 54,588 54,588 stored inline Minimizers with that posting length 73.4% of 74,391 minimizers hold one posting; 2 hold 52
{"v":1,"box":[83.0087,122.3921,595,437.3555],"x":{"s":"log","lim":[0.837104833413,62.1188624464],"inv":false,"g":0,"t":"Representative IDs per minimizer (posting length)","tk":[[1,"1"],[2,"2"],[5,"5"],[10,"10"],[20,"20"],[52,"52"]],"b":10},"y":{"s":"log","lim":[0.612111623916,89179.8127452],"inv":false,"g":0,"tk":[[1,"1"],[10,"10"],[100,"100"],[1000,"1,000"],[10000,"10,000"],[54588,"54,588"]],"b":10},"ti":"73.4% of 74,391 minimizers hold one\nposting; 2 hold 52","a":[{"k":"scatter","c":"#1d5fa6","s":"xy","d":[1,54588,2,9005,3,3642,4,2015,5,1130,6,765,7,586,8,482,9,361,10,216,11,217,12,160,13,171,14,134,15,133,16,101,17,72,18,72,19,44,20,42,21,38,22,39,23,30,24,39,25,28,26,34,27,26,28,18,29,16,30,14,31,13,32,11,33,12,34,11,35,12,36,13,37,9,38,7,39,17,40,8,41,9,42,6,43,11,44,3,45,5,46,5,47,4,48,4,49,7,50,3,51,1,52,2],"p":[104.15,135.4,186.55,183.13,234.75,207.11,268.95,222.8,295.47,238.12,317.15,248.45,335.47,255.51,351.35,260.69,365.35,268.35,377.87,281.95,389.2,281.83,399.55,289.9,409.06,288.14,417.87,294.6,426.07,294.8,433.75,302.09,440.95,311.06,447.75,311.06,454.18,324.1,460.27,325.34,466.07,327.99,471.6,327.3,476.89,334.25,481.95,327.3,486.8,336.08,491.46,330.93,495.95,338.04,500.27,347.78,504.44,350.9,508.47,354.44,512.37,356.4,516.15,360.83,519.8,358.52,523.35,360.83,526.8,358.52,530.15,356.4,533.41,366.14,536.58,372.8,539.66,349.3,542.67,369.27,545.61,366.14,548.47,376.89,551.27,360.83,554,395.25,556.68,381.72,559.29,381.72,561.84,387.63,564.35,387.63,566.8,372.8,569.2,395.25,571.55,424.35,573.86,405.99],"r":3.07},{"k":"segments","c":"#8c8c84"},{"k":"segments","c":"#8c8c84"},{"k":"annotation","c":"#2b2b28"},{"k":"annotation","c":"#5c5c57"}],"lg":[]} 1 2 5 10 20 52 Representative IDs per minimizer (posting length) 1 10 100 1,000 10,000 54,588 54,588 stored inline Minimizers with that posting length 73.4% of 74,391 minimizers hold one posting; 2 hold 52
  • Pinned synthetic fixture: 4000 reads and 910 representatives.
  • 73.4% of 74391 index keys hold one posting.
  • The inline-singleton layout stores one representative ID directly for those keys.

Hover or focus a chart for exact values. Drawn by demo.ts at build time, from the fixtures the benchmark uses; it reproduces the README figure.

Terminal window
git clone https://github.com/jkomyno/knotkit.git && cd knotkit && bun install
bun run demo:problem:read-clustering

problems/read-clustering/README.md states the fixture, the seed, and the result table.