Skip to content

hgbrian/easymosaic

Repository files navigation

easymosaic

Protein binder design using Mosaic with Boltz-2 and Protenix models.

easymosaic screenshot

Quick Start

# Serve web UI (prints a temporary Modal URL)
uv run modal serve easymosaic.py

# Deploy permanently
uv run modal deploy easymosaic.py

Design Modes

  • VHH: Design nanobody CDRs on a fixed framework. Provide sequence with X marking designable positions.
  • Minibinder: Design a small de novo binder. Specify length (default 80 aa).

Models

  • Boltz-2: Default. Fast and accurate.
  • Protenix: Uses multisample loss. May be better for complex targets.

Interactive Notebooks

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_vhh

This starts a marimo notebook server on a B200 GPU and prints a public URL. The notebook workflow is:

  1. Load model (Protenix or Boltz-2)
  2. Configure target sequence and hotspots
  3. (VHH only) Select scaffold preset or enter custom sequence with X's
  4. Fold target to verify it folds correctly
  5. Build features & loss (triggers JIT compilation)
  6. Run design with live loss trajectory plot
  7. Rank designs — results in a sortable table with PAE plots and 3D viewer
  8. Download CSV

CLI Usage

# 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 1

The first design takes 20+ minutes due to JIT compilation. Subsequent designs are faster.

Project Structure

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)

Output

Each design includes:

  • Sequence
  • ipTM score (interface predicted TM-score, higher is better)
  • Ranking score (ipTM + IPSAE combined)
  • Structure (CIF and PDB formats)

About

mosaic webapp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors