> ## Documentation Index
> Fetch the complete documentation index at: https://proto.evodesign.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# RFdiffusion + Inverse Folding Motif Scaffolding

> Motif scaffolding: RFdiffusion3/RFD4 backbones around a fixed motif + motif-fixed inverse folding

![RFdiffusion + Inverse Folding Motif Scaffolding](https://proto-bio.github.io/proto-assets/images/generator/rfdiffusion-mpnn-motif-scaffold/hero.png)

> [!NOTE]
>
> **License:** This generator can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details.

This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them.

***

&#x20;Tools Used Tools Used  Source Source

[  ![](https://proto-bio.github.io/proto-assets/images/tool/rfdiffusion3/carousel.png)  ![](https://proto-bio.github.io/proto-assets/images/tool/rfd4/carousel.png)Structure Design · 2 tools](https://proto.evodesign.org/docs/tools/structure-design/overview)[  ![](https://proto-bio.github.io/proto-assets/images/tool/proteinmpnn/carousel.png)  ![](https://proto-bio.github.io/proto-assets/images/tool/ligandmpnn/carousel.png)  ![](https://proto-bio.github.io/proto-assets/images/tool/esm_if1/carousel.png)  ![](https://proto-bio.github.io/proto-assets/images/tool/caliby/carousel.png)Inverse Folding · 4 tools](https://proto.evodesign.org/docs/tools/inverse-folding/overview)

![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678)

evo-design/proto-language

&#x20;View source

[Open](https://github.com/evo-design/proto-language/blob/1a97e675c7e5e4ae0e92be91b1bb7b49f1331104/proto_language/generator/rfdiffusion_mpnn_monomer_generator.py#L443)

Generator contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano)
Motif-scaffolding generator chaining a motif-conditioned backbone model and inverse folding.

The backbone model keeps the contig's motif residues at their input coordinates and
residue identities and diffuses the designed segments: RFdiffusion3 does so for contig
residues by default, and with `backbone_model="rfd4"` the generator gives RFD4-Proteina
the motif's coordinates (`fixed_coordinates`) and sequence (`known_sequence`), which
an RFD4 contig alone does not. The selected inverse-folding model then designs every
other position with the motif positions fixed. The motif's 1-indexed positions in the
designed chain follow from the contig and are recorded in the proposal's generator
metadata (`motif_positions`). The contig's total length must equal the segment length.

## API Reference

ConfigRFdiffusionMPNNMotifScaffoldGeneratorConfig[ Source](https://github.com/evo-design/proto-language/blob/1a97e675c7e5e4ae0e92be91b1bb7b49f1331104/proto_language/generator/rfdiffusion_mpnn_monomer_generator.py#L110)

Configuration object for RFdiffusionMPNNMotifScaffoldGenerator.

`contig` lays out the single designed chain from N- to C-terminus: input-structure
ranges (`"A36-55"`) are the motif, kept at their input coordinates and residue
identities, and bare integers (`"20"`) are designed segments. Designed lengths must be
fixed (`"20"` or `"20-20"`), because the contig's total length must equal the
assigned segment's length; a range such as `"10-30"` is rejected. The selected
inverse-folding model holds the motif positions fixed.

**motif\_structure** `Structure | string` *required*

Structure holding the motif (file path, PDB/CIF content, or Structure).

**contig** `string` *required*

Single-chain contig of motif ranges and fixed designed lengths, e.g. '20,A36-55,25'.

**backbone\_model** `enum` (default: rfdiffusion3)

Backbone-generation model: 'rfdiffusion3' or 'rfd4' (RFD4-Proteina).

Options: `rfdiffusion3`, `rfd4`

**rfd4\_config** `RFD4DesignConfig`

Advanced RFD4-Proteina settings; used when backbone\_model='rfd4'.

**inverse\_folding** `enum` (default: proteinmpnn)

Sequence-design model: 'proteinmpnn', 'ligandmpnn' (ligand/DNA-aware), 'esm-if1' or 'caliby'.

Options: `proteinmpnn`, `ligandmpnn`, `esm-if1`, `caliby`

**proteinmpnn\_config** `ProteinMPNNSampleConfig`

Advanced ProteinMPNN settings; used when inverse\_folding='proteinmpnn'.

**ligandmpnn\_config** `LigandMPNNSampleConfig`

Advanced LigandMPNN settings; used when inverse\_folding='ligandmpnn'.

**esm\_if1\_config** `ESMIF1SampleConfig`

Advanced ESM-IF1/ProteinDPO settings; used when inverse\_folding='esm-if1'.

**caliby\_config** `CalibySampleConfig`

Advanced Caliby settings; used when inverse\_folding='caliby'.

**rfdiffusion3\_config** `RFdiffusion3Config`

Advanced RFdiffusion3 backbone-generation configuration.

## Usage

```python python icon="python" theme={null}
>>> from proto_language.core import Segment
>>> gen = RFdiffusionMPNNMotifScaffoldGenerator(
...     RFdiffusionMPNNMotifScaffoldGeneratorConfig(
...         motif_structure="motif.pdb", contig="20,A36-55,25", backbone_model="rfd4"
...     )
... )
>>> gen.assign(Segment(length=65, sequence_type="protein"))  # 20 + 20 motif + 25
>>> gen.sample()  # positions 21-40 keep the motif's residues
```

## Metadata

| Property | Value |
| - | - |
| Key | `rfdiffusion-mpnn-motif-scaffold` |
| Class | `RFdiffusionMPNNMotifScaffoldGenerator` |
| Category | `mutation` |
| Input Type | `starting_sequence` |
| Uses GPU | `True` |
| Supported Sequence Types | `protein` |
| Allows Empty Start | `True` |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.