Skip to content

DeepFoldProtein/patchr

Repository files navigation

 

PATCHR

Structure inpainting and simulation-ready setup for proteins, DNA, RNA, and complexes

License: MIT Python 3.11+ Open In Colab

Website | Atlas | Paper | PATCHR-Studio

Download PATCHR-Studio:   Windows · macOS (Intel) · macOS (Apple Silicon) · Linux


PATCHR-Studio : end-to-end desktop workflow — load a structure, mark gaps, inpaint, and export
1KX3 : nucleosome histone-tail inpainting 6GIS : PCNA + 50 bp DNA extension
8GZR : NS3 polymerase + RNA reconstruction 4ZLO : Kinase inpainting with ligand

Most experimental structures in the PDB have missing regions -- flexible loops, disordered terminals, unresolved sidechains. PATCHR fills them in using diffusion-based inpainting while keeping existing coordinates exactly as-is.

  • Backend-agnostic -- supports Boltz-2 and Protenix
  • Works with proteins, DNA, RNA, and multi-chain complexes
  • 99.4% connectivity pass rate, from short loops to 600+ residue extensions

Benchmark — 940 PDB40 structures with artificially introduced gaps mirroring real PDB missing-region statistics. Cα and all-atom RMSD computed over inpainted residues only.

Method / Configuration Cα RMSD (Å) All-atom RMSD (Å)
PATCHR (full, + LRD) 1.781 2.542
Boltz-2 + template conditioning 4.647 5.510
Boltz-2 + template conditioning + steering (threshold = 5.0 Å) 3.675 4.342
Boltz-2 + template conditioning + steering (threshold = 2.0 Å) 3.397 4.081
Boltz-2 + template conditioning + steering (threshold = 0.5 Å) 3.219 3.889
RFdiffusion2 (all-atom) 9.188 10.199
RFdiffusion (backbone-only) 2.043

Installation

git clone https://github.com/DeepFoldProtein/patchr.git
cd patchr && pip install -e .
Mac
conda create --name patchr python=3.12 llvmlite==0.44.0 numba==0.61.0 numpy==1.26.3
conda activate patchr
git clone https://github.com/DeepFoldProtein/patchr.git
cd patchr && pip install -e .
export KMP_DUPLICATE_LIB_OK=TRUE
Docker
./scripts/docker-run.sh                # Run with all GPUs
PATCHR_GPU=0 ./scripts/docker-run.sh   # Select GPU

Model weights are cached at ~/.boltz on the host (override with BOLTZ_CACHE).

For Slurm clusters with Apptainer:

sbatch scripts/slurm-run.sh

Quick Start

1. Generate a template from a PDB structure:

patchr template 1TON all

2. Run inpainting:

patchr predict examples/inpainting/1ton_AB.yaml --out_dir results

The first run downloads the model checkpoint automatically to ~/.boltz/.

Template options
patchr template 1CK4 all                    # All polymer chains
patchr template 4ZLO A,B --uniprot          # With UniProt sequence
patchr template --input structure.cif A,B    # From local CIF
patchr template 7EOQ all-copies             # Including duplicate copies
patchr template 1BNA all -o my_templates/   # Custom output directory
patchr template 7EOQ A --include-solvent     # Include solvent atoms
patchr template 1CK4 all --assembly best     # Biological assembly
patchr template 1CK4 all --relative-paths    # Use relative paths in YAML (default: absolute)
Prediction options
# Single file
patchr predict examples/inpainting/4zlo_ABCD.yaml --out_dir results --seed 42
patchr predict examples/inpainting/1ck4_AB.yaml --out_dir results --diffusion_samples 5
patchr predict examples/inpainting/1bna_AB.yaml --out_dir results --backend protenix
patchr predict examples/inpainting/7eoq_ABCDEFGHIJKLMN.yaml --out_dir results --use_msa_server

# Bulk prediction — pass a directory of YAML files
patchr predict my_templates/ --out_dir results
patchr predict my_templates/ --out_dir results --backend protenix --seeds 42,101

Simulation-Ready Output

Go directly from structure completion to MD simulation input:

patchr predict input.yaml --out_dir results --sim-ready gromacs
patchr predict input.yaml --out_dir results --sim-ready amber --ff amber14sb
Standalone command
patchr sim-ready prediction.cif --engine gromacs --ff charmm36m
patchr sim-ready prediction.cif --engine openmm --padding 1.2 --ion-conc 0.15

How It Works

PATCHR uses diffusion-based generation conditioned on your experimental structure as a rigid template:

Technique What it does
1 Template Conditioning Anchors known coordinates at every diffusion step
2 Synchronized Rigid Template Tracking Keeps the template aligned with the evolving generation
3 Local Refinement Denoising Cleans up bond geometry at template-generation junctions

PATCHR-Studio

A desktop app with a visual interface for the full workflow -- no command line needed. Download from the links above or the releases page.

No GPU? Run the server on Google Colab for free and connect from PATCHR-Studio.

Server

patchr serve --model boltz2 --device-id 0
patchr serve --model protenix --port 8080
patchr serve --model all

PATCHR Atlas

Pre-computed completed structures for ~35,000 monomeric proteins (growing to ~160,000 complexes). Explore the Atlas →

Performance

Beyond the headline RMSDs above, PATCHR also produces simulation-ready geometry:

Metric Value
Backbone RMSD (missing residues) 1.78 Å
lDDT (missing atoms) 98.6
Connectivity pass rate 99.4%
Impact of Local Refinement Denoising (LRD)
Metric With LRD Without LRD
Structures with no issues 99.4% 87.4%
Cα--Cα gaps (4.5--10 Å) 0.21% 4.57%
Peptide bond (C--N) issues 0.85% 15.43%
Broken chains (>10 Å) 0.32% 0.74%
Accuracy by structural context
Secondary structure RMSD (Å) Solvent accessibility RMSD (Å)
Helix 0.30 Buried 0.39
Strand 0.26 Intermediate 0.65
Loop 0.85 Surface 1.01

Future Work

Any model trained on the AlphaFold3 framework can be converted into an inpainting model through the PATCHR protocol. Currently implemented for Boltz-2 and Protenix only; extending to additional AF3-family backends is planned.

Acknowledgments

PATCHR builds upon Boltz-2 by Passaro, Corso, Wohlwend et al. and Protenix by ByteDance.

License

MIT -- free for academic and commercial use.

Cite

@article{bae2025patchr,
  author = {Bae, Hanjin and Kim, Kunwoo and Yoo, Jejoong and Joo, Keehyoung},
  title = {PATCHR-Studio: Template-conditioned diffusion-based molecular structure
           inpainting for Protein, RNA, and DNA complexes},
  year = {2025}
}

About

Structure inpainting and simulation-ready setup for proteins, DNA, RNA, and complexes

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors