How molecularinformatics/boltz2_affinity works
Boltz predicts biomolecular complex structures and, in Boltz-2, binding affinity. The principal workflow accepts YAML-described inputs, prepares molecular features, runs a model, and writes structure and prediction outputs. The README also documents optional MSA generation, Boltz-1 training, and evaluation scripts, so those capabilities appear as separate branches. Several data-preparation and CLI connections are not shown in the excerpts; those edges are marked unverified rather than presented as inspected calls.
Main entry points: boltz2.py Boltz-2 model · main.py Prediction CLI · featurizerv2.py Feature building · parse Structure parsing
Components 19
Input preparation
- YAML input
- Prediction CLI
src/boltz/main.py - Structure parsing
src/boltz/data/parse - MSA generation
src/boltz/data/msa/mmseqs2.py - Boltz-2 tokenizer
src/boltz/data/tokenize/boltz2.py - Feature building
src/boltz/data/feature/featurizerv2.py - Inference data
src/boltz/data/module/inferencev2.py
Prediction models
- Boltz-2 model
src/boltz/model/models/boltz2.py - Feature encoders
src/boltz/model/modules/encodersv2.py - Model trunk
src/boltz/model/modules/trunkv2.py - Structure diffusion
src/boltz/model/modules/diffusionv2.py - Affinity head
src/boltz/model/modules/affinity.py - Confidence head
src/boltz/model/modules/confidencev2.py - Structure potentials
src/boltz/model/potentials/potentials.py
Results
- Structure output
src/boltz/data/write/writer.py - Predictions
Training and evaluation
- Boltz-1 training
scripts/train/train.py - Evaluation scripts
scripts/eval/run_evals.py
Other components
- Researcher
Connections 20
- Researcher → YAML input: describes targets
README.md - YAML input → Prediction CLI: provides input
README.md - Prediction CLI → Structure parsing: prepares structures
- Structure parsing → Boltz-2 tokenizer: tokenizes structures
- MSA generation → Feature building: supplies alignments
- Boltz-2 tokenizer → Feature building: provides tokens
- Feature building → Inference data: provides features
- Inference data → Boltz-2 model: supplies model input
- Boltz-2 model → Feature encoders: uses encoders
src/boltz/model/models/boltz2.py - Boltz-2 model → Model trunk: uses trunk
src/boltz/model/models/boltz2.py - Boltz-2 model → Structure diffusion: uses diffusion
src/boltz/model/models/boltz2.py - Boltz-2 model → Affinity head: uses affinity head
src/boltz/model/models/boltz2.py - Boltz-2 model → Confidence head: uses confidence head
src/boltz/model/models/boltz2.py - Boltz-2 model → Structure potentials: uses potentials
- Prediction CLI → Structure output: writes predictions
- Structure output → Predictions: writes structures
src/boltz/data/write/writer.py - Boltz-2 model → Predictions: predicts affinity
README.md - Researcher → MSA generation: requests MSA
README.md - Researcher → Boltz-1 training: re-trains model
README.md - Researcher → Evaluation scripts: runs evaluations
README.md