Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 924 Bytes

README.md

File metadata and controls

29 lines (24 loc) · 924 Bytes

Rust bindings for WFA2-Lib

Rust language bindgings for the excellent WFA2-Lib library.

Work in progress. Tests and features are not yet complete.

Autovectorization

Remember to specify the correct C compiler! For me it is CC=/usr/local/opt/llvm/bin/clang.

Usage

let mut aligner = aligner_gap_affine();
let pattern = b"TCTTTACTCGCGCGTTGGAGAAATACAATAGT";
let text = b"TCTATACTGCGCGTTTGGAGAAATAAAATAGT";
let status = aligner.align_end_to_end(pattern, text);
assert_eq!(status, AlignmentStatus::StatusSuccessful);
assert_eq!(aligner.alignment_score(), -24);
assert_eq!(
    aligner.alignment_cigar(),
    "MMMXMMMMDMMMMMMMIMMMMMMMMMXMMMMMM"
);
let (a, b, c) = aligner.alignment_matching(pattern, text);
assert_eq!(
    format!("{}\n{}\n{}", a, b, c),
    "TCTTTACTCGCGCGTT-GGAGAAATACAATAGT\n|||||||| ||||||| ||||||||||||||||\nTCTATACT-GCGCGTTTGGAGAAATAAAATAGT"
);