Skip to main content

Crate balrox

Crate balrox 

Source
Expand description

balrox — pure-Rust learned bacterial gene / ORF quality scorer.

A dilated temporal convolutional network that reads a candidate ORF’s amino-acid sequence and returns P(real protein-coding gene). Architecture inspired by Balrog (Sommer & Salzberg, 2021) — a learned gene model — but this is an independent clean-room implementation with its own code and its own weights, trained from scratch on public RefSeq/GenBank bacterial CDS (positives) versus frame-shift-simulated and shadow ORFs (negatives). No Balrog source or weights are used.

Intended use inside bactars: an additive reranker over the faithful Prodigal port (rustygal). rustygal still calls ORFs; balrox provides a score to down-rank/filter borderline or spurious calls. It never replaces the gene caller.

Inference is self-contained: weights embedded at compile time, every op hand-rolled (embedding lookup, dilated conv1d + ReLU, masked global-average pool, linear head).

let m = balrox::Model::embedded();
let s = m.score(b"MSKIVKIIGREIIDSRGNPTVEAEVHLEGGFVGMAAAPSGASTGSRE");
assert!((0.0..=1.0).contains(&s));

Structs§

Model
A loaded balrox scorer.