How to generate sequences that fold into a protein structure with inverse folding
Design sequences for a protein backbone using ProteinMPNN or PoET-2, define redesign constraints, and evaluate generated candidates.
This guide will show you how to design sequences that fold into a given protein backbone structure. The OpenProtein.AI platform offers inverse folding models that allow you to define which residues to fix or change, generate compatible amino acid sequences, and shortlist designs for further testing.
Before starting
-
Have a protein structure in a CIF or PDB file containing backbone coordinates. The structure can be experimental, predicted, or generated.
-
Identify any residues or chains whose sequences must remain fixed.
-
Decide on a design goal, such as redesigning an interface, generating alternatives for a fold, or preserving a scaffold while changing selected regions.
-
Have a protein-family context if using PoET-2 to guide generation.
Setup
The Python examples require SDK version 0.18 or later.
Choose a sequence generation model:
-
ProteinMPNN: Use for general sequence redesign conditioned on a backbone.
-
PoET-2 with context: Use to also guide generation toward a protein family. For example, use an appropriate VH or VHH context when redesigning antibody framework regions and CDRs.
Start with a small number of sequences, such as 10 per backbone. Scale up after inspecting the initial results.
Navigate to the Generate tool and select the sequence generator. For PoET-2, also supply the relevant context. Use the existing backbone as the structural input.
Specify the input structure
Select a structure containing the chain or chains to redesign. If an interface is relevant, retain the interacting chains in their intended relative positions.
Check for:
-
Missing backbone coordinates and expression artifacts such as His-tags
-
Unrelated chains or tags that they fall outside the design goal – these can be removed
-
Missing backbone coordinates – obtain or model these before redesigning those regions.
Only delete unresolved residues if excluding them is consistent with the intended design.
Upload the structure into the query box. This can be done by either loading a CIF or PDB file directly, or typing / followed by pdb <pdb_id> in the input box, if a structure in PDB can be directly used. Remove unnecessary chains using the × icon beside each chain. Inspect the sequence tracks and structure viewer to confirm that the intended chains and backbone coordinates are present. Refer to the inverse folding tutorial or nanobody binder design walkthrough (App) for guided examples.
Define which residues to design
Decide on the scope of redesign:
-
Design the entire protein: Explore sequences compatible with the full backbone structure when no residue identities need to remain fixed.
-
Design an entire chain: Generate sequences for one chain while retaining other chains as structural context.
-
Redesign selected regions: Change loops, interfaces, or other sites while retaining the surrounding sequence. Fixed positions could include catalytic residues, antibody framework residues, or residues required for target binding.
Mask the sequence positions to generate while retaining their backbone coordinates.
Replace designable sequence positions with X. To mask the entire sequence, use the “Mask Query Sequence” button at the top of the query editor. To mask only selected residues, we can either select these directly in the query editor, or select inverse of those. We would then click “Mask Selected Residues” or “Mask Unselected Residues” respectively. Leave required residue identities unchanged and keep the corresponding backbone structure unmasked.
Choose settings and generate sequences
Set the sample count and temperature. For ProteinMPNN, start with a temperature of 0.1; for PoET-2, start with a temperature of 0.5. Increase temperature if the results offer too little diversity; lower it to make sampling more concentrated. Begin with a small number of sequences (e.g. 10 sequences), and increase this after checking that the initial results are acceptable.
Set a random seed when reproducing or comparing runs.
Configure the sample count and model-specific sampling settings. Configure refolding before clicking Run if evaluating structures within the same workflow.
Refold the generated sequences
For complexes, retain the partner chains when predicting the structure so that the interface can be evaluated. Choose whether to provide a structural template. For an initial check of whether the designed sequence adopts the intended fold, we recommend against providing a template, as refolding filtering is generally done without templates.
Select a structure prediction model and template option under Refolding Settings.
Analyze and shortlist designs
Compare predicted structures with the input backbone, then apply filters relevant to the design goal:
-
Fold agreement: We recommend filtering by backbone RMSD. An RMSD below 2.5 is a typical threshold.
-
Local confidence: Inspect confidence in the redesigned regions alongside the whole-protein average.
-
Interface agreement: For complexes, inspect the predicted interaction and interface confidence.
-
Sequence diversity: Compare designs with the reference sequence, with one another, and with context sequences if PoET-2 was used.