1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! Safe, idiomatic Rust bindings for minibwa — a fast short-read, adaptive,
//! and Hi-C DNA aligner.
//!
//! # Workflow
//!
//! 1. **Build an index** once from a FASTA with [`Index::build_from_fasta`].
//! 2. **Load the index** with [`Index::load`]; the loaded index is `Send + Sync`
//! and can be shared across threads.
//! 3. **Create an [`Aligner`]** from `&Index` and `&Opts` — cheap, no allocation.
//! 4. **Create one [`ThreadBuf`] per worker thread** — holds the per-thread scratch
//! arena; it is `Send` but not `Sync`.
//! 5. **Call [`Aligner::map`] or [`Aligner::map_pair`]** to align reads and get
//! owned [`Hit`] vectors.
//!
//! # Methylation support
//!
//! Pass [`Meth::C2T`] or [`Meth::G2A`] to [`Aligner::map`] for single-read
//! bisulfite alignment, or enable [`Opts::set_methylation`] together with
//! [`Aligner::map_pair`] for paired-end bisulfite alignment.
//!
//! # Paired-end support
//!
//! Use [`Aligner::map_pair`] for paired-end alignment. Insert-size parameters
//! can be tuned with [`Opts::set_pe_insert_size`].
//!
//! # Parallelism
//!
//! Thread-level parallelism is caller-owned: create one [`ThreadBuf`] per thread
//! and call [`Aligner::map`] / [`Aligner::map_pair`] concurrently. The shared
//! [`Index`] is read-only during mapping.
//!
//! # Example
//!
//! ```no_run
//! use minibwa::{Index, Opts, Aligner, ThreadBuf, Meth};
//! 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, "read1", b"ACGT...", Meth::None)? {
//! println!(
//! "{} {}..{} {}",
//! hit.contig.as_deref().unwrap_or("*"),
//! hit.ref_start,
//! hit.ref_end,
//! hit.cigar_string(),
//! );
//! }
//! # Ok::<(), minibwa::Error>(())
//! ```
pub use ;
pub use ;
pub use ;
pub use Index;
pub use Meth;
pub use Opts;