Rust and Python bindings for minibwa.
minibwa-sys— low-level FFI over vendored minibwa C (compiled viabuild.rs).minibwa— safe Rust wrapper exposing structured alignmentHits.minibwa-py— Python bindings (pyo3 + maturin).
use minibwa::{Aligner, Index, Meth, Opts, ThreadBuf};
Index::build_from_fasta("ref.fa", "ref", false, 4)?;
let idx = Index::load("ref", false)?;
let opts = Opts::new();
let aligner = Aligner::new(&idx, &opts);
let mut buf = ThreadBuf::new();
for hit in aligner.map(&mut buf, b"read1", b"ACGT...", Meth::None)? {
println!("{:?} {}..{}", hit.contig, hit.ref_start, hit.ref_end);
}
# Ok::<(), minibwa::Error>(())import minibwa
# Build a BWA index from a FASTA file (one-time)
minibwa.Index.build("ref.fa", "ref")
# Load the index
idx = minibwa.Index.load("ref")
# Configure alignment options
opts = minibwa.Opts()
# Map a single read
hits = minibwa.map(idx, opts, "read1", "ACGT...")
for h in hits:
print(h)MIT. The default build uses only Apache-2.0 libsais for indexing. The GPL
bwtgen path is available behind the opt-in gpl-bwtgen feature, which changes
the effective license to GPL.
scripts/refresh-minibwa.sh <clean-commit> [local-source-path]