libwfa2 0.1.1

Bindings to the C implementation of WFA2-lib
Documentation
  • Coverage
  • 0.19%
    1 out of 524 items documented0 out of 60 items with examples
  • Size
  • Source code size: 9.83 MB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 7.09 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2m 47s Average build duration of successful builds.
  • all releases: 2m 47s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • 4less/libwfa2
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • 4less

libwfa2

Rust bindings for the wavefront algorithm (WFA2-lib, https://github.com/smarco/WFA2-lib). This is inspired by the rust crate libwfa (crate, github).

Example

Basic usage of the library.

use libwfa2::affine_wavefront::AffineWavefronts;

pub fn main() {
    let aligner = AffineWavefronts::default();

    // pattern means query
    let pattern = b"TCTTTACTCGCGCGTTGGAGAAATACAATAGT";

    // Text means reference
    let text = b"TCTATACTGCGCGTTTGGAGAAATAAAATAGT";

    aligner.align(pattern, text);

    println!("Pattern: {}", String::from_utf8_lossy(pattern));
    println!("Text:    {}\n", String::from_utf8_lossy(text));

    println!("Score: {}", aligner.score());
    println!("Cigar: {}", String::from_utf8_lossy(aligner.cigar()));
}

Setting heuristics

use libwfa2::affine_wavefront::{AffineWavefronts, HeuristicStrategy};

pub fn main() {
    println!("Example2\n");

    let mut aligner = AffineWavefronts::default();

    aligner.set_heuristic(&HeuristicStrategy::BandedStatic { band_min_k: -1, band_max_k: 1 });

    // pattern means query
    let pattern = b"TCTTTACTCGCGCGTTGGAGAAATACAATAGT";

    // Text means reference
    let text = b"TCTATACTGCGCGTTTGGAGAAATAAAATAGT";

    let _status = aligner.align(pattern, text);

    println!("Pattern: {}", String::from_utf8_lossy(pattern));
    println!("Text:    {}\n", String::from_utf8_lossy(text));

    println!("Score: {}", aligner.score());
    println!("Cigar: {}", String::from_utf8_lossy(aligner.cigar()));
}