Crates.io | basebits |
lib.rs | basebits |
version | 1.2.0 |
source | src |
created_at | 2019-08-12 17:23:02.668724 |
updated_at | 2019-11-06 22:51:04.68157 |
description | A library for encoding DNA into u64 to allow for constant time hamming distance calculations. |
homepage | |
repository | https://github.com/sstadick/basebits |
max_upload_size | |
id | 156177 |
size | 43,703 |
A library for memory efficient short DNA sequence encoding.
When to use this library? If you are comparing strings against each other more than 4 times, it becomes more efficient to pay the cost of encoding them.
Constant time hamming distance calculations.
use basebits::{BaseBits, hamming_dist};
fn main() {
let string1 = b"ACTGACTG";
let string2 = b"ACTTACTG";
let string1 = BaseBits::new(string1).unwrap();
let string2 = BaseBits::new(string2).unwrap();
assert_eq!(hamming_dist(&string1, &string2), 1);
}
See 'Constant Time Hamming Distance' section: https://www.biorxiv.org/content/10.1101/648683v1.full
FFT stuff?