├── .github └── workflows │ └── ci.yaml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── benches.txt ├── benches └── lapper_benchmark.rs ├── devlog.md ├── examples ├── ex1.rs └── serde.rs ├── images ├── nested_intervals_bad_mean.svg ├── nested_intervals_mean.svg ├── rust_bio_bad_mean.svg ├── rust_bio_mean.svg ├── rust_lapper_find_bad.svg ├── rust_lapper_find_mean.svg └── rust_lapper_seek_mean.svg └── src └── lib.rs /.github/workflows/ci.yaml: -------------------------------------------------------------------------------- 1 | name: ci 2 | 3 | on: [ push, pull_request ] 4 | 5 | env: 6 | CARGO_TERM_COLOR: always 7 | 8 | jobs: 9 | check: 10 | name: Check 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout sources 14 | uses: actions/checkout@v2 15 | 16 | - name: Install stable toolchain 17 | uses: actions-rs/toolchain@v1 18 | with: 19 | profile: minimal 20 | toolchain: stable 21 | override: true 22 | 23 | - name: Cache dependencies 24 | uses: Swatinem/rust-cache@v1 25 | 26 | - name: Run cargo check 27 | uses: actions-rs/cargo@v1 28 | with: 29 | command: check 30 | args: --all-features 31 | 32 | lints: 33 | name: Lints 34 | runs-on: ubuntu-latest 35 | steps: 36 | - name: Checkout sources 37 | uses: actions/checkout@v2 38 | 39 | - name: Install stable toolchain 40 | uses: actions-rs/toolchain@v1 41 | with: 42 | profile: minimal 43 | toolchain: stable 44 | override: true 45 | components: rustfmt, clippy 46 | 47 | - name: Cache dependencies 48 | uses: Swatinem/rust-cache@v1 49 | 50 | - name: Run cargo fmt 51 | uses: actions-rs/cargo@v1 52 | with: 53 | command: fmt 54 | args: --all -- --check 55 | 56 | - name: Run cargo clippy 57 | uses: actions-rs/cargo@v1 58 | with: 59 | command: clippy 60 | args: --all-features -- -D warnings 61 | 62 | test: 63 | name: Test Suite 64 | runs-on: ${{ matrix.os }} 65 | strategy: 66 | matrix: 67 | os: [ ubuntu-latest, macOS-latest, windows-latest ] 68 | steps: 69 | - name: Checkout sources 70 | uses: actions/checkout@v2 71 | 72 | - name: Install stable toolchain 73 | uses: actions-rs/toolchain@v1 74 | with: 75 | profile: minimal 76 | toolchain: stable 77 | override: true 78 | 79 | - name: Cache dependencies 80 | uses: Swatinem/rust-cache@v1 81 | 82 | - name: Run tests 83 | run: cargo test --verbose --all-features -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | **/*.rs.bk 3 | .idea 4 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "atty" 7 | version = "0.2.14" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 10 | dependencies = [ 11 | "hermit-abi", 12 | "libc", 13 | "winapi", 14 | ] 15 | 16 | [[package]] 17 | name = "autocfg" 18 | version = "1.0.1" 19 | source = "registry+https://github.com/rust-lang/crates.io-index" 20 | checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" 21 | 22 | [[package]] 23 | name = "bincode" 24 | version = "1.3.3" 25 | source = "registry+https://github.com/rust-lang/crates.io-index" 26 | checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" 27 | dependencies = [ 28 | "serde", 29 | ] 30 | 31 | [[package]] 32 | name = "bitflags" 33 | version = "1.3.1" 34 | source = "registry+https://github.com/rust-lang/crates.io-index" 35 | checksum = "2da1976d75adbe5fbc88130ecd119529cf1cc6a93ae1546d8696ee66f0d21af1" 36 | 37 | [[package]] 38 | name = "bstr" 39 | version = "0.2.16" 40 | source = "registry+https://github.com/rust-lang/crates.io-index" 41 | checksum = "90682c8d613ad3373e66de8c6411e0ae2ab2571e879d2efbf73558cc66f21279" 42 | dependencies = [ 43 | "lazy_static", 44 | "memchr", 45 | "regex-automata", 46 | "serde", 47 | ] 48 | 49 | [[package]] 50 | name = "bumpalo" 51 | version = "3.7.0" 52 | source = "registry+https://github.com/rust-lang/crates.io-index" 53 | checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631" 54 | 55 | [[package]] 56 | name = "cast" 57 | version = "0.2.7" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | checksum = "4c24dab4283a142afa2fdca129b80ad2c6284e073930f964c3a1293c225ee39a" 60 | dependencies = [ 61 | "rustc_version", 62 | ] 63 | 64 | [[package]] 65 | name = "cfg-if" 66 | version = "1.0.0" 67 | source = "registry+https://github.com/rust-lang/crates.io-index" 68 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 69 | 70 | [[package]] 71 | name = "clap" 72 | version = "2.33.3" 73 | source = "registry+https://github.com/rust-lang/crates.io-index" 74 | checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" 75 | dependencies = [ 76 | "bitflags", 77 | "textwrap", 78 | "unicode-width", 79 | ] 80 | 81 | [[package]] 82 | name = "cpu-time" 83 | version = "0.1.0" 84 | source = "registry+https://github.com/rust-lang/crates.io-index" 85 | checksum = "ad9182963eedd274a445d6a43a50c4097537a238c8ad8980e400c3bfbc956426" 86 | dependencies = [ 87 | "libc", 88 | "winapi", 89 | ] 90 | 91 | [[package]] 92 | name = "criterion" 93 | version = "0.3.5" 94 | source = "registry+https://github.com/rust-lang/crates.io-index" 95 | checksum = "1604dafd25fba2fe2d5895a9da139f8dc9b319a5fe5354ca137cbbce4e178d10" 96 | dependencies = [ 97 | "atty", 98 | "cast", 99 | "clap", 100 | "criterion-plot", 101 | "csv", 102 | "itertools", 103 | "lazy_static", 104 | "num-traits", 105 | "oorandom", 106 | "plotters", 107 | "rayon", 108 | "regex", 109 | "serde", 110 | "serde_cbor", 111 | "serde_derive", 112 | "serde_json", 113 | "tinytemplate", 114 | "walkdir", 115 | ] 116 | 117 | [[package]] 118 | name = "criterion-plot" 119 | version = "0.4.4" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | checksum = "d00996de9f2f7559f7f4dc286073197f83e92256a59ed395f9aac01fe717da57" 122 | dependencies = [ 123 | "cast", 124 | "itertools", 125 | ] 126 | 127 | [[package]] 128 | name = "crossbeam-channel" 129 | version = "0.5.1" 130 | source = "registry+https://github.com/rust-lang/crates.io-index" 131 | checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" 132 | dependencies = [ 133 | "cfg-if", 134 | "crossbeam-utils", 135 | ] 136 | 137 | [[package]] 138 | name = "crossbeam-deque" 139 | version = "0.8.1" 140 | source = "registry+https://github.com/rust-lang/crates.io-index" 141 | checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" 142 | dependencies = [ 143 | "cfg-if", 144 | "crossbeam-epoch", 145 | "crossbeam-utils", 146 | ] 147 | 148 | [[package]] 149 | name = "crossbeam-epoch" 150 | version = "0.9.5" 151 | source = "registry+https://github.com/rust-lang/crates.io-index" 152 | checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" 153 | dependencies = [ 154 | "cfg-if", 155 | "crossbeam-utils", 156 | "lazy_static", 157 | "memoffset", 158 | "scopeguard", 159 | ] 160 | 161 | [[package]] 162 | name = "crossbeam-utils" 163 | version = "0.8.8" 164 | source = "registry+https://github.com/rust-lang/crates.io-index" 165 | checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" 166 | dependencies = [ 167 | "cfg-if", 168 | "lazy_static", 169 | ] 170 | 171 | [[package]] 172 | name = "csv" 173 | version = "1.1.6" 174 | source = "registry+https://github.com/rust-lang/crates.io-index" 175 | checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" 176 | dependencies = [ 177 | "bstr", 178 | "csv-core", 179 | "itoa", 180 | "ryu", 181 | "serde", 182 | ] 183 | 184 | [[package]] 185 | name = "csv-core" 186 | version = "0.1.10" 187 | source = "registry+https://github.com/rust-lang/crates.io-index" 188 | checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" 189 | dependencies = [ 190 | "memchr", 191 | ] 192 | 193 | [[package]] 194 | name = "either" 195 | version = "1.6.1" 196 | source = "registry+https://github.com/rust-lang/crates.io-index" 197 | checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" 198 | 199 | [[package]] 200 | name = "getrandom" 201 | version = "0.1.16" 202 | source = "registry+https://github.com/rust-lang/crates.io-index" 203 | checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" 204 | dependencies = [ 205 | "cfg-if", 206 | "libc", 207 | "wasi", 208 | ] 209 | 210 | [[package]] 211 | name = "half" 212 | version = "1.7.1" 213 | source = "registry+https://github.com/rust-lang/crates.io-index" 214 | checksum = "62aca2aba2d62b4a7f5b33f3712cb1b0692779a56fb510499d5c0aa594daeaf3" 215 | 216 | [[package]] 217 | name = "hermit-abi" 218 | version = "0.1.19" 219 | source = "registry+https://github.com/rust-lang/crates.io-index" 220 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 221 | dependencies = [ 222 | "libc", 223 | ] 224 | 225 | [[package]] 226 | name = "itertools" 227 | version = "0.10.1" 228 | source = "registry+https://github.com/rust-lang/crates.io-index" 229 | checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf" 230 | dependencies = [ 231 | "either", 232 | ] 233 | 234 | [[package]] 235 | name = "itoa" 236 | version = "0.4.7" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" 239 | 240 | [[package]] 241 | name = "js-sys" 242 | version = "0.3.52" 243 | source = "registry+https://github.com/rust-lang/crates.io-index" 244 | checksum = "ce791b7ca6638aae45be056e068fc756d871eb3b3b10b8efa62d1c9cec616752" 245 | dependencies = [ 246 | "wasm-bindgen", 247 | ] 248 | 249 | [[package]] 250 | name = "lazy_static" 251 | version = "1.4.0" 252 | source = "registry+https://github.com/rust-lang/crates.io-index" 253 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 254 | 255 | [[package]] 256 | name = "libc" 257 | version = "0.2.99" 258 | source = "registry+https://github.com/rust-lang/crates.io-index" 259 | checksum = "a7f823d141fe0a24df1e23b4af4e3c7ba9e5966ec514ea068c93024aa7deb765" 260 | 261 | [[package]] 262 | name = "log" 263 | version = "0.4.14" 264 | source = "registry+https://github.com/rust-lang/crates.io-index" 265 | checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" 266 | dependencies = [ 267 | "cfg-if", 268 | ] 269 | 270 | [[package]] 271 | name = "memchr" 272 | version = "2.4.0" 273 | source = "registry+https://github.com/rust-lang/crates.io-index" 274 | checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" 275 | 276 | [[package]] 277 | name = "memoffset" 278 | version = "0.6.4" 279 | source = "registry+https://github.com/rust-lang/crates.io-index" 280 | checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" 281 | dependencies = [ 282 | "autocfg", 283 | ] 284 | 285 | [[package]] 286 | name = "num-traits" 287 | version = "0.2.14" 288 | source = "registry+https://github.com/rust-lang/crates.io-index" 289 | checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" 290 | dependencies = [ 291 | "autocfg", 292 | ] 293 | 294 | [[package]] 295 | name = "num_cpus" 296 | version = "1.13.0" 297 | source = "registry+https://github.com/rust-lang/crates.io-index" 298 | checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 299 | dependencies = [ 300 | "hermit-abi", 301 | "libc", 302 | ] 303 | 304 | [[package]] 305 | name = "oorandom" 306 | version = "11.1.3" 307 | source = "registry+https://github.com/rust-lang/crates.io-index" 308 | checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" 309 | 310 | [[package]] 311 | name = "plotters" 312 | version = "0.3.1" 313 | source = "registry+https://github.com/rust-lang/crates.io-index" 314 | checksum = "32a3fd9ec30b9749ce28cd91f255d569591cdf937fe280c312143e3c4bad6f2a" 315 | dependencies = [ 316 | "num-traits", 317 | "plotters-backend", 318 | "plotters-svg", 319 | "wasm-bindgen", 320 | "web-sys", 321 | ] 322 | 323 | [[package]] 324 | name = "plotters-backend" 325 | version = "0.3.2" 326 | source = "registry+https://github.com/rust-lang/crates.io-index" 327 | checksum = "d88417318da0eaf0fdcdb51a0ee6c3bed624333bff8f946733049380be67ac1c" 328 | 329 | [[package]] 330 | name = "plotters-svg" 331 | version = "0.3.1" 332 | source = "registry+https://github.com/rust-lang/crates.io-index" 333 | checksum = "521fa9638fa597e1dc53e9412a4f9cefb01187ee1f7413076f9e6749e2885ba9" 334 | dependencies = [ 335 | "plotters-backend", 336 | ] 337 | 338 | [[package]] 339 | name = "ppv-lite86" 340 | version = "0.2.10" 341 | source = "registry+https://github.com/rust-lang/crates.io-index" 342 | checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" 343 | 344 | [[package]] 345 | name = "proc-macro2" 346 | version = "1.0.28" 347 | source = "registry+https://github.com/rust-lang/crates.io-index" 348 | checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612" 349 | dependencies = [ 350 | "unicode-xid", 351 | ] 352 | 353 | [[package]] 354 | name = "quote" 355 | version = "1.0.9" 356 | source = "registry+https://github.com/rust-lang/crates.io-index" 357 | checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" 358 | dependencies = [ 359 | "proc-macro2", 360 | ] 361 | 362 | [[package]] 363 | name = "rand" 364 | version = "0.7.3" 365 | source = "registry+https://github.com/rust-lang/crates.io-index" 366 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 367 | dependencies = [ 368 | "getrandom", 369 | "libc", 370 | "rand_chacha", 371 | "rand_core", 372 | "rand_hc", 373 | ] 374 | 375 | [[package]] 376 | name = "rand_chacha" 377 | version = "0.2.2" 378 | source = "registry+https://github.com/rust-lang/crates.io-index" 379 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 380 | dependencies = [ 381 | "ppv-lite86", 382 | "rand_core", 383 | ] 384 | 385 | [[package]] 386 | name = "rand_core" 387 | version = "0.5.1" 388 | source = "registry+https://github.com/rust-lang/crates.io-index" 389 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 390 | dependencies = [ 391 | "getrandom", 392 | ] 393 | 394 | [[package]] 395 | name = "rand_hc" 396 | version = "0.2.0" 397 | source = "registry+https://github.com/rust-lang/crates.io-index" 398 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 399 | dependencies = [ 400 | "rand_core", 401 | ] 402 | 403 | [[package]] 404 | name = "rayon" 405 | version = "1.5.1" 406 | source = "registry+https://github.com/rust-lang/crates.io-index" 407 | checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" 408 | dependencies = [ 409 | "autocfg", 410 | "crossbeam-deque", 411 | "either", 412 | "rayon-core", 413 | ] 414 | 415 | [[package]] 416 | name = "rayon-core" 417 | version = "1.9.1" 418 | source = "registry+https://github.com/rust-lang/crates.io-index" 419 | checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" 420 | dependencies = [ 421 | "crossbeam-channel", 422 | "crossbeam-deque", 423 | "crossbeam-utils", 424 | "lazy_static", 425 | "num_cpus", 426 | ] 427 | 428 | [[package]] 429 | name = "regex" 430 | version = "1.5.6" 431 | source = "registry+https://github.com/rust-lang/crates.io-index" 432 | checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" 433 | dependencies = [ 434 | "regex-syntax", 435 | ] 436 | 437 | [[package]] 438 | name = "regex-automata" 439 | version = "0.1.10" 440 | source = "registry+https://github.com/rust-lang/crates.io-index" 441 | checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" 442 | 443 | [[package]] 444 | name = "regex-syntax" 445 | version = "0.6.26" 446 | source = "registry+https://github.com/rust-lang/crates.io-index" 447 | checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" 448 | 449 | [[package]] 450 | name = "rust-lapper" 451 | version = "1.1.0" 452 | dependencies = [ 453 | "bincode", 454 | "cpu-time", 455 | "criterion", 456 | "num-traits", 457 | "rand", 458 | "serde", 459 | ] 460 | 461 | [[package]] 462 | name = "rustc_version" 463 | version = "0.4.0" 464 | source = "registry+https://github.com/rust-lang/crates.io-index" 465 | checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" 466 | dependencies = [ 467 | "semver", 468 | ] 469 | 470 | [[package]] 471 | name = "ryu" 472 | version = "1.0.5" 473 | source = "registry+https://github.com/rust-lang/crates.io-index" 474 | checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" 475 | 476 | [[package]] 477 | name = "same-file" 478 | version = "1.0.6" 479 | source = "registry+https://github.com/rust-lang/crates.io-index" 480 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 481 | dependencies = [ 482 | "winapi-util", 483 | ] 484 | 485 | [[package]] 486 | name = "scopeguard" 487 | version = "1.1.0" 488 | source = "registry+https://github.com/rust-lang/crates.io-index" 489 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 490 | 491 | [[package]] 492 | name = "semver" 493 | version = "1.0.4" 494 | source = "registry+https://github.com/rust-lang/crates.io-index" 495 | checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" 496 | 497 | [[package]] 498 | name = "serde" 499 | version = "1.0.127" 500 | source = "registry+https://github.com/rust-lang/crates.io-index" 501 | checksum = "f03b9878abf6d14e6779d3f24f07b2cfa90352cfec4acc5aab8f1ac7f146fae8" 502 | dependencies = [ 503 | "serde_derive", 504 | ] 505 | 506 | [[package]] 507 | name = "serde_cbor" 508 | version = "0.11.1" 509 | source = "registry+https://github.com/rust-lang/crates.io-index" 510 | checksum = "1e18acfa2f90e8b735b2836ab8d538de304cbb6729a7360729ea5a895d15a622" 511 | dependencies = [ 512 | "half", 513 | "serde", 514 | ] 515 | 516 | [[package]] 517 | name = "serde_derive" 518 | version = "1.0.127" 519 | source = "registry+https://github.com/rust-lang/crates.io-index" 520 | checksum = "a024926d3432516606328597e0f224a51355a493b49fdd67e9209187cbe55ecc" 521 | dependencies = [ 522 | "proc-macro2", 523 | "quote", 524 | "syn", 525 | ] 526 | 527 | [[package]] 528 | name = "serde_json" 529 | version = "1.0.66" 530 | source = "registry+https://github.com/rust-lang/crates.io-index" 531 | checksum = "336b10da19a12ad094b59d870ebde26a45402e5b470add4b5fd03c5048a32127" 532 | dependencies = [ 533 | "itoa", 534 | "ryu", 535 | "serde", 536 | ] 537 | 538 | [[package]] 539 | name = "syn" 540 | version = "1.0.74" 541 | source = "registry+https://github.com/rust-lang/crates.io-index" 542 | checksum = "1873d832550d4588c3dbc20f01361ab00bfe741048f71e3fecf145a7cc18b29c" 543 | dependencies = [ 544 | "proc-macro2", 545 | "quote", 546 | "unicode-xid", 547 | ] 548 | 549 | [[package]] 550 | name = "textwrap" 551 | version = "0.11.0" 552 | source = "registry+https://github.com/rust-lang/crates.io-index" 553 | checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" 554 | dependencies = [ 555 | "unicode-width", 556 | ] 557 | 558 | [[package]] 559 | name = "tinytemplate" 560 | version = "1.2.1" 561 | source = "registry+https://github.com/rust-lang/crates.io-index" 562 | checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" 563 | dependencies = [ 564 | "serde", 565 | "serde_json", 566 | ] 567 | 568 | [[package]] 569 | name = "unicode-width" 570 | version = "0.1.8" 571 | source = "registry+https://github.com/rust-lang/crates.io-index" 572 | checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" 573 | 574 | [[package]] 575 | name = "unicode-xid" 576 | version = "0.2.2" 577 | source = "registry+https://github.com/rust-lang/crates.io-index" 578 | checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" 579 | 580 | [[package]] 581 | name = "walkdir" 582 | version = "2.3.2" 583 | source = "registry+https://github.com/rust-lang/crates.io-index" 584 | checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" 585 | dependencies = [ 586 | "same-file", 587 | "winapi", 588 | "winapi-util", 589 | ] 590 | 591 | [[package]] 592 | name = "wasi" 593 | version = "0.9.0+wasi-snapshot-preview1" 594 | source = "registry+https://github.com/rust-lang/crates.io-index" 595 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 596 | 597 | [[package]] 598 | name = "wasm-bindgen" 599 | version = "0.2.75" 600 | source = "registry+https://github.com/rust-lang/crates.io-index" 601 | checksum = "b608ecc8f4198fe8680e2ed18eccab5f0cd4caaf3d83516fa5fb2e927fda2586" 602 | dependencies = [ 603 | "cfg-if", 604 | "wasm-bindgen-macro", 605 | ] 606 | 607 | [[package]] 608 | name = "wasm-bindgen-backend" 609 | version = "0.2.75" 610 | source = "registry+https://github.com/rust-lang/crates.io-index" 611 | checksum = "580aa3a91a63d23aac5b6b267e2d13cb4f363e31dce6c352fca4752ae12e479f" 612 | dependencies = [ 613 | "bumpalo", 614 | "lazy_static", 615 | "log", 616 | "proc-macro2", 617 | "quote", 618 | "syn", 619 | "wasm-bindgen-shared", 620 | ] 621 | 622 | [[package]] 623 | name = "wasm-bindgen-macro" 624 | version = "0.2.75" 625 | source = "registry+https://github.com/rust-lang/crates.io-index" 626 | checksum = "171ebf0ed9e1458810dfcb31f2e766ad6b3a89dbda42d8901f2b268277e5f09c" 627 | dependencies = [ 628 | "quote", 629 | "wasm-bindgen-macro-support", 630 | ] 631 | 632 | [[package]] 633 | name = "wasm-bindgen-macro-support" 634 | version = "0.2.75" 635 | source = "registry+https://github.com/rust-lang/crates.io-index" 636 | checksum = "6c2657dd393f03aa2a659c25c6ae18a13a4048cebd220e147933ea837efc589f" 637 | dependencies = [ 638 | "proc-macro2", 639 | "quote", 640 | "syn", 641 | "wasm-bindgen-backend", 642 | "wasm-bindgen-shared", 643 | ] 644 | 645 | [[package]] 646 | name = "wasm-bindgen-shared" 647 | version = "0.2.75" 648 | source = "registry+https://github.com/rust-lang/crates.io-index" 649 | checksum = "2e0c4a743a309662d45f4ede961d7afa4ba4131a59a639f29b0069c3798bbcc2" 650 | 651 | [[package]] 652 | name = "web-sys" 653 | version = "0.3.52" 654 | source = "registry+https://github.com/rust-lang/crates.io-index" 655 | checksum = "01c70a82d842c9979078c772d4a1344685045f1a5628f677c2b2eab4dd7d2696" 656 | dependencies = [ 657 | "js-sys", 658 | "wasm-bindgen", 659 | ] 660 | 661 | [[package]] 662 | name = "winapi" 663 | version = "0.3.9" 664 | source = "registry+https://github.com/rust-lang/crates.io-index" 665 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 666 | dependencies = [ 667 | "winapi-i686-pc-windows-gnu", 668 | "winapi-x86_64-pc-windows-gnu", 669 | ] 670 | 671 | [[package]] 672 | name = "winapi-i686-pc-windows-gnu" 673 | version = "0.4.0" 674 | source = "registry+https://github.com/rust-lang/crates.io-index" 675 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 676 | 677 | [[package]] 678 | name = "winapi-util" 679 | version = "0.1.5" 680 | source = "registry+https://github.com/rust-lang/crates.io-index" 681 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 682 | dependencies = [ 683 | "winapi", 684 | ] 685 | 686 | [[package]] 687 | name = "winapi-x86_64-pc-windows-gnu" 688 | version = "0.4.0" 689 | source = "registry+https://github.com/rust-lang/crates.io-index" 690 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 691 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-lapper" 3 | version = "1.1.0" 4 | authors = ["Seth Stadick "] 5 | edition = "2018" 6 | license = "MIT" 7 | repository = "https://github.com/sstadick/rust-lapper" 8 | description = "A fast and easy interval overlap library" 9 | documentation = "https://docs.rs/rust-lapper" 10 | readme = "README.md" 11 | categories = ["algorithms", "science"] 12 | keywords = ["tree", "interval", "bioinformatics", "ranges", "genomic"] 13 | 14 | [[example]] 15 | name = "serde" 16 | required-features = ["with_serde"] 17 | 18 | [[example]] 19 | name = "ex1" 20 | 21 | [features] 22 | default = [] 23 | with_serde = ["serde/derive"] 24 | 25 | [dependencies] 26 | num-traits = "0.2.12" 27 | serde = { version = "1.0.127", features = ["derive"], optional = true } 28 | 29 | [dev-dependencies] 30 | criterion = "0.3" 31 | rand = "0.7" 32 | cpu-time = "0.1.0" 33 | bincode = "1.3.3" 34 | 35 | [[bench]] 36 | name = "lapper_benchmark" 37 | harness = false 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Seth M. Stadick 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rust-lapper 2 | 3 |

4 | Build Status 5 | license 6 | Version info
7 |

8 | 9 | [Documentation](https://docs.rs/rust-lapper) 10 | [Crates.io](https://crates.io/crates/rust-lapper) 11 | 12 | This is a rust port of Brent Pendersen's 13 | [nim-lapper](https://github.com/brentp/nim-lapper). It has a few notable 14 | differences, mostly that the find and seek methods both return 15 | iterators, so all adaptor methods may be used normally. 16 | 17 | This crate works well for most interval data that does not include very long 18 | intervals that engulf a majority of other intervals. It is still fairly 19 | comparable to other methods. If you absolutely need time guarantees in the 20 | worst case, see [COItres](https://github.com/dcjones/coitrees) and [IITree](https://docs.rs/bio/0.32.0/bio/data_structures/interval_tree/struct.ArrayBackedIntervalTree.html). 21 | 22 | However, on more typical datasets, this crate is between 4-10x faster 23 | than other interval overlap methods. 24 | 25 | It should also be noted that the `count` method is agnostic to data 26 | type, and should be about as fast as it is possible to be on any 27 | dataset. It is an implementation of the [BITS 28 | algorithm](https://academic.oup.com/bioinformatics/article/29/1/1/273289) 29 | 30 | ## Serde Support 31 | 32 | `rust-lapper` supports serialization with serde for `Lapper` and `Interval` objects: 33 | 34 | ```toml 35 | [dependencies] 36 | rust-lapper = { version = "*", features = ["with_serde"] } 37 | ``` 38 | 39 | See `examples/serde.rs` for a brief example. 40 | 41 | ## Benchmarks 42 | 43 | Benchmarking interval tree-ish datastructures is hard 44 | Please see the 45 | [interval_bakeoff](https://github.com/sstadick/interval_bakeoff) project 46 | for details on how the benchmarks were run... It's not fully baked yet 47 | though, and is finiky to run. 48 | 49 | Command to run: 50 | 51 | ``` 52 | ./target/release/interval_bakeoff fake -a -l RustLapper -l 53 | RustBio -l NestedInterval -n50000 -u100000 54 | 55 | # This equates to the following params: 56 | # num_intervals 50000 57 | # universe_size 100000 58 | # min_interval_size 500 59 | # max_interval_size 80000 60 | # add_large_span true (universe spanning) 61 | ``` 62 | 63 | Set A / b Creation Times 64 | 65 | | crate/method | A time | B time | 66 | | ---------------- | -------- | -------- | 67 | | rust_lapper | 15.625ms | 31.25ms | 68 | | nested_intervals | 15.625ms | 15.625ms | 69 | | bio | 15.625ms | 31.25ms | 70 | 71 | 100% hit rate (A vs A) 72 | 73 | | crate/method | mean time | intersection | 74 | | ---------------------------------- | ---------- | ------------ | 75 | | rust_lapper/find | 4.78125s | 1469068763 | 76 | | rust_lapper/count | 15.625ms | 1469068763 | 77 | | nested_intervals/query_overlapping | 157.4375s | 1469068763 | 78 | | bio/find | 33.296875s | 1469068763 | 79 | 80 | 81 | Sub 100% hit rate (A vs B) 82 | 83 | | crate/method | mean time | intersection | 84 | | ---------------------------------- | ---------- | ------------ | 85 | | rust_lapper/find | 531.25ms | 176488436 | 86 | | rust_lapper/count | 15.625ms | 176488436 | 87 | | nested_intervals/query_overlapping | 11.109375s | 196090092 | 88 | | bio/find | 4.3125s | 176488436 | 89 | 90 | [nested_intervals](https://docs.rs/nested_intervals/0.2.0/nested_intervals/) 91 | [rust-bio](https://docs.rs/bio/0.28.2/bio/) 92 | *Note that rust-bio has a new interval tree structure which should be faster than what is shown here* 93 | 94 | ## Example 95 | 96 | ```rust 97 | use rust_lapper::{Interval, Lapper}; 98 | 99 | type Iv = Interval; 100 | fn main() { 101 | // create some fake data 102 | let data: Vec = vec![ 103 | Iv { 104 | start: 70, 105 | stop: 120, 106 | val: 0, 107 | }, // max_len = 50 108 | Iv { 109 | start: 10, 110 | stop: 15, 111 | val: 0, 112 | }, 113 | Iv { 114 | start: 10, 115 | stop: 15, 116 | val: 0, 117 | }, // exact overlap 118 | Iv { 119 | start: 12, 120 | stop: 15, 121 | val: 0, 122 | }, // inner overlap 123 | Iv { 124 | start: 14, 125 | stop: 16, 126 | val: 0, 127 | }, // overlap end 128 | Iv { 129 | start: 40, 130 | stop: 45, 131 | val: 0, 132 | }, 133 | Iv { 134 | start: 50, 135 | stop: 55, 136 | val: 0, 137 | }, 138 | Iv { 139 | start: 60, 140 | stop: 65, 141 | val: 0, 142 | }, 143 | Iv { 144 | start: 68, 145 | stop: 71, 146 | val: 0, 147 | }, // overlap start 148 | Iv { 149 | start: 70, 150 | stop: 75, 151 | val: 0, 152 | }, 153 | ]; 154 | 155 | // make lapper structure 156 | let mut lapper = Lapper::new(data); 157 | 158 | // Iterator based find to extract all intervals that overlap 6..7 159 | // If your queries are coming in start sorted order, use the seek method to retain a cursor for 160 | // a big speedup. 161 | assert_eq!( 162 | lapper.find(11, 15).collect::>(), 163 | vec![ 164 | &Iv { 165 | start: 10, 166 | stop: 15, 167 | val: 0 168 | }, 169 | &Iv { 170 | start: 10, 171 | stop: 15, 172 | val: 0 173 | }, // exact overlap 174 | &Iv { 175 | start: 12, 176 | stop: 15, 177 | val: 0 178 | }, // inner overlap 179 | &Iv { 180 | start: 14, 181 | stop: 16, 182 | val: 0 183 | }, // overlap end 184 | ] 185 | ); 186 | 187 | // Merge overlaping regions within the lapper to simplifiy and speed up quries that only depend 188 | // on 'any 189 | lapper.merge_overlaps(); 190 | assert_eq!( 191 | lapper.find(11, 15).collect::>(), 192 | vec![&Iv { 193 | start: 10, 194 | stop: 16, 195 | val: 0 196 | },] 197 | ); 198 | 199 | // Get the number of positions covered by the lapper tree: 200 | assert_eq!(lapper.cov(), 73); 201 | 202 | // Get the union and intersect of two different lapper trees 203 | let data = vec![ 204 | Iv { 205 | start: 5, 206 | stop: 15, 207 | val: 0, 208 | }, 209 | Iv { 210 | start: 48, 211 | stop: 80, 212 | val: 0, 213 | }, 214 | ]; 215 | let (union, intersect) = lapper.union_and_intersect(&Lapper::new(data)); 216 | assert_eq!(union, 88); 217 | assert_eq!(intersect, 27); 218 | 219 | // Get the depth at each position covered by the lapper 220 | for interval in lapper.depth().filter(|x| x.val > 2) { 221 | println!( 222 | "Depth at {} - {}: {}", 223 | interval.start, interval.stop, interval.val 224 | ); 225 | } 226 | 227 | } 228 | ``` 229 | 230 | ## Release Notes 231 | 232 | - `1.1.0`: Added insert functionality thanks to @zaporter 233 | - `0.4.0`: Addition of the BITS count algorithm. 234 | - `0.4.2`: Bugfix in to update starts/stops vectors when overlaps merged 235 | - `0.4.3`: Remove leftover print statement 236 | - `0.5.0`: Make Interval start/stop generic 237 | - `1.0.0`: Add serde support via the `with_serde` feature flag 238 | -------------------------------------------------------------------------------- /benches.txt: -------------------------------------------------------------------------------- 1 | 2 | running 15 tests 3 | test tests::test_bad_skips ... ignored 4 | test tests::test_find_over_behind_first_match ... ignored 5 | test tests::test_find_overlaps_in_large_intervals ... ignored 6 | test tests::test_interval_envelops_query ... ignored 7 | test tests::test_interval_intersects ... ignored 8 | test tests::test_lapper_cov ... ignored 9 | test tests::test_merge_overlaps ... ignored 10 | test tests::test_overlapping_intervals ... ignored 11 | test tests::test_query_envolops_interval ... ignored 12 | test tests::test_query_overlaps_interval_start ... ignored 13 | test tests::test_query_overlaps_interval_stop ... ignored 14 | test tests::test_query_start_interval_stop ... ignored 15 | test tests::test_query_stop_interval_start ... ignored 16 | test tests::test_seek_over_len ... ignored 17 | test tests::test_union_and_intersect ... ignored 18 | 19 | test result: ok. 0 passed; 0 failed; 15 ignored; 0 measured; 0 filtered out 20 | 21 | Gnuplot not found, disabling plotting 22 | Benchmarking Bakeoff/rust-lapper: find with 100% hit rate 23 | Benchmarking Bakeoff/rust-lapper: find with 100% hit rate: Warming up for 3.0000 s 24 | Benchmarking Bakeoff/rust-lapper: find with 100% hit rate: Collecting 100 samples in estimated 5.2105 s (121k iterations) 25 | Benchmarking Bakeoff/rust-lapper: find with 100% hit rate: Analyzing 26 | Bakeoff/rust-lapper: find with 100% hit rate 27 | time: [42.747 us 42.800 us 42.865 us] 28 | Found 19 outliers among 100 measurements (19.00%) 29 | 2 (2.00%) high mild 30 | 17 (17.00%) high severe 31 | Benchmarking Bakeoff/rust-lapper: find with below 100% hit rate 32 | Benchmarking Bakeoff/rust-lapper: find with below 100% hit rate: Warming up for 3.0000 s 33 | Benchmarking Bakeoff/rust-lapper: find with below 100% hit rate: Collecting 100 samples in estimated 5.0269 s (404k iterations) 34 | Benchmarking Bakeoff/rust-lapper: find with below 100% hit rate: Analyzing 35 | Bakeoff/rust-lapper: find with below 100% hit rate 36 | time: [11.878 us 11.886 us 11.895 us] 37 | Found 7 outliers among 100 measurements (7.00%) 38 | 2 (2.00%) high mild 39 | 5 (5.00%) high severe 40 | Benchmarking Bakeoff/rust-lapper: seek with 100% hit rate 41 | Benchmarking Bakeoff/rust-lapper: seek with 100% hit rate: Warming up for 3.0000 s 42 | Benchmarking Bakeoff/rust-lapper: seek with 100% hit rate: Collecting 100 samples in estimated 5.0049 s (490k iterations) 43 | Benchmarking Bakeoff/rust-lapper: seek with 100% hit rate: Analyzing 44 | Bakeoff/rust-lapper: seek with 100% hit rate 45 | time: [10.170 us 10.223 us 10.299 us] 46 | Found 10 outliers among 100 measurements (10.00%) 47 | 5 (5.00%) high mild 48 | 5 (5.00%) high severe 49 | Benchmarking Bakeoff/rust-lapper: seek with below 100% hit rate 50 | Benchmarking Bakeoff/rust-lapper: seek with below 100% hit rate: Warming up for 3.0000 s 51 | Benchmarking Bakeoff/rust-lapper: seek with below 100% hit rate: Collecting 100 samples in estimated 5.0103 s (1.6M iterations) 52 | Benchmarking Bakeoff/rust-lapper: seek with below 100% hit rate: Analyzing 53 | Bakeoff/rust-lapper: seek with below 100% hit rate 54 | time: [3.1775 us 3.1825 us 3.1882 us] 55 | Found 20 outliers among 100 measurements (20.00%) 56 | 1 (1.00%) high mild 57 | 19 (19.00%) high severe 58 | Benchmarking Bakeoff/rust-lapper: find with below 100% hit rate - chromosome spanning interval 59 | Benchmarking Bakeoff/rust-lapper: find with below 100% hit rate - chromosome spanning interval: Warming up for 3.0000 s 60 | Benchmarking Bakeoff/rust-lapper: find with below 100% hit rate - chromosome spanning interval: Collecting 100 samples in estimated 5.0101 s (81k iterations) 61 | Benchmarking Bakeoff/rust-lapper: find with below 100% hit rate - chromosome spanning interval: Analyzing 62 | Bakeoff/rust-lapper: find with below 100% hit rate - chromosome spanning interval 63 | time: [61.147 us 61.184 us 61.228 us] 64 | Found 8 outliers among 100 measurements (8.00%) 65 | 3 (3.00%) high mild 66 | 5 (5.00%) high severe 67 | Benchmarking Bakeoff/rust-lapper: seek with below 100% hit rate - chromosome spanning interval 68 | Benchmarking Bakeoff/rust-lapper: seek with below 100% hit rate - chromosome spanning interval: Warming up for 3.0000 s 69 | Benchmarking Bakeoff/rust-lapper: seek with below 100% hit rate - chromosome spanning interval: Collecting 100 samples in estimated 5.0015 s (81k iterations) 70 | Benchmarking Bakeoff/rust-lapper: seek with below 100% hit rate - chromosome spanning interval: Analyzing 71 | Bakeoff/rust-lapper: seek with below 100% hit rate - chromosome spanning interval 72 | time: [61.353 us 61.386 us 61.431 us] 73 | Found 10 outliers among 100 measurements (10.00%) 74 | 1 (1.00%) low severe 75 | 4 (4.00%) high mild 76 | 5 (5.00%) high severe 77 | Benchmarking Bakeoff/nested_intervals: query_overlapping with 100% hit rate 78 | Benchmarking Bakeoff/nested_intervals: query_overlapping with 100% hit rate: Warming up for 3.0000 s 79 | Benchmarking Bakeoff/nested_intervals: query_overlapping with 100% hit rate: Collecting 100 samples in estimated 5.5951 s (25k iterations) 80 | Benchmarking Bakeoff/nested_intervals: query_overlapping with 100% hit rate: Analyzing 81 | Bakeoff/nested_intervals: query_overlapping with 100% hit rate 82 | time: [221.03 us 221.08 us 221.13 us] 83 | Found 1 outliers among 100 measurements (1.00%) 84 | 1 (1.00%) high severe 85 | Benchmarking Bakeoff/nested_intervals: query_overlapping with below 100% hit rate 86 | Benchmarking Bakeoff/nested_intervals: query_overlapping with below 100% hit rate: Warming up for 3.0000 s 87 | Benchmarking Bakeoff/nested_intervals: query_overlapping with below 100% hit rate: Collecting 100 samples in estimated 5.0202 s (141k iterations) 88 | Benchmarking Bakeoff/nested_intervals: query_overlapping with below 100% hit rate: Analyzing 89 | Bakeoff/nested_intervals: query_overlapping with below 100% hit rate 90 | time: [34.301 us 34.500 us 34.728 us] 91 | Found 12 outliers among 100 measurements (12.00%) 92 | 12 (12.00%) high severe 93 | Benchmarking Bakeoff/nested_intervals: query_overlapping with below 100% hit rate - chromosome spanning interval 94 | Benchmarking Bakeoff/nested_intervals: query_overlapping with below 100% hit rate - chromosome spanning interval: Warming up for 3.0000 s 95 | Benchmarking Bakeoff/nested_intervals: query_overlapping with below 100% hit rate - chromosome spanning interval: Collecting 100 samples in estimated 5.1724 s (141k iterations) 96 | Benchmarking Bakeoff/nested_intervals: query_overlapping with below 100% hit rate - chromosome spanning interval: Analyzing 97 | Bakeoff/nested_intervals: query_overlapping with below 100% hit rate - chromosome spanning interval 98 | time: [36.109 us 36.144 us 36.188 us] 99 | Found 12 outliers among 100 measurements (12.00%) 100 | 5 (5.00%) high mild 101 | 7 (7.00%) high severe 102 | Benchmarking Bakeoff/rust-bio: find with 100% hit rate 103 | Benchmarking Bakeoff/rust-bio: find with 100% hit rate: Warming up for 3.0000 s 104 | Benchmarking Bakeoff/rust-bio: find with 100% hit rate: Collecting 100 samples in estimated 6.1123 s (25k iterations) 105 | Benchmarking Bakeoff/rust-bio: find with 100% hit rate: Analyzing 106 | Bakeoff/rust-bio: find with 100% hit rate 107 | time: [240.43 us 240.82 us 241.31 us] 108 | Found 10 outliers among 100 measurements (10.00%) 109 | 1 (1.00%) high mild 110 | 9 (9.00%) high severe 111 | Benchmarking Bakeoff/rust-bio: find with below 100% hit rate 112 | Benchmarking Bakeoff/rust-bio: find with below 100% hit rate: Warming up for 3.0000 s 113 | Benchmarking Bakeoff/rust-bio: find with below 100% hit rate: Collecting 100 samples in estimated 5.1431 s (167k iterations) 114 | Benchmarking Bakeoff/rust-bio: find with below 100% hit rate: Analyzing 115 | Bakeoff/rust-bio: find with below 100% hit rate 116 | time: [30.597 us 30.664 us 30.747 us] 117 | Found 11 outliers among 100 measurements (11.00%) 118 | 11 (11.00%) high severe 119 | Benchmarking Bakeoff/rust-bio: find with below 100% hit rate - chromosome spanning interval 120 | Benchmarking Bakeoff/rust-bio: find with below 100% hit rate - chromosome spanning interval: Warming up for 3.0000 s 121 | Benchmarking Bakeoff/rust-bio: find with below 100% hit rate - chromosome spanning interval: Collecting 100 samples in estimated 5.1201 s (146k iterations) 122 | Benchmarking Bakeoff/rust-bio: find with below 100% hit rate - chromosome spanning interval: Analyzing 123 | Bakeoff/rust-bio: find with below 100% hit rate - chromosome spanning interval 124 | time: [34.506 us 34.691 us 34.976 us] 125 | Found 6 outliers among 100 measurements (6.00%) 126 | 1 (1.00%) high mild 127 | 5 (5.00%) high severe 128 | 129 | Benchmarking Lapper find overlaps/find with 100% hit rate 130 | Benchmarking Lapper find overlaps/find with 100% hit rate: Warming up for 3.0000 s 131 | Benchmarking Lapper find overlaps/find with 100% hit rate: Collecting 100 samples in estimated 5.2006 s (121k iterations) 132 | Benchmarking Lapper find overlaps/find with 100% hit rate: Analyzing 133 | Lapper find overlaps/find with 100% hit rate 134 | time: [42.924 us 43.187 us 43.502 us] 135 | change: [-8.6658% -6.6530% -4.6975%] (p = 0.00 < 0.05) 136 | Performance has improved. 137 | Found 14 outliers among 100 measurements (14.00%) 138 | 1 (1.00%) low mild 139 | 3 (3.00%) high mild 140 | 10 (10.00%) high severe 141 | Benchmarking Lapper find overlaps/find with below 100% hit rate 142 | Benchmarking Lapper find overlaps/find with below 100% hit rate: Warming up for 3.0000 s 143 | Benchmarking Lapper find overlaps/find with below 100% hit rate: Collecting 100 samples in estimated 5.0457 s (424k iterations) 144 | Benchmarking Lapper find overlaps/find with below 100% hit rate: Analyzing 145 | Lapper find overlaps/find with below 100% hit rate 146 | time: [11.860 us 11.869 us 11.880 us] 147 | change: [-6.0899% -5.6600% -5.2772%] (p = 0.00 < 0.05) 148 | Performance has improved. 149 | Found 10 outliers among 100 measurements (10.00%) 150 | 2 (2.00%) high mild 151 | 8 (8.00%) high severe 152 | Benchmarking Lapper find overlaps/find_skip with 100% hit rate 153 | Benchmarking Lapper find overlaps/find_skip with 100% hit rate: Warming up for 3.0000 s 154 | Benchmarking Lapper find overlaps/find_skip with 100% hit rate: Collecting 100 samples in estimated 5.1851 s (111k iterations) 155 | Benchmarking Lapper find overlaps/find_skip with 100% hit rate: Analyzing 156 | Lapper find overlaps/find_skip with 100% hit rate 157 | time: [43.896 us 43.970 us 44.063 us] 158 | change: [-8.1682% -7.3897% -6.6098%] (p = 0.00 < 0.05) 159 | Performance has improved. 160 | Benchmarking Lapper find overlaps/find_skip with below 100% hit rate 161 | Benchmarking Lapper find overlaps/find_skip with below 100% hit rate: Warming up for 3.0000 s 162 | Benchmarking Lapper find overlaps/find_skip with below 100% hit rate: Collecting 100 samples in estimated 5.0628 s (359k iterations) 163 | Benchmarking Lapper find overlaps/find_skip with below 100% hit rate: Analyzing 164 | Lapper find overlaps/find_skip with below 100% hit rate 165 | time: [14.081 us 14.085 us 14.088 us] 166 | change: [-1.3755% -1.1823% -1.0482%] (p = 0.00 < 0.05) 167 | Performance has improved. 168 | Found 4 outliers among 100 measurements (4.00%) 169 | 2 (2.00%) low severe 170 | 1 (1.00%) high mild 171 | 1 (1.00%) high severe 172 | Benchmarking Lapper find overlaps/find with 100% hit rate - chromosome spanning interval 173 | Benchmarking Lapper find overlaps/find with 100% hit rate - chromosome spanning interval: Warming up for 3.0000 s 174 | Benchmarking Lapper find overlaps/find with 100% hit rate - chromosome spanning interval: Collecting 100 samples in estimated 6.2907 s (20k iterations) 175 | Benchmarking Lapper find overlaps/find with 100% hit rate - chromosome spanning interval: Analyzing 176 | Lapper find overlaps/find with 100% hit rate - chromosome spanning interval 177 | time: [310.57 us 310.86 us 311.21 us] 178 | change: [-0.9177% -0.5656% -0.2312%] (p = 0.00 < 0.05) 179 | Change within noise threshold. 180 | Found 10 outliers among 100 measurements (10.00%) 181 | 2 (2.00%) high mild 182 | 8 (8.00%) high severe 183 | Benchmarking Lapper find overlaps/find_skip below 100% hit rate - chromsome spanning interval 184 | Benchmarking Lapper find overlaps/find_skip below 100% hit rate - chromsome spanning interval: Warming up for 3.0000 s 185 | Benchmarking Lapper find overlaps/find_skip below 100% hit rate - chromsome spanning interval: Collecting 100 samples in estimated 5.0362 s (20k iterations) 186 | Benchmarking Lapper find overlaps/find_skip below 100% hit rate - chromsome spanning interval: Analyzing 187 | Lapper find overlaps/find_skip below 100% hit rate - chromsome spanning interval 188 | time: [240.98 us 241.29 us 241.64 us] 189 | change: [-12.895% -12.647% -12.376%] (p = 0.00 < 0.05) 190 | Performance has improved. 191 | Found 7 outliers among 100 measurements (7.00%) 192 | 2 (2.00%) high mild 193 | 5 (5.00%) high severe 194 | Benchmarking Lapper find overlaps/seek with 100% hit rate 195 | Benchmarking Lapper find overlaps/seek with 100% hit rate: Warming up for 3.0000 s 196 | Benchmarking Lapper find overlaps/seek with 100% hit rate: Collecting 100 samples in estimated 5.0021 s (490k iterations) 197 | Benchmarking Lapper find overlaps/seek with 100% hit rate: Analyzing 198 | Lapper find overlaps/seek with 100% hit rate 199 | time: [10.097 us 10.107 us 10.118 us] 200 | change: [-0.7407% -0.5673% -0.4081%] (p = 0.00 < 0.05) 201 | Change within noise threshold. 202 | Found 7 outliers among 100 measurements (7.00%) 203 | 5 (5.00%) high mild 204 | 2 (2.00%) high severe 205 | Benchmarking Lapper find overlaps/seek with below 100% hit rate 206 | Benchmarking Lapper find overlaps/seek with below 100% hit rate: Warming up for 3.0000 s 207 | Benchmarking Lapper find overlaps/seek with below 100% hit rate: Collecting 100 samples in estimated 5.0023 s (1.6M iterations) 208 | Benchmarking Lapper find overlaps/seek with below 100% hit rate: Analyzing 209 | Lapper find overlaps/seek with below 100% hit rate 210 | time: [3.1711 us 3.1745 us 3.1785 us] 211 | change: [-5.2600% -4.7691% -4.3226%] (p = 0.00 < 0.05) 212 | Performance has improved. 213 | Found 11 outliers among 100 measurements (11.00%) 214 | 7 (7.00%) high mild 215 | 4 (4.00%) high severe 216 | Benchmarking Lapper find overlaps/seek_skip with 100% hit rate 217 | Benchmarking Lapper find overlaps/seek_skip with 100% hit rate: Warming up for 3.0000 s 218 | Benchmarking Lapper find overlaps/seek_skip with 100% hit rate: Collecting 100 samples in estimated 5.0386 s (242k iterations) 219 | Benchmarking Lapper find overlaps/seek_skip with 100% hit rate: Analyzing 220 | Lapper find overlaps/seek_skip with 100% hit rate 221 | time: [20.366 us 20.385 us 20.408 us] 222 | change: [-7.7326% -7.3996% -7.1256%] (p = 0.00 < 0.05) 223 | Performance has improved. 224 | Found 10 outliers among 100 measurements (10.00%) 225 | 4 (4.00%) low mild 226 | 3 (3.00%) high mild 227 | 3 (3.00%) high severe 228 | Benchmarking Lapper find overlaps/seek_skip with below 100% hit rate 229 | Benchmarking Lapper find overlaps/seek_skip with below 100% hit rate: Warming up for 3.0000 s 230 | Benchmarking Lapper find overlaps/seek_skip with below 100% hit rate: Collecting 100 samples in estimated 5.0176 s (692k iterations) 231 | Benchmarking Lapper find overlaps/seek_skip with below 100% hit rate: Analyzing 232 | Lapper find overlaps/seek_skip with below 100% hit rate 233 | time: [7.1981 us 7.2062 us 7.2163 us] 234 | change: [-5.7748% -5.1467% -4.5538%] (p = 0.00 < 0.05) 235 | Performance has improved. 236 | Found 14 outliers among 100 measurements (14.00%) 237 | 6 (6.00%) high mild 238 | 8 (8.00%) high severe 239 | 240 | Gnuplot not found, disabling plotting 241 | -------------------------------------------------------------------------------- /benches/lapper_benchmark.rs: -------------------------------------------------------------------------------- 1 | #[macro_use] 2 | extern crate criterion; 3 | extern crate rand; 4 | extern crate rust_lapper; 5 | 6 | use cpu_time::ProcessTime; 7 | use criterion::black_box; 8 | use criterion::Criterion; 9 | use rand::prelude::*; 10 | use rand::Rng; 11 | use rust_lapper::{Interval, Lapper}; 12 | use std::ops::Range; 13 | use std::time::Duration; 14 | 15 | type Iv = Interval; 16 | 17 | fn randomi(imin: u32, imax: u32) -> u32 { 18 | let mut rng = rand::thread_rng(); 19 | imin + rng.gen_range(0, imax - imin) 20 | } 21 | 22 | fn make_random(n: usize, range_max: u32, size_min: u32, size_max: u32) -> Vec { 23 | let mut result = Vec::with_capacity(n); 24 | for i in 0..n { 25 | let s = randomi(0, range_max); 26 | let e = s + randomi(size_min, size_max); 27 | result.push(Interval { 28 | start: s, 29 | stop: e, 30 | val: false, 31 | }); 32 | } 33 | result 34 | } 35 | 36 | fn make_interval_set() -> (Vec, Vec) { 37 | //let n = 3_000_000; 38 | let n = 1_000; 39 | let chrom_size = 100_000_000; 40 | let min_interval_size = 500; 41 | let max_interval_size = 80000; 42 | let intervals = make_random(n, chrom_size, min_interval_size, max_interval_size); 43 | let other_intervals = make_random(n, 10 * chrom_size, 1, 2); 44 | (intervals, other_intervals) 45 | } 46 | 47 | pub fn query(c: &mut Criterion) { 48 | let (intervals, other_intervals) = make_interval_set(); 49 | // Make Lapper intervals 50 | let mut bad_intervals = intervals.clone(); 51 | let lapper = Lapper::new(intervals); 52 | let other_lapper = Lapper::new(other_intervals); 53 | bad_intervals.push(Iv { 54 | start: 0, 55 | stop: 90_000_000, 56 | val: false, 57 | }); 58 | let bad_lapper = Lapper::new(bad_intervals); 59 | //let start = ProcessTime::now(); 60 | //println!("Starting timer"); 61 | //let mut count = 0; 62 | //for x in lapper.iter() { 63 | //count += lapper.find(x.start, x.stop).count(); 64 | //} 65 | //let cpu_time: Duration = start.elapsed(); 66 | //println!("100% hit rate: {:#?}", cpu_time); 67 | //println!("Found {}", count); 68 | 69 | let mut comparison_group = c.benchmark_group("Bakeoff"); 70 | comparison_group.bench_function("rust-lapper: find with 100% hit rate", |b| { 71 | b.iter(|| { 72 | for x in lapper.iter() { 73 | lapper.find(x.start, x.stop).count(); 74 | } 75 | }); 76 | }); 77 | comparison_group.bench_function("rust-lapper: seek with 100% hit rate", |b| { 78 | b.iter(|| { 79 | let mut cursor = 0; 80 | for x in lapper.iter() { 81 | lapper.seek(x.start, x.stop, &mut cursor).count(); 82 | } 83 | }); 84 | }); 85 | comparison_group.bench_function("rust-lapper: count with 100% hit rate", |b| { 86 | b.iter(|| { 87 | for x in lapper.iter() { 88 | lapper.count(x.start, x.stop); 89 | } 90 | }); 91 | }); 92 | comparison_group.bench_function("rust-lapper: find with below 100% hit rate", |b| { 93 | b.iter(|| { 94 | for x in other_lapper.iter() { 95 | lapper.find(x.start, x.stop).count(); 96 | } 97 | }); 98 | }); 99 | comparison_group.bench_function("rust-lapper: seek with below 100% hit rate", |b| { 100 | b.iter(|| { 101 | let mut cursor = 0; 102 | for x in other_lapper.iter() { 103 | lapper.seek(x.start, x.stop, &mut cursor).count(); 104 | } 105 | }); 106 | }); 107 | comparison_group.bench_function("rust-lapper: count with below 100% hit rate", |b| { 108 | b.iter(|| { 109 | for x in other_lapper.iter() { 110 | lapper.count(x.start, x.stop); 111 | } 112 | }); 113 | }); 114 | comparison_group.bench_function( 115 | "rust-lapper: find with below 100% hit rate - chromosome spanning interval", 116 | |b| { 117 | b.iter(|| { 118 | for x in other_lapper.iter() { 119 | bad_lapper.find(x.start, x.stop).count(); 120 | } 121 | }); 122 | }, 123 | ); 124 | comparison_group.bench_function( 125 | "rust-lapper: seek with below 100% hit rate - chromosome spanning interval", 126 | |b| { 127 | b.iter(|| { 128 | let mut cursor = 0; 129 | for x in other_lapper.iter() { 130 | bad_lapper.seek(x.start, x.stop, &mut cursor).count(); 131 | } 132 | }); 133 | }, 134 | ); 135 | comparison_group.bench_function( 136 | "rust-lapper: count with below 100% hit rate - chromosome spanning interval", 137 | |b| { 138 | b.iter(|| { 139 | for x in other_lapper.iter() { 140 | bad_lapper.count(x.start, x.stop); 141 | } 142 | }); 143 | }, 144 | ); 145 | comparison_group.finish(); 146 | } 147 | 148 | criterion_group!(benches, query); 149 | criterion_main!(benches); 150 | -------------------------------------------------------------------------------- /devlog.md: -------------------------------------------------------------------------------- 1 | ## 9/20/19 2 | - Maybe add max_ends list to the Lapper. Then binary search for upper 3 | bounds like AIList does, and iterate backwards checking against the 4 | max_end to deteremine overlap... It could make the hopper actually 5 | work as well since binary searches in a local area would be useful 6 | 7 | ## 9/3/19 8 | - Added a worst case mode to allow for setting max misses and then 9 | recalculating the binary search from there. I think that for anything 10 | except maybe whole chromosome intervals, it's faster to not use it. 11 | - Updated docs 12 | ## 9/2/19 13 | - Corrected the range on the IterFind to properly stop looking once stop 14 | has been hit. 15 | - Added benchmarks for find and seek 16 | - Sped up the intesection method when we know that overlaps have been 17 | merged. 18 | - Figure out the possible speedup with miss counting!! 19 | - Fix up docs to include features list / make less block of text 20 | ## 9/1/19 21 | - Corrected the intersection_and_union function to work regardless of 22 | the comparison direction. It's a little slower now and in need of 23 | benchmarking. I think there is a gain to be had if we know that both 24 | lappers have had overlaps merged, I'm just now sure how to make it 25 | work yet. 26 | - Copy the version of intersect_and_union from chromcomp, it works and 27 | is faster 28 | - Next big todo: add benchmarking! 29 | 30 | ## 8/31/19 31 | - Moved a bunch of functionality in, like merge overlaps and detect 32 | intersects and coverage calculation. 33 | - I would like to add some whole Lapper functions like a union an 34 | intersect. -- did this... but needs fine tuning 35 | - I would like to add benchmarks and identify the slow stuff 36 | - Something is now really slow I think. Like maybe the coverage 37 | calculation. Bench it and see. I also think the checked_sub might be 38 | slowing things down. -- figured it out. HashSet was a dumb idea for 39 | calculation of coverage and has been changed to be faster. 40 | -------------------------------------------------------------------------------- /examples/ex1.rs: -------------------------------------------------------------------------------- 1 | use rust_lapper::{Interval, Lapper}; 2 | 3 | type Iv = Interval; 4 | fn main() { 5 | // create some fake data 6 | let data: Vec = vec![ 7 | Iv { 8 | start: 70, 9 | stop: 120, 10 | val: 0, 11 | }, // max_len = 50 12 | Iv { 13 | start: 10, 14 | stop: 15, 15 | val: 0, 16 | }, 17 | Iv { 18 | start: 10, 19 | stop: 15, 20 | val: 0, 21 | }, // exact overlap 22 | Iv { 23 | start: 12, 24 | stop: 15, 25 | val: 0, 26 | }, // inner overlap 27 | Iv { 28 | start: 14, 29 | stop: 16, 30 | val: 0, 31 | }, // overlap end 32 | Iv { 33 | start: 40, 34 | stop: 45, 35 | val: 0, 36 | }, 37 | Iv { 38 | start: 50, 39 | stop: 55, 40 | val: 0, 41 | }, 42 | Iv { 43 | start: 60, 44 | stop: 65, 45 | val: 0, 46 | }, 47 | Iv { 48 | start: 68, 49 | stop: 71, 50 | val: 0, 51 | }, // overlap start 52 | Iv { 53 | start: 70, 54 | stop: 75, 55 | val: 0, 56 | }, 57 | ]; 58 | 59 | // make lapper structure 60 | let mut lapper = Lapper::new(data); 61 | 62 | // Iterator based find to extract all intervals that overlap 6..7 63 | // If your queries are coming in start sorted order, use the seek method to retain a cursor for 64 | // a big speedup. 65 | assert_eq!( 66 | lapper.find(11, 15).collect::>(), 67 | vec![ 68 | &Iv { 69 | start: 10, 70 | stop: 15, 71 | val: 0 72 | }, 73 | &Iv { 74 | start: 10, 75 | stop: 15, 76 | val: 0 77 | }, // exact overlap 78 | &Iv { 79 | start: 12, 80 | stop: 15, 81 | val: 0 82 | }, // inner overlap 83 | &Iv { 84 | start: 14, 85 | stop: 16, 86 | val: 0 87 | }, // overlap end 88 | ] 89 | ); 90 | 91 | // Merge overlaping regions within the lapper to simplifiy and speed up quries that only depend 92 | // on 'any 93 | lapper.merge_overlaps(); 94 | assert_eq!( 95 | lapper.find(11, 15).collect::>(), 96 | vec![&Iv { 97 | start: 10, 98 | stop: 16, 99 | val: 0 100 | },] 101 | ); 102 | 103 | // Get the number of positions covered by the lapper tree: 104 | assert_eq!(lapper.cov(), 73); 105 | 106 | // Get the union and intersect of two different lapper trees 107 | let data = vec![ 108 | Iv { 109 | start: 5, 110 | stop: 15, 111 | val: 0, 112 | }, 113 | Iv { 114 | start: 48, 115 | stop: 80, 116 | val: 0, 117 | }, 118 | ]; 119 | let (union, intersect) = lapper.union_and_intersect(&Lapper::new(data)); 120 | assert_eq!(union, 88); 121 | assert_eq!(intersect, 27); 122 | 123 | // Get the depth at each position covered by the lapper 124 | for interval in lapper.depth().filter(|x| x.val > 2) { 125 | println!( 126 | "Depth at {} - {}: {}", 127 | interval.start, interval.stop, interval.val 128 | ); 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /examples/serde.rs: -------------------------------------------------------------------------------- 1 | use rust_lapper::{Interval, Lapper}; 2 | 3 | type Iv = Interval; 4 | fn main() { 5 | // create some fake data 6 | let data: Vec = vec![ 7 | Iv { 8 | start: 70, 9 | stop: 120, 10 | val: 0, 11 | }, // max_len = 50 12 | Iv { 13 | start: 10, 14 | stop: 15, 15 | val: 0, 16 | }, 17 | Iv { 18 | start: 10, 19 | stop: 15, 20 | val: 0, 21 | }, // exact overlap 22 | Iv { 23 | start: 12, 24 | stop: 15, 25 | val: 0, 26 | }, // inner overlap 27 | Iv { 28 | start: 14, 29 | stop: 16, 30 | val: 0, 31 | }, // overlap end 32 | Iv { 33 | start: 40, 34 | stop: 45, 35 | val: 0, 36 | }, 37 | Iv { 38 | start: 50, 39 | stop: 55, 40 | val: 0, 41 | }, 42 | Iv { 43 | start: 60, 44 | stop: 65, 45 | val: 0, 46 | }, 47 | Iv { 48 | start: 68, 49 | stop: 71, 50 | val: 0, 51 | }, // overlap start 52 | Iv { 53 | start: 70, 54 | stop: 75, 55 | val: 0, 56 | }, 57 | ]; 58 | 59 | // make lapper structure 60 | let mut lapper = Lapper::new(data); 61 | 62 | // Iterator based find to extract all intervals that overlap 6..7 63 | // If your queries are coming in start sorted order, use the seek method to retain a cursor for 64 | // a big speedup. 65 | assert_eq!( 66 | lapper.find(11, 15).collect::>(), 67 | vec![ 68 | &Iv { 69 | start: 10, 70 | stop: 15, 71 | val: 0 72 | }, 73 | &Iv { 74 | start: 10, 75 | stop: 15, 76 | val: 0 77 | }, // exact overlap 78 | &Iv { 79 | start: 12, 80 | stop: 15, 81 | val: 0 82 | }, // inner overlap 83 | &Iv { 84 | start: 14, 85 | stop: 16, 86 | val: 0 87 | }, // overlap end 88 | ] 89 | ); 90 | 91 | // Merge overlaping regions within the lapper to simplifiy and speed up quries that only depend 92 | // on 'any 93 | lapper.merge_overlaps(); 94 | assert_eq!( 95 | lapper.find(11, 15).collect::>(), 96 | vec![&Iv { 97 | start: 10, 98 | stop: 16, 99 | val: 0 100 | },] 101 | ); 102 | 103 | // Get the number of positions covered by the lapper tree: 104 | assert_eq!(lapper.cov(), 73); 105 | 106 | // Get the union and intersect of two different lapper trees 107 | let data = vec![ 108 | Iv { 109 | start: 5, 110 | stop: 15, 111 | val: 0, 112 | }, 113 | Iv { 114 | start: 48, 115 | stop: 80, 116 | val: 0, 117 | }, 118 | ]; 119 | let (union, intersect) = lapper.union_and_intersect(&Lapper::new(data)); 120 | assert_eq!(union, 88); 121 | assert_eq!(intersect, 27); 122 | 123 | // Get the depth at each position covered by the lapper 124 | for interval in lapper.depth().filter(|x| x.val > 2) { 125 | println!( 126 | "Depth at {} - {}: {}", 127 | interval.start, interval.stop, interval.val 128 | ); 129 | } 130 | 131 | let encoded = bincode::serialize(&lapper).unwrap(); 132 | let decoded: Lapper = bincode::deserialize(&encoded[..]).unwrap(); 133 | dbg!(lapper); 134 | dbg!(decoded); 135 | } 136 | -------------------------------------------------------------------------------- /images/nested_intervals_bad_mean.svg: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | Gnuplot 9 | Produced by GNUPLOT 5.2 patchlevel 6 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 0 46 | 47 | 48 | 49 | 50 | 1 51 | 52 | 53 | 54 | 55 | 2 56 | 57 | 58 | 59 | 60 | 3 61 | 62 | 63 | 64 | 65 | 4 66 | 67 | 68 | 69 | 70 | 5 71 | 72 | 73 | 74 | 75 | 6 76 | 77 | 78 | 79 | 80 | 7 81 | 82 | 83 | 84 | 85 | 8 86 | 87 | 88 | 89 | 90 | 9 91 | 92 | 93 | 94 | 95 | 37.4 96 | 97 | 98 | 99 | 100 | 37.45 101 | 102 | 103 | 104 | 105 | 37.5 106 | 107 | 108 | 109 | 110 | 37.55 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | Density (a.u.) 120 | 121 | 122 | 123 | 124 | Average time (us) 125 | 126 | 127 | 128 | 129 | Bakeoff/nested_intervals: query_overlapping with below 100% hit rate - chromosome spanning interval: mean 130 | 131 | 132 | Bootstrap distribution 133 | 134 | 135 | 136 | 137 | Bootstrap distribution 138 | 139 | 140 | 141 | 204 | 205 | Confidence interval 206 | 207 | 208 | 209 | 210 | Confidence interval 211 | 212 | 213 | 214 | 215 | 216 | 267 | 268 | 269 | 270 | Point estimate 271 | 272 | 273 | 274 | 275 | Point estimate 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | -------------------------------------------------------------------------------- /images/rust_bio_bad_mean.svg: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | Gnuplot 9 | Produced by GNUPLOT 5.2 patchlevel 6 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 0 46 | 47 | 48 | 49 | 50 | 0.5 51 | 52 | 53 | 54 | 55 | 1 56 | 57 | 58 | 59 | 60 | 1.5 61 | 62 | 63 | 64 | 65 | 2 66 | 67 | 68 | 69 | 70 | 2.5 71 | 72 | 73 | 74 | 75 | 36.9 76 | 77 | 78 | 79 | 80 | 37 81 | 82 | 83 | 84 | 85 | 37.1 86 | 87 | 88 | 89 | 90 | 37.2 91 | 92 | 93 | 94 | 95 | 37.3 96 | 97 | 98 | 99 | 100 | 37.4 101 | 102 | 103 | 104 | 105 | 37.5 106 | 107 | 108 | 109 | 110 | 37.6 111 | 112 | 113 | 114 | 115 | 37.7 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | Density (a.u.) 125 | 126 | 127 | 128 | 129 | Average time (us) 130 | 131 | 132 | 133 | 134 | Bakeoff/rust-bio: find with below 100% hit rate - chromosome spanning interval: mean 135 | 136 | 137 | Bootstrap distribution 138 | 139 | 140 | 141 | 142 | Bootstrap distribution 143 | 144 | 145 | 146 | 209 | 210 | Confidence interval 211 | 212 | 213 | 214 | 215 | Confidence interval 216 | 217 | 218 | 219 | 220 | 221 | 272 | 273 | 274 | 275 | Point estimate 276 | 277 | 278 | 279 | 280 | Point estimate 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | -------------------------------------------------------------------------------- /images/rust_bio_mean.svg: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | Gnuplot 9 | Produced by GNUPLOT 5.2 patchlevel 6 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 0 46 | 47 | 48 | 49 | 50 | 0.5 51 | 52 | 53 | 54 | 55 | 1 56 | 57 | 58 | 59 | 60 | 1.5 61 | 62 | 63 | 64 | 65 | 2 66 | 67 | 68 | 69 | 70 | 2.5 71 | 72 | 73 | 74 | 75 | 3 76 | 77 | 78 | 79 | 80 | 3.5 81 | 82 | 83 | 84 | 85 | 32.8 86 | 87 | 88 | 89 | 90 | 32.9 91 | 92 | 93 | 94 | 95 | 33 96 | 97 | 98 | 99 | 100 | 33.1 101 | 102 | 103 | 104 | 105 | 33.2 106 | 107 | 108 | 109 | 110 | 33.3 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | Density (a.u.) 120 | 121 | 122 | 123 | 124 | Average time (us) 125 | 126 | 127 | 128 | 129 | Bakeoff/rust-bio: find with below 100% hit rate: mean 130 | 131 | 132 | Bootstrap distribution 133 | 134 | 135 | 136 | 137 | Bootstrap distribution 138 | 139 | 140 | 141 | 204 | 205 | Confidence interval 206 | 207 | 208 | 209 | 210 | Confidence interval 211 | 212 | 213 | 214 | 215 | 216 | 267 | 268 | 269 | 270 | Point estimate 271 | 272 | 273 | 274 | 275 | Point estimate 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | -------------------------------------------------------------------------------- /images/rust_lapper_find_bad.svg: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | Gnuplot 9 | Produced by GNUPLOT 5.2 patchlevel 6 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 0 46 | 47 | 48 | 49 | 50 | 0.5 51 | 52 | 53 | 54 | 55 | 1 56 | 57 | 58 | 59 | 60 | 1.5 61 | 62 | 63 | 64 | 65 | 2 66 | 67 | 68 | 69 | 70 | 2.5 71 | 72 | 73 | 74 | 75 | 3 76 | 77 | 78 | 79 | 80 | 61.6 81 | 82 | 83 | 84 | 85 | 61.7 86 | 87 | 88 | 89 | 90 | 61.8 91 | 92 | 93 | 94 | 95 | 61.9 96 | 97 | 98 | 99 | 100 | 62 101 | 102 | 103 | 104 | 105 | 62.1 106 | 107 | 108 | 109 | 110 | 62.2 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | Density (a.u.) 120 | 121 | 122 | 123 | 124 | Average time (us) 125 | 126 | 127 | 128 | 129 | Bakeoff/rust-lapper: find with below 100% hit rate - chromosome spanning interval: mean 130 | 131 | 132 | Bootstrap distribution 133 | 134 | 135 | 136 | 137 | Bootstrap distribution 138 | 139 | 140 | 141 | 204 | 205 | Confidence interval 206 | 207 | 208 | 209 | 210 | Confidence interval 211 | 212 | 213 | 214 | 215 | 216 | 267 | 268 | 269 | 270 | Point estimate 271 | 272 | 273 | 274 | 275 | Point estimate 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | -------------------------------------------------------------------------------- /images/rust_lapper_seek_mean.svg: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | Gnuplot 9 | Produced by GNUPLOT 5.2 patchlevel 6 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 0 46 | 47 | 48 | 49 | 50 | 10 51 | 52 | 53 | 54 | 55 | 20 56 | 57 | 58 | 59 | 60 | 30 61 | 62 | 63 | 64 | 65 | 40 66 | 67 | 68 | 69 | 70 | 50 71 | 72 | 73 | 74 | 75 | 60 76 | 77 | 78 | 79 | 80 | 70 81 | 82 | 83 | 84 | 85 | 3.485 86 | 87 | 88 | 89 | 90 | 3.49 91 | 92 | 93 | 94 | 95 | 3.495 96 | 97 | 98 | 99 | 100 | 3.5 101 | 102 | 103 | 104 | 105 | 3.505 106 | 107 | 108 | 109 | 110 | 3.51 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | Density (a.u.) 120 | 121 | 122 | 123 | 124 | Average time (us) 125 | 126 | 127 | 128 | 129 | Bakeoff/rust-lapper: seek with below 100% hit rate: mean 130 | 131 | 132 | Bootstrap distribution 133 | 134 | 135 | 136 | 137 | Bootstrap distribution 138 | 139 | 140 | 141 | 204 | 205 | Confidence interval 206 | 207 | 208 | 209 | 210 | Confidence interval 211 | 212 | 213 | 214 | 215 | 216 | 267 | 268 | 269 | 270 | Point estimate 271 | 272 | 273 | 274 | 275 | Point estimate 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | --------------------------------------------------------------------------------