Protein binder design using Mosaic with Boltz-2 and Protenix models.
# Serve web UI (prints a temporary Modal URL)
uv run modal serve easymosaic.py
# Deploy permanently
uv run modal deploy easymosaic.py- VHH: Design nanobody CDRs on a fixed framework. Provide sequence with
Xmarking designable positions. - Minibinder: Design a small de novo binder. Specify length (default 80 aa).
- Boltz-2: Default. Fast and accurate.
- Protenix: Uses multisample loss. May be better for complex targets.
The marimo notebooks give full control over the design pipeline with live loss plots, structure visualization, and editable parameters. They run on a Modal GPU.
# Launch minibinder notebook on GPU
uv run modal run deploy_notebook.py::run_minibinder
# Launch VHH notebook on GPU
uv run modal run deploy_notebook.py::run_vhhThis starts a marimo notebook server on a B200 GPU and prints a public URL. The notebook workflow is:
- Load model (Protenix or Boltz-2)
- Configure target sequence and hotspots
- (VHH only) Select scaffold preset or enter custom sequence with X's
- Fold target to verify it folds correctly
- Build features & loss (triggers JIT compilation)
- Run design with live loss trajectory plot
- Rank designs — results in a sortable table with PAE plots and 3D viewer
- Download CSV
# Create a test target
echo ">target
MKTVRQERLKSIVRILERSKEPVSGAQLAEELSVSRQVIVQDIAYLRSLGYNIVATPRGYVLAGG" > /tmp/test_target.fasta
# Minibinder design (1 design)
uv run modal run easymosaic.py --target /tmp/test_target.fasta --mode minibinder --binder-length 60 --num-designs 1
# VHH design with preset
uv run modal run easymosaic.py --target /tmp/test_target.fasta --mode vhh --preset caplacizumab --num-designs 1The first design takes 20+ minutes due to JIT compilation. Subsequent designs are faster.
easymosaic.py # Main app: Flask web server + CLI entrypoint
index.html # Web UI
design.py # Shared library: configs, losses, optimization, ranking
backends/
boltz.py # Boltz-2 backend (Modal function + image)
protenix.py # Protenix backend (Modal function + image + precycling)
minibinder_notebook.py # Interactive marimo notebook for de novo binder design
vhh_notebook.py # Interactive marimo notebook for VHH CDR design
deploy_notebook.py # Deploys notebooks on Modal GPU (B200)
Each design includes:
- Sequence
- ipTM score (interface predicted TM-score, higher is better)
- Ranking score (ipTM + IPSAE combined)
- Structure (CIF and PDB formats)
