$npx -y skills add adaptyvbio/protein-design-skills --skill proteinmpnnDesign protein sequences using ProteinMPNN inverse folding. Use this skill when: (1) Designing sequences for RFdiffusion backbones, (2) Redesigning existing protein sequences, (3) Fixing specific residues while designing others, (4) Optimizing sequences for expression or stabilit
| 1 | # ProteinMPNN Sequence Design |
| 2 | |
| 3 | ## Prerequisites |
| 4 | |
| 5 | | Requirement | Minimum | Recommended | |
| 6 | |-------------|---------|-------------| |
| 7 | | Python | 3.8+ | 3.10 | |
| 8 | | CUDA | 11.0+ | 11.7+ | |
| 9 | | GPU VRAM | 8GB | 16GB (T4) | |
| 10 | | RAM | 8GB | 16GB | |
| 11 | |
| 12 | ## How to run |
| 13 | |
| 14 | > **First time?** See [Getting started](../../docs/getting-started.md) to set up Modal and biomodals. |
| 15 | |
| 16 | ### Option 1: Local installation (recommended) |
| 17 | ```bash |
| 18 | git clone https://github.com/dauparas/ProteinMPNN.git |
| 19 | cd ProteinMPNN |
| 20 | |
| 21 | python protein_mpnn_run.py \ |
| 22 | --pdb_path backbone.pdb \ |
| 23 | --out_folder output/ \ |
| 24 | --num_seq_per_target 16 \ |
| 25 | --sampling_temp "0.1" |
| 26 | ``` |
| 27 | |
| 28 | **GPU**: T4 (16GB) sufficient | **Time**: ~50-100 sequences/minute |
| 29 | |
| 30 | ### Option 2: Modal (via LigandMPNN wrapper) |
| 31 | ```bash |
| 32 | cd biomodals |
| 33 | # modal_ligandmpnn.py takes --input-pdb and forwards run.py args via --params-str |
| 34 | modal run modal_ligandmpnn.py \ |
| 35 | --input-pdb backbone.pdb \ |
| 36 | --params-str "--model_type protein_mpnn --number_of_batches 16 --temperature 0.1" |
| 37 | ``` |
| 38 | |
| 39 | **GPU** (Modal): A10G default | **Timeout**: 900s default |
| 40 | |
| 41 | Note: LigandMPNN includes ProteinMPNN functionality (select with `--model_type protein_mpnn`). |
| 42 | |
| 43 | ## Config Schema |
| 44 | |
| 45 | ### Core Parameters |
| 46 | |
| 47 | | Parameter | Default | Range | Description | |
| 48 | |-----------|---------|-------|-------------| |
| 49 | | `--pdb_path` | required | path | Single PDB input | |
| 50 | | `--pdb_path_chains` | all | A,B | Chains to design (comma-sep) | |
| 51 | | `--out_folder` | required | path | Output directory | |
| 52 | | `--num_seq_per_target` | 1 | 1-1000 | Sequences per structure | |
| 53 | | `--sampling_temp` | "0.1" | "0.0001-1.0" | Temperature (string!) | |
| 54 | | `--seed` | 0 | int | Random seed | |
| 55 | | `--batch_size` | 1 | 1-32 | Batch size | |
| 56 | |
| 57 | ### Temperature Guide |
| 58 | ``` |
| 59 | 0.1 -> Low diversity, high recovery (production) |
| 60 | 0.2 -> Moderate diversity (default) |
| 61 | 0.3 -> Higher diversity (exploration) |
| 62 | 0.5+ -> Very diverse, lower quality |
| 63 | ``` |
| 64 | |
| 65 | **IMPORTANT**: Temperature must be passed as a string, not float. |
| 66 | |
| 67 | ## Common mistakes |
| 68 | |
| 69 | ### Temperature Parameter |
| 70 | ✅ **Correct**: |
| 71 | ```bash |
| 72 | --sampling_temp "0.1" # String with quotes |
| 73 | ``` |
| 74 | |
| 75 | ❌ **Wrong**: |
| 76 | ```bash |
| 77 | --sampling_temp 0.1 # Float without quotes - may cause errors |
| 78 | --sampling_temp 0.1,0.2 # Multiple temps need proper format |
| 79 | ``` |
| 80 | |
| 81 | ### Fixed Positions JSONL |
| 82 | ✅ **Correct**: |
| 83 | ```json |
| 84 | {"A": [1, 2, 3, 10, 11], "B": [5, 6]} |
| 85 | ``` |
| 86 | |
| 87 | ❌ **Wrong**: |
| 88 | ```json |
| 89 | {"A": "1,2,3,10,11"} # String instead of list |
| 90 | {A: [1, 2, 3]} # Missing quotes on key |
| 91 | {"A": [1,2,3,]} # Trailing comma |
| 92 | ``` |
| 93 | |
| 94 | ### Chain Selection |
| 95 | ✅ **Correct**: |
| 96 | ```bash |
| 97 | --pdb_path_chains A,B # No spaces |
| 98 | ``` |
| 99 | |
| 100 | ❌ **Wrong**: |
| 101 | ```bash |
| 102 | --pdb_path_chains A, B # Space after comma |
| 103 | --pdb_path_chains "A,B" # Quotes may cause issues |
| 104 | ``` |
| 105 | |
| 106 | ### Amino Acid Biases |
| 107 | ```bash |
| 108 | # Bias toward certain AAs (positive = favor) |
| 109 | --bias_AA_jsonl '{"A": {"A": 1.5, "W": -2.0}}' |
| 110 | |
| 111 | # Omit specific AAs globally |
| 112 | --omit_AAs "CM" # No cysteine or methionine |
| 113 | |
| 114 | # Per-position omission |
| 115 | --omit_AA_jsonl '{"A": {"1": "C", "2": "CM"}}' |
| 116 | ``` |
| 117 | |
| 118 | ### Multi-Chain Design |
| 119 | ```bash |
| 120 | # Design chains A and B together |
| 121 | --pdb_path_chains A,B |
| 122 | |
| 123 | # Tie chains (same sequence) |
| 124 | --tied_positions_jsonl tied.jsonl |
| 125 | ``` |
| 126 | |
| 127 | ## Variants Comparison |
| 128 | |
| 129 | | Variant | Use Case | Key Difference | |
| 130 | |---------|----------|----------------| |
| 131 | | ProteinMPNN | General | Original model | |
| 132 | | SolubleMPNN | Expression | Trained on soluble proteins | |
| 133 | | LigandMPNN | Small molecules | Ligand-aware context | |
| 134 | |
| 135 | ## Output format |
| 136 | |
| 137 | ``` |
| 138 | output/ |
| 139 | ├── seqs/ |
| 140 | │ └── backbone.fa # FASTA sequences |
| 141 | └── backbone_pdb/ |
| 142 | └── backbone_0001.pdb # PDBs with designed sequence |
| 143 | ``` |
| 144 | |
| 145 | ### FASTA Header Format |
| 146 | ``` |
| 147 | >backbone_0001, score=1.234, global_score=1.234, seq_recovery=0.85 |
| 148 | MKTAYIAKQRQISFVKSHFSRQLE... |
| 149 | ``` |
| 150 | |
| 151 | ## Common workflows |
| 152 | |
| 153 | ### Binder Sequence Design |
| 154 | ```bash |
| 155 | python protein_mpnn_run.py \ |
| 156 | --pdb_path binder_backbone.pdb \ |
| 157 | --out_folder output/ \ |
| 158 | --num_seq_per_target 16 \ |
| 159 | --sampling_temp "0.1" \ |
| 160 | --pdb_path_chains B # Design binder chain only |
| 161 | ``` |
| 162 | |
| 163 | ### Interface Redesign |
| 164 | ```bash |
| 165 | # Fix core, design interface |
| 166 | python protein_mpnn_run.py \ |
| 167 | --pdb_path complex.pdb \ |
| 168 | --fixed_positions_jsonl core_positions.jsonl \ |
| 169 | --num_seq_per_target 32 |
| 170 | ``` |
| 171 | |
| 172 | ### Multi-State Design |
| 173 | ```bash |
| 174 | # Design for multiple conformations |
| 175 | python protein_mpnn_run.py \ |
| 176 | --pdb_path_multi state1.pdb,state2.pdb \ |
| 177 | --num_seq_per_target 16 |
| 178 | ``` |
| 179 | |
| 180 | ## Sample output |
| 181 | |
| 182 | ### Successful run |
| 183 | ``` |
| 184 | $ python protein_mpnn_run.py --pdb_path backbone.pdb - |