syncmers

Crates.iosyncmers
lib.rssyncmers
version0.1.5
sourcesrc
created_at2022-10-17 00:08:10.98854
updated_at2022-12-19 21:21:49.09956
descriptionRust library for finding syncmers
homepage
repositoryhttps://github.com/jguhlin/syncmers
max_upload_size
id689701
size25,138
Joseph Guhlin (jguhlin)

documentation

README

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], None, sequence);
assert!(syncmers == vec![b"CCAGT", b"TTACG"]);
println!("{:?}", syncmers);

Extract Syncmers from &[u8], downsampling to 20%

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

Extract Syncmers from &[u8], keeping 80%

let sequence = b"CCAGTGTTTACGG";
let syncmers = find_syncmers(5, 2, &[2], Some(0.8), 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], None, sequence);
println!("{:?}", syncmer_positions);
assert!(syncmer_positions == vec![0, 7]);

Changelog

0.1.4: Added downsampling support

Commit count: 19

cargo fmt