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.
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.
GRCh37≠GRCh38My variant positions are all slightly wrongReads aligned to one build, variants called against another. Coordinates shift by thousands of bases and every annotation lands on the wrong gene.
chr1≠1My BED file intersects nothingThe same genome under two naming conventions. Tools match contigs by name, find no overlap, and report zero rather than an error.
[a, b]≠[b, a]My sample labels look swappedA join that reordered a cohort. Every genotype is attributed to the wrong person, and nothing in the output says so.
0-based≠1-basedMy intervals are off by oneBED half-open intervals handed to a tool expecting GFF’s closed ones. Every feature boundary moves by a base.
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 bundleA 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.
align (sample SRR8525904)3.3salign (sample SRR8525908)6.9salign (sample SRR8525920)3.7salign (sample SRR8525942)6.0scall for SRR8525904, SRR8525908, SRR8525920, SRR8525942resistance for SRR8525904, SRR8525908, SRR8525920, SRR8525942“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.
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 to | Go to |
|---|---|
| Run something in five minutes, with no aligner | Quickstart |
| Install it properly | Installation |
| Know why a step did not rerun, or what a flag does | Command line |
| Understand the idea before the API | Types and dimensions |
| Work out what an error means | Errors |
| Write a real pipeline | Building a pipeline |
| Read how it works inside | Architecture |
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.