Skip to Content
VOL. 02 — THE ENGINE◉ WESTLANDS, NAIROBIMMXXVI

v0.1.0 · pre-alpha · Rust core, Python surface

The worst bugs in computational biology do not crash.

hg19 against hg38. chr1 against 1. Sample IDs that shifted by one somewhere in a join. None of these fail — they produce plausible numbers that are wrong, and you find out in review, or never.

Ligase gives biological data dimensions, the way physics gives quantities units, and refuses to connect two steps whose dimensions disagree. It checks before it computes.

What that looks like

A pipeline that would have run overnight, refused in milliseconds

Two files describing the same two contigs, at the same lengths, with every base agreeing. One calls them chr1-style and the other bare. Nothing crashes, downstream tools match contigs by name, and the numbers come out wrong.

ContigNamingErrorin stepcallligase check — nothing ran
ref.contig_naming=bare (Ensembl/NCBI style)from FASTA deflines: crates/ligase-core/tests/fixtures/tiny_bare.fasta
aln.contig_naming=chr-prefixed (UCSC style)from SAM @SQ header: crates/ligase-core/tests/fixtures/tiny_prefixed.sam
The contigs are otherwise identical. Add a renaming step, or use one naming style throughout.

It names where each value came from, so you can go and look rather than guess. It says the contigs are otherwise identical, which tells you this is a naming problem and not the wrong genome. And its type is ContigNamingError, not a string — so a caller can branch on a naming mismatch without parsing English.

The failures it exists to catch

Four ways a pipeline lies to you

Each of these is a documented hazard in the field. Each page states the bug, then shows the error Ligase actually produces for it.

How it works

Check, run, then say how it was produced

pipe.check() # type-checks dimensions; no compute pipe.run() # parallel, cached, per-sample fan-out pipe.methods() # generated methods paragraph + reproducibility bundle

A step’s cache key is built from its code, its parameters, its inputs’ contents and its tools’ versions. Run a pipeline twice and nothing is recomputed. Change a thread count and the aligner reruns — a thread count is a parameter, and nothing can know in advance that it will not change an answer — but the alignments come out the same, so nothing below them is.

ligase run
ranalign (sample SRR8525904)3.3s
ranalign (sample SRR8525908)6.9s
ranalign (sample SRR8525920)3.7s
ranalign (sample SRR8525942)6.0s
skippedcall for SRR8525904, SRR8525908, SRR8525920, SRR8525942
skippedresistance for SRR8525904, SRR8525908, SRR8525920, SRR8525942
 
12 steps: 4 ran, 8 skipped.

“The same” is not byte equality — minimap2 writes -t 8 and the output path into the BAM’s @PG line — but what the file means: its records sorted, and the fields recording when and how it was made dropped.

Does it work

Checked against published results, not against itself

The reference pipeline takes HIV-1 reads to drug-resistance calls. Its calls were compared against the Stanford HIVdb results published by the HIVGenoPipe study.

81 / 81
Drug calls agreeing at a 15% threshold
tests/test_validation.py
81 / 81
Drug calls agreeing at a 5% threshold
tests/test_validation.py
3,348
Scoring expectations reproduced exactly
Sierra 3.5.3, HIVDB 9.8
3
Calls differing at 2%, each with a recorded cause
project/validation

The scoring engine is checked against Stanford’s own answers rather than against expectations derived from the same rules it reads, because that would test the parser against itself. Three calls differ at the 2% threshold, where there were nine: six were codons read from a VCF, which carries no phasing, and went when codons started being read from the haplotypes the reads carry. What was compared, and what did not agree.

Where to start

Three ways in

If you want toGo to
Run something in five minutes, with no alignerQuickstart
Install it properlyInstallation
Know why a step did not rerun, or what a flag doesCommand line
Understand the idea before the APITypes and dimensions
Work out what an error meansErrors
Write a real pipelineBuilding a pipeline
Read how it works insideArchitecture

Where it stands

Published, and not yet used by anyone but its author

v0.1.0 is on crates.io  as ligase and on PyPI  as ligase-bio. All six v0.1 milestones are done. It is pre-alpha: the API will change, and there are no outside users yet.

SAWA, a sibling project, is evaluating it for HIV drug-resistance surveillance. That evaluation turned up a silent coordinate hazard in pol numbering — written up rather than buried, and since fixed: a reference now carries the frame its positions are numbered along, and one in the wrong frame is refused before any compute. SAWA’s agreement figures are theirs to publish, not this project’s.

Last updated on