lotrs 0.1.1

Pure-Rust bacterial subcellular localization predictor: a compact CNN (architecture inspired by DeepLoc) with independently-trained weights on UniProt/SwissProt (CC-BY). Predicts cytoplasm / inner-membrane / periplasm / outer-membrane / extracellular / cell-wall. Database-free, self-contained inference.
Documentation

lotrs

Pure-Rust bacterial subcellular localization predictor. A compact convolutional network reads a full protein sequence and predicts its compartment — cytoplasm, inner-membrane, periplasm, outer-membrane, extracellular, or cell-wall. Self-contained, database-free, no ML runtime, no Python at inference time.

let m = lotrs::Model::embedded();
let p = m.predict(b"MSKIVKIIGREIIDSRGNPTVEAEVHLEGGFVGMAAAPSGASTGSRE");
println!("{} ({:.2})", p.label, p.prob);   // e.g. "cytoplasm (1.00)"

CLI:

lotrs proteins.faa
#id       localization   prob
sp|P0A910 outer_membrane 0.991

Model & provenance

A sequence CNN: one-hot(20) → 4 × [Conv1d(k=7, same-pad) → ReLU] → global average-pool ‖ max-pool → Linear(2C, 6) → softmax. Architecture inspired by DeepLoc (Almagro Armenteros et al. 2017), but this is an independent clean-room implementation with its own code and its own weights, trained from scratch on public UniProt/SwissProt (reviewed bacterial entries with experimental localization, CC-BY 4.0). No DeepLoc source code or trained weights were used.

Held-out per-class F1 (organism-disjoint): cytoplasm 0.99, inner-membrane 0.97, periplasm 0.82, outer-membrane 0.81, extracellular 0.69 (macro-F1 0.71; well-populated classes are strongest). Weights are embedded in the crate (weights.json); inference is pure-Rust and was verified to match the reference PyTorch model to 6 decimal places.

Changelog

0.1.1

  • Performance: rewrote the conv1d kernel (branch-free contiguous AXPY inner loop + flattened weight layout). ~4× faster single-thread; bit-identical output (same floating-point accumulation order — verified byte-for-byte on a full proteome).

0.1.0

  • Initial release: distilled/trained pure-Rust model, gzip-embedded weights, PyTorch-parity verified.

License

MIT OR Apache-2.0. Training data derived from UniProt (CC-BY 4.0).