Crates.io | simd-minimizers |
lib.rs | simd-minimizers |
version | |
source | src |
created_at | 2025-01-29 00:22:59.829745+00 |
updated_at | 2025-05-14 14:37:46.156033+00 |
description | A SIMD-accelerated library to compute random minimizers |
homepage | |
repository | https://github.com/rust-seq/simd-minimizers |
max_upload_size | |
id | 1534217 |
Cargo.toml error: | TOML parse error at line 21, column 1 | 21 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
A SIMD-accelerated library to compute random minimizers.
It can compute all the minimizers of a human genome in 4 seconds using a single thread. It also provides a canonical version that ensures that a sequence and its reverse-complement always select the same positions, which takes 6 seconds on a human genome.
The underlying algorithm is described in the following preprint:
SimdMinimizers: Computing random minimizers, fast. Ragnar Groot Koerkamp, Igor Martayan bioRxiv 2025.01.27 doi.org/10.1101/2025.01.27.634998
This library supports AVX2 and NEON instruction sets.
Make sure to set RUSTFLAGS="-C target-cpu=native"
when compiling to use the instruction sets available on your architecture.
RUSTFLAGS="-C target-cpu=native" cargo run --release
Full documentation can be found on docs.rs.
// Packed SIMD version.
use packed_seq::{complement_char, PackedSeqVec, SeqVec};
let seq = b"ACGTGCTCAGAGACTCAG";
let k = 5;
let w = 7;
let packed_seq = PackedSeqVec::from_ascii(seq);
let mut minimizer_positions = Vec::new();
simd_minimizers::canonical_minimizer_positions(packed_seq.as_slice(), k, w, &mut minimizer_positions);
assert_eq!(minimizer_positions, vec![3, 5, 12]);