Expand description
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.
use ligase::check::{Binding, check_step};
use ligase::load::{self, Declared};
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}");
}Modules§
- audit
- Running a step twice, and saying whether it is reproducible.
- cache
- The cache: what has been computed, and what it produced.
- canon
- Canonical forms: what a file means, as against which bytes it holds.
- check
- Dimension checking: refusing to connect steps whose dimensions disagree.
- convert
- The registered ways across a dimension.
- dim
- The dimensions a biological type carries, and where each value came from.
- exec
- Running a checked graph, once.
- graph
- The dependency graph: what feeds what, checked all at once.
- hash
- Content hashing.
- hivdb
- Interpreting variants as drug resistance.
- inspect
- Describing one dataset in words, for a surface that only looks.
- key
- What a step’s cache key is made of.
- load
- Loading data and inferring its dimensions from file headers.
- note
- What a result rests on and a hash cannot say.
- prov
- Provenance: how each result was produced, kept for longer than the cache.
- remote
- Remote inputs: the fetch that starts every pipeline, brought inside the engine’s guarantees.
- store
- The blob tier: objects named by the hash of their contents.
- types
- Biological data types, and which dimensions each one can speak to.
- worker
- Who a worker is, and the one cache directory it is allowed to have.
Functions§
- version
- The version of the core engine, as compiled.