Overview
Experimental protein structures are rarely complete. Flexible loops, disordered termini, and entire flexible domains frequently fail to resolve in X-ray crystallography or cryo-EM, so a deposited structure often carries holes: residues listed in the deposit's sequence but absent from its coordinates. An analysis accompanying the PATCHR inpainting method found that only about 18% of entries in the PDB40 benchmark set are fully resolved.[1] Every computational method that follows, from protonation to docking to molecular dynamics, inherits those holes.
The consequences are not cosmetic. A missing loop bordering a binding site creates an artificial opening in the receptor surface, letting docking place ligands in geometrically impossible poses. A chain break breaks the covalent topology, so a molecular dynamics simulation cannot build a force field topology across the gap at all. Missing side chains and termini distort the electrostatics of the binding site. Simply ignoring the problem is the most expensive option available.
Autochem's protein modeling protocol addresses this at the source. Given a partial structure, identified by PDB ID, UniProt accession, gene symbol, or uploaded directly, the pipeline first finds every gap, reporting each missing region per protein and per chain with its length, position, and the evidence behind it. The user selects which regions to rebuild. The pipeline then rebuilds the selected regions with their native amino acid sequences, using the rest of the structure as a fixed template for a diffusion-based generative model: either Boltz-2[2] running as a structure prediction on the hosted Boltz service, or PATCHR[1] running template-constrained diffusion on our own GPU with the Boltz-2[2] or Protenix[4] model as its backend. Finally, each rebuilt region is grafted into the original structure by superposition on the residues that flank it, and the junctions are relaxed with a short restrained molecular dynamics run.
One principle governs the whole protocol: every atom the original structure already has keeps its coordinates. Experimental evidence is never overwritten by a model. The generative model is trusted only locally, inside the gaps it was asked to fill, and the quality of each fill is measured and reported before the structure is used downstream.
Scientific Background
Why structures are incomplete
Crystallographers can only build coordinates for parts of the molecule that are ordered in the crystal. Flexible surface loops, terminal extensions, and mobile domains diffract incoherently and appear as gaps between resolved segments; the deposit's REMARK 465 records list exactly which residues were observed and which were not. Cryo-EM has the same problem in the most flexible regions of the particle. The result is a structure whose sequence (SEQRES) is complete but whose coordinates are not, with internal gaps of a few residues to a few dozen, missing termini, and occasionally entire chains without coordinates. Uploads from internal programs, homology models, and truncated constructs add further cases, often with no header information at all.
Why classical loop modeling is not enough
The traditional fixes sit at two extremes. Template-based loop modeling with tools like PDBFixer places missing residues geometrically from a library of loop conformations, without any physical model of the sequence or its surroundings: past a handful of residues the loop's geometry is invented, not modeled. At the other extreme, replacing the structure with a fresh AlphaFold[8] prediction from sequence discards all the experimental information, and per-residue confidence (pLDDT) in the replaced regions is exactly where prediction is weakest. Neither option preserves the experimental structure while filling its holes.
Structure inpainting with diffusion models
AlphaFold 3-class generative models[5] build structures by diffusion: starting from noise, a neural network iteratively denoises atomic coordinates toward a physically plausible structure, conditioned on the sequence and its interactions. Inpainting turns this generative process into a repair tool: the observed residues are held fixed while the model generates only the missing ones. RFdiffusion[6] established this strategy for backbone design; the AF3-class models extend it to all-atom structure with ligands and nucleic acids.
The protocol uses two engines that share this principle:
- Boltz-2[2] is an open biomolecular co-folding model from MIT and Recursion that generates all-atom structures of proteins, nucleic acids, and small molecules, and additionally predicts binding affinity. On the hosted Boltz service, the rebuild runs as a structure prediction with the partial structure as a forced template, one chain per prediction.
- PATCHR[1] wraps Boltz-2 or Protenix in a template-constrained diffusion loop designed specifically for structure repair. At every denoising step, the observed atoms are clamped to their deposited coordinates, and the model generates only the gaps. A local refinement stage then re-denoises a window at each template/gap junction to restore correct covalent geometry where the model meets the experiment.
Protenix[4], the alternative PATCHR backend, is an open reproduction of the AlphaFold 3 architecture from ByteDance that achieves state-of-the-art accuracy on PoseBusters V2, low-homology PDB, and CASP15 RNA benchmarks.
Why predict locally and graft
A subtle but critical design decision: the pipeline never adopts a whole predicted structure, even when the partial structure was used as its template. The template force in structure prediction is soft guidance, so residues the original already had can drift, and predicting a large assembly at once can collapse it (chains stacked on top of each other, broken peptide bonds). The protocol therefore trusts a prediction only inside the regions it was asked to rebuild: each region is superposed onto the original by the backbone of its flanking residues and inserted, and everything outside the gaps is the original experimental structure, atom for atom. Regions are independent, so each one takes the best of the sampled predictions for itself.
Pipeline Overview
The protein modeling workflow consists of eight stages:
- Target acquisition and validation: identifier validation, metadata and structure download, or upload handling
- Missing-residue detection: three independent evidence sources, gap report, and recommendation
- Region selection: interactive picker over the detected gaps, with sequence coverage visualization
- Rebuild planning: mapping each selected gap onto the structure's sequence, one prediction plan per chain
- Structure generation: Boltz-2 on the hosted Boltz service, or PATCHR on our GPU (Boltz-2 or Protenix backend)
- Grafting: superposition of each rebuilt region onto its flanks, insertion into the original
- Relaxation: short restrained MD of the rebuilt regions and their surroundings
- Quality control and reporting: per-region fit metrics, clash scan, warnings, and the rebuilt structure for download
Stage 1: Target Acquisition and Validation
The input identifier (PDB ID, UniProt accession, UniProt entry name, or gene symbol) is validated against RCSB PDB, UniProt[10], and HGNC in priority order, establishing a canonical identifier type before anything is downloaded. Protein metadata is then fetched from UniProt, and the structure is downloaded from RCSB PDB (experimental structures, mmCIF and PDB formats) or from the AlphaFold Protein Structure Database[7] for targets with only a predicted model. A user may also upload a structure file directly (PDB, mmCIF), in which case nothing is downloaded and the upload is checked from Stage 2 onward.
Because the rebuild is defined on the structure's own sequence, the pipeline works from the mmCIF where the sequence (the _entity_poly_seq slots) and the observed coordinates are both recorded. The project pH is set to 7.4, consistent with the rest of Autochem's preparation chemistry.
Stage 2: Missing-Residue Detection
The structure is checked for missing residues before any preparation step. The detector is deliberately implemented from primary evidence rather than a single library call, and it reads three independent sources, strongest first:
| Evidence | What it reads | What it gives |
|---|---|---|
| REMARK 465 | The depositors' list of residues in SEQRES with no coordinates | Every missing residue, exactly, in author numbering |
| Chain breaks | Peptide C(i) to N(i+1) distance above 2.0 Å between consecutive observed residues | Works on files with no header (uploads); gap length estimated from the numbering jump |
| SEQRES count | SEQRES length versus number of observed residues | A count only, used when neither source above explains the difference |
For reference, a peptide C to N bond is 1.33 Å; consecutive backbone atoms farther apart than 2.0 Å are not bonded, which is the operational definition of a chain break. Each detected segment is classified by position: N_TERMINAL, INTERNAL, or C_TERMINAL (with whole-chain and unlocatable cases reported separately), and each gap's missing sequence is recovered where the evidence provides it.
The check produces a gap report listing every molecule, every chain, and every gap, plus an overall recommendation:
| Recommendation | Meaning |
|---|---|
| STANDARD | No internal residues missing (unresolved termini are fine); prepare as usual |
| MODEL_SHORT_LOOPS | Internal gaps, all short (5 residues or fewer by default); rebuild with this protocol |
| ALTERNATIVE_STRUCTURE | A longer internal gap, or a chain without coordinates; a different PDB entry or an AlphaFold model is the better starting point |
| UNKNOWN | The structure could not be checked |
Alongside the text report, a sequence coverage view aligns every chain against its complete UniProt sequence: which residues are observed, which are missing, which parts of the full protein are not in the construct at all, and where tags, linkers, fusion partners, and sequence variants sit. The gaps are also drawn on the 3D structure between their flanking residues, so the user can see immediately whether a gap touches the binding site.
Stage 3: Region Selection
Every gap from the check is offered as a row in an interactive picker: structure, chain, residue range, length, position, and missing sequence. Internal gaps start selected, because an internal hole always breaks the chain; terminal gaps start unselected, because unresolved termini are usually disordered and often best left out. Gaps the evidence could not locate (a SEQRES count mismatch without positions) are shown but cannot be selected. The selection is constrained to a single structure per rebuild, and the user can override every default.
If the picker reports that the structure has no missing regions, the workflow ends here with nothing to rebuild.
Stage 4: Rebuild Planning
The rebuild plan maps each selected gap onto the structure's own sequence. Unobserved residues still occupy slots in the mmCIF _entity_poly_seq, so each gap resolves to a contiguous run of slots between the observed residues that flank it, and the plan verifies the slot count matches the gap length exactly. The native sequence of the gap is read from those slots: the rebuild models the residues the structure's own sequence calls for, including modified residues modeled as their parent (selenomethionine as methionine). Only protein chains can be rebuilt, and a residue with no one-letter code in a chain with a selected region stops the plan with a precise error.
Each chain with a selected region becomes one prediction, modeled from its first to its last kept residue, gaps included. Two consequences follow, both deliberate:
- Every internal gap of a selected chain is rebuilt too, selected or not, so no chain is left with a hole between its kept termini. Unselected terminal gaps are left out of the model entirely.
- Identical copies of a homo-oligomer share one prediction (the same sequence and numbering), and each copy grafts the regions onto its own coordinates.
A design variant exists for the opposite question: instead of modeling the native sequence into the gap, the generative model designs a new sequence for each gap while the rest of the structure stays fixed. This runs on the Boltz service as a protein design job and produces a batch of candidate sequences; it is never used silently, because the rebuilt regions then do not carry the protein's own residues.
Stage 5: Structure Generation
Both engines consume the same rebuild plan; the user chooses which one runs. The number of sampled structures per chain is 1 to 10 (default 5): diffusion sampling is stochastic, so several samples are drawn and each region later keeps the one that fits the original best.
5a. Hosted Boltz service (Boltz-2)
The rebuild runs on the hosted Boltz service as a structure prediction with the partial structure as its forced template, one chain per prediction, using the Boltz-2[2] model. The Boltz family of co-folding models generates all-atom structures of proteins, nucleic acids, and their complexes, and Boltz-2 extended this with binding affinity prediction approaching the accuracy of alchemical free energy methods at a fraction of the cost.[3] This path is the faster one and runs on the provider's hardware.
5b. PATCHR on our GPU (Boltz-2 or Protenix backend)
The alternative runs PATCHR[1] on our own GPU hardware. PATCHR adds two inference-time mechanisms to a pretrained AF3-class backbone, with no retraining:
- Template-constrained diffusion. At every denoising step, the observed atoms are injected at their deposited coordinates through a binary mask, with weighted rigid realignment keeping the template and the generated frame synchronized. This is stronger than embedding-based template conditioning: the observed coordinates are held, not merely suggested.
- Local refinement diffusion. A boundary window at each junction between template and generated region is re-denoised, restoring covalent geometry where the fill meets the experiment. In PATCHR's ablation this raised the fraction of junctions with no geometry issues from 87.4% to 99.4%.[1]
The backend model is Boltz-2 (default) or Protenix,[4] and it is selected per run. Unlike the per-chain predictions of the service path, PATCHR predicts the chains with selected regions together, as many as fit in GPU memory, so each gap is modeled in the presence of its neighboring chains rather than in isolation. Sampling is deterministic for a given template (fixed seed), so the same rebuild reproduces the same fills.
| Property | Hosted Boltz service | PATCHR on our GPU |
|---|---|---|
| Model | Boltz-2 | Boltz-2 (default) or Protenix |
| Granularity | One prediction per chain, chains independently | Chains with selected regions predicted together (up to GPU memory) |
| Constraint mechanism | Structure as forced template (soft guidance) | Observed atoms clamped at every denoising step |
| Samples per run | 1 to 10 (default 5) | 1 to 10 (default 5), deterministic seed |
| Determinism | Sampled | Same template, same fills |
Stage 6: Grafting
Each rebuilt region is placed into the original structure by rigid superposition on the backbone (N, CA, C, O) of the observed residues that flank it: 4 anchor residues per side for an internal gap, 8 on the single side of a terminal gap. Residues are matched by author number and chain, so the graft lands exactly where the gap was.
A candidate sample is used for a region only if its backbone is unbroken from the anchors on one side to the anchors on the other: a region that is not bonded to its own flanks in the prediction cannot be bonded to them in the original. Regions are independent, and each takes its own best sample, measured by the fit. After the graft, every residue the original structure already had keeps its exact coordinates; the one residue on each side of a region is allowed to move in the subsequent relaxation.
Stage 7: Relaxation of the Rebuilt Regions
A graft joins each region to its flanks with a fitted, not covalently equilibrated, geometry: junction C to N distances of 1 to 2.5 Å and occasional close contacts. The relaxation resolves exactly this, and only this. Each rebuilt region plus one flanking residue on each side moves; everything else is held fixed. The simulation includes every amino acid within 12 Å of a moving residue (padded by two residues along each chain so no fragment dangles), with ligands, lipids, waters, ions, and non-standard residues entering as frozen, uncharged obstacles, so loops relax around them rather than into them.
The system is simulated with OpenMM[9] using the amber14 force field and OBC2 implicit solvent, after energy minimization (up to 5,000 steps):
| Parameter | Value | Description |
|---|---|---|
| Moving atoms | region + 1 flank/side | Everything else frozen |
| Inclusion shell | 12 Å | Every residue within 12 Å of a moving residue, padded 2 residues along chain |
| Force field | amber14 | Protein parameters |
| Solvent | OBC2 implicit | Generalized Born electrostatics |
| Simulation | 20 ps at 2 fs | Restrained relaxation at 300 K, pH 7.4, deterministic seed |
| Output | moving heavy atoms | Only the moving residues' heavy atoms are written back; the rest of the structure is untouched |
Simulating only the surroundings of the gaps is what makes this affordable while remaining physically meaningful: the shell around four loops is on the order of 6,000 atoms versus about 42,000 for a full four-chain channel with hydrogens. If the relaxation fails, the regions are still delivered as placed (fitted but not relaxed), and the result says so explicitly.
Stage 8: Quality Control and Reporting
Every rebuilt region is measured against the original structure before anything is reported as rebuilt:
| Metric | Definition | Interpretation |
|---|---|---|
| Flank fit | Backbone RMSD of the superposition that placed the region | How well the fill inherits the frame of the experiment |
| Junction C-N | Peptide bond distances joining region to original (1.33 Å ideal) | Covalent continuity of the chain |
| Clashes | Region heavy atoms closer than 2.2 Å to the rest of the structure, ligands and lipids included | Steric validity; flagged regions should be inspected before use |
| RMSD vs original | Whole-structure and per-chain RMSD against the input | Confirmation the experiment was preserved |
| Relaxed | Whether the restrained MD relaxation ran | If not, the error is reported with the result |
The result lists every region with its metrics, names any region that could not be rebuilt and why, warns with counts and closest distances where clashes remain, and provides the rebuilt structure (mmCIF and PDB) for download. The completion summary states plainly how many of the selected regions were rebuilt, how many added internal gaps were rebuilt alongside them, and that the rest of the structure is unchanged.
Validation and Benchmarks
The inpainting core of this protocol is externally benchmarked. PATCHR's reference benchmark is built on 940 PDB40 structures with artificially introduced gaps mirroring real PDB missing-region statistics, scored by mean RMSD over the missing residues against the removed experimental coordinates:[1]
| Method | Cα RMSD (Å) | All-atom RMSD (Å) |
|---|---|---|
| PATCHR (template-constrained diffusion + local refinement) | 1.781 | 2.542 |
| Boltz-2 baseline (no template handling) | 11.187 | 11.932 |
| Boltz-2 + template conditioning | 4.647 | 5.510 |
| Boltz-2 + template conditioning + steering | 3.219 to 3.675 | 3.889 to 4.342 |
| RFdiffusion (backbone-only inpainting) | 2.043 | n/a |
The ablation is the scientific justification for this protocol's design: a bare co-folding model left to inpaint on its own drifts more than 11 Å from the experiment it was supposed to preserve; constraining the template at every denoising step brings the error under 2 Å, better than backbone-only RFdiffusion while producing full all-atom fills. Accuracy is highest where it matters most for downstream use: buried fills (0.389 Å Cα RMSD) and interface fills (0.646 Å) are more accurate than surface fills (1.006 Å), and regular secondary structure (helix 0.296 Å, strand 0.257 Å) more than loops (0.852 Å). Rebuilt missing atoms reach lDDT 98.6, and 99.4% of chains pass the connectivity check.[1]
The two backend models carry their own published validations. Boltz-2 was benchmarked across PoseBusters and recent PDB structure and affinity tasks, matching or exceeding comparable co-folding models on complex prediction while adding affinity prediction that approaches the accuracy of alchemical free energy perturbation methods.[2] Protenix achieves state-of-the-art performance among open models on PoseBusters V2, low-homology PDB, and CASP15 RNA.[4]
On top of the published benchmarks, every individual rebuild produced by this protocol is gated by the Stage 8 measurements: a region is reported as rebuilt only if its backbone was continuous from flank to flank, its junctions and clashes are quantified, and the structure-level RMSD confirms the experimental coordinates were preserved.
Summary of Tools
| Stage | Tool | Purpose | Reference |
|---|---|---|---|
| Identifier validation | RCSB PDB / UniProt / HGNC | Canonical target identifiers | [10] |
| Predicted structures | AlphaFold DB | Structure acquisition when no experiment exists | [7] |
| Gap detection | In-house detector (REMARK 465, chain breaks, SEQRES) | Every missing region per protein and per chain | |
| Structure generation (service) | Boltz service, Boltz-2 model | Template-forced structure prediction per chain | [2], [3] |
| Structure generation (GPU) | PATCHR (Boltz-2 or Protenix backend) | Template-constrained diffusion inpainting | [1], [2], [4] |
| Inpainting heritage | RFdiffusion | Established diffusion inpainting for design | [6] |
| Grafting | In-house (backbone superposition on flanks) | Place rebuilt regions, keep every observed atom | |
| Relaxation | OpenMM (amber14, OBC2) | Restrained MD of rebuilt regions and surroundings | [9] |
| Orchestration | AI agent + container jobs | Interactive protocol, reproducible execution |
Infrastructure
The protocol is orchestrated by an AI agent that runs each stage as an independent container job, so every step is reproducible and inspectable on its own. The PATCHR path runs on dedicated GPU workers; the hosted Boltz path calls the Boltz service API; gap detection, grafting, and relaxation run on CPU workers. Rebuilt structures, per-region metrics, and the underlying gap reports are stored in the project database and object storage, and surfaced in the Autochem interface with per-region tables and download buttons.
References
-
Bae, H., Kim, K., Yoo, J., Joo, K. (2026). PATCHR: Molecular Structure Inpainting for Protein, RNA, and DNA Complexes Using Template-Constrained Diffusion. Preprint; code and benchmark data at the official repository. https://github.com/DeepFoldProtein/patchr https://patchr.deepfold.org
-
Passaro, S., Corso, G., Wohlwend, J., Reveiz, M., Thaler, S., et al. (2025). Boltz-2: Towards Accurate and Efficient Binding Affinity Prediction. bioRxiv, 2025.06.14.659707. https://doi.org/10.1101/2025.06.14.659707
-
Wohlwend, J., Corso, G., Passaro, S., et al. (2025). Boltz-1: Demystifying Biomolecular Interactions with Deep Learning. bioRxiv, 2024.11.19.624167. https://doi.org/10.1101/2024.11.19.624167
-
ByteDance AML AI4Science Team, Chen, X., Zhang, Y., Lu, C., Ma, W., et al. (2025). Protenix: Advancing Structure Prediction Through a Comprehensive AlphaFold3 Reproduction. bioRxiv, 2025.01.08.631967. https://doi.org/10.1101/2025.01.08.631967
-
Abramson, J. et al. (2024). Accurate structure prediction of biomolecular interactions with AlphaFold 3. Nature, 630, 493-500. https://doi.org/10.1038/s41586-024-07487-w
-
Watson, J.L. et al. (2023). De novo design of protein structure and function with RFdiffusion. Nature, 620, 1089-1100. https://doi.org/10.1038/s41586-023-06415-8
-
Varadi, M. et al. (2022). AlphaFold Protein Structure Database: massively expanding the structural coverage of protein-sequence space with high-accuracy models. Nucleic Acids Research, 50(D1), D439-D444. https://doi.org/10.1093/nar/gkab1061
-
Jumper, J. et al. (2021). Highly accurate protein structure prediction with AlphaFold. Nature, 596, 583-589. https://doi.org/10.1038/s41586-021-03819-2
-
Eastman, P. et al. (2017). OpenMM 7: Rapid development of high-performance algorithms for molecular dynamics. PLOS Computational Biology, 13(7), e1005659. https://doi.org/10.1371/journal.pcbi.1005659
-
UniProt Consortium (2023). UniProt: the universal protein knowledgebase in 2023. Nucleic Acids Research, 51(D1), D523-D531. https://doi.org/10.1093/nar/gkac1052