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
69
//! Core engine for Ligase: biological types, dimension checking, graph,
//! cache, execution and provenance.
//!
//! This crate holds the correctness-critical logic. It knows nothing about
//! Python; the bindings live in the `ligase-py` crate.
//!
//! # The idea
//!
//! Biological data carries *dimensions* — organism, reference build,
//! coordinate system, sample set — and the engine refuses to connect steps
//! whose dimensions disagree, the way a physics engine refuses to add metres
//! to seconds.
//!
//! ```no_run
//! use ligase::check::{Binding, check_step};
//! use ligase::load::{self, Declared};
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let hxb2 = load::reference(
//! "refs/HXB2.fasta".as_ref(),
//! &Declared {
//! organism: Some(vec!["HIV-1".into()]),
//! build: Some("HXB2".into()),
//! ..Declared::default()
//! },
//! )?;
//! let aligned = load::alignment("out/sample.bam".as_ref(), &Declared::default())?;
//!
//! for error in check_step(
//! "call",
//! &[
//! Binding { name: "aln".into(), dataset: aligned },
//! Binding { name: "ref".into(), dataset: hxb2 },
//! ],
//! ) {
//! eprintln!("{error}");
//! }
//! # Ok(())
//! # }
//! ```
/// The version of the core engine, as compiled.
///
/// This is the single source of truth for the version reported by the
/// Python package, so a wheel can never report a version it was not
/// built from.