Skip to content

pairwise-alignment/rust-wfa2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"
);

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%