SeqTrainer is a synthetic biology ML domain toolkit focused on connecting SBOL / SynBioHub data to modern model workflows.
It is designed to be complementary to Keras and PyTorch rather than replacing them.
- Clear package layering under
seqtrainer/ - Framework-neutral core (
clients,sparql,data,transforms,models) - Optional framework adapters (
seqtrainer.keras,seqtrainer.torch) - Graph-focused utilities in
seqtrainer.graph - Application-level API entrypoints in
seqtrainer.applications - CLI foundation (
seqtrainercommand) - Lightweight KNN retrieval utilities for scalar-label sequence design workflows
pip install -e .For a reproducible development environment, use uv:
uv sync --extra torch --extra dev
uv run pytest -quv uses the repository's Python 3.12 pin, creates a local .venv, and records
resolved dependencies in uv.lock. The torch extra pins NumPy below 2 to
remain compatible with the supported PyTorch runtime.
Run the deterministic synthetic Titans Stage A acceptance benchmark (it is not a DNA or biology-performance benchmark):
uv run seqtrainer-titans-stage-a-benchmark --output-dir artifacts/titans_stage_aIt writes JSON results, a Markdown report, and an SVG delayed-recall plot.
Optional extras:
pip install -e '.[torch]'
pip install -e '.[keras]'
pip install -e '.[gnn]'
pip install -e '.[dev]'seqtrainer/clients: SynBioHub and remote clientsseqtrainer/sparql: prefixes, builders, and query recipesseqtrainer/data: SBOL loaders, recipes, materialized datasetsseqtrainer/transforms: DNA transforms and feature extractionseqtrainer/models: framework-neutral backbone/head registry stubs and KNN retrieval helpersseqtrainer/keras: Keras adapters/factories (optional dependency)seqtrainer/torch: PyTorch adapters/fine-tune helpers (optional dependency)seqtrainer/torch/titans_mac: importable Titan MAC causal LM and analysis APIsseqtrainer/data/bacteria_titan: reproducible genome-level bacterial datasetsseqtrainer/graph: RDF/SBOL graph conversion utilitiesseqtrainer/applications: task-oriented blueprintsseqtrainer/cli: command-line entrypoints
seqtrainer sparql prefixes
seqtrainer inspect-sbol data/sbol_data/sample_design_0.xml
seqtrainer build-dataset data/sbol_data/sample_design_0.xmlThis is the first architecture-focused cleanup. Some framework integrations are intentionally placeholders with TODOs to keep a stable, minimal public surface.
The bacterial Titan MAC workflow is documented in docs/bacteria_titan.md.
A starter notebook series is available in notebooks/tutorials/:
00_quickstart.ipynb: core API objects and basic transforms01_sbol_to_dataset.ipynb: extract sequences/targets from SBOL files02_dna_features.ipynb: one-hot, GC content, and k-mer features03_dataset_splits.ipynb: reproducible train/val/test splits04_end_to_end_cnn_classification.ipynb: end-to-end mini CNN classifier demo (10 cycles)05_end_to_end_cnn_regression.ipynb: end-to-end mini CNN regressor for promoter activity (10 cycles)06_nucleotide_transformer_v2_promoter_tasks.ipynb: SeqTrainer-based Nucleotide Transformer v2 fine-tuning for promoter classification and regression07_hyena2_promoter_classification_regression.ipynb: SeqTrainer-based Hyena2/HyenaDNA workflow for promoter classification and regression08_evo2_promoter_classification_regression.ipynb: SeqTrainer-based Evo 2 workflow for promoter classification and regression09_gemma3_4b_promoter_classification_regression.ipynb: SeqTrainer-based Gemma 3 4B workflow for promoter classification and regression10_promoter_activity_knn_retrieval.ipynb: KNN retrieval workflow that returns ranked DNA sequences closest to a requested promoter activity11_titans_miras_memory_context_promoter_classification.ipynb: simplified Titans/MIRAS Memory-as-Context promoter classification workflow