jdidion / syncmers

Library for finding syncmers from &[u8] in rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Syncmers Library in Rust

Syncmers as defined by Dutta et al. 2022, https://www.biorxiv.org/content/10.1101/2022.01.10.475696v2.full Esp Fig 1b / Algorithm 1. Planning to implement other methods soon

Definition

Using the parameterized syncmer scheme, a syncmer is a kmer whose smallest smer is at a given target position (t).

Extract Syncmers from &[u8]

let sequence = b"CCAGTGTTTACGG";
let syncmers = find_syncmers(5, 2, &[2], sequence);
assert!(syncmers == vec![b"CCAGT", b"TTACG"]);
println!("{:?}", syncmers);

Find positions of Syncmers

let sequence = b"CCAGTGTTTACGG";
let syncmer_positions = find_syncmers_pos(5, 2, &[2], sequence);
println!("{:?}", syncmer_positions);
assert!(syncmer_positions == vec![0, 7]);

About

Library for finding syncmers from &[u8] in rust

License:MIT License


Languages

Language:Rust 100.0%