$npx -y skills add adaptyvbio/protein-design-skills --skill ligandmpnnLigand-aware protein sequence design using LigandMPNN. Use this skill when: (1) Designing sequences around small molecules, (2) Enzyme active site design, (3) Ligand binding pocket optimization, (4) Metal coordination site design, (5) Cofactor binding proteins. For standard prote
| 1 | # LigandMPNN Ligand-Aware 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: Modal (recommended) |
| 17 | ```bash |
| 18 | cd biomodals |
| 19 | # modal_ligandmpnn.py takes --input-pdb; LigandMPNN run.py args go in --params-str |
| 20 | modal run modal_ligandmpnn.py \ |
| 21 | --input-pdb protein_ligand.pdb \ |
| 22 | --params-str "--model_type ligand_mpnn --number_of_batches 16 --temperature 0.1" |
| 23 | ``` |
| 24 | |
| 25 | **GPU**: A10G default | **Timeout**: 900s default |
| 26 | |
| 27 | ### Option 2: Local installation |
| 28 | ```bash |
| 29 | git clone https://github.com/dauparas/LigandMPNN.git |
| 30 | cd LigandMPNN |
| 31 | |
| 32 | python run.py \ |
| 33 | --model_type ligand_mpnn \ |
| 34 | --pdb_path protein_ligand.pdb \ |
| 35 | --out_folder output/ \ |
| 36 | --number_of_batches 16 \ |
| 37 | --temperature 0.1 |
| 38 | ``` |
| 39 | |
| 40 | ## Key parameters (LigandMPNN run.py) |
| 41 | |
| 42 | | Parameter | Default | Description | |
| 43 | |-----------|---------|-------------| |
| 44 | | `--pdb_path` | required | PDB with ligand | |
| 45 | | `--model_type` | `protein_mpnn` | `ligand_mpnn`, `soluble_mpnn`, etc. | |
| 46 | | `--temperature` | 0.1 | Sampling temperature | |
| 47 | | `--number_of_batches` | 1 | Batches (sequences = batch_size x batches) | |
| 48 | | `--batch_size` | 1 | Sequences per batch | |
| 49 | | `--ligand_mpnn_use_side_chain_context` | 0 | Use ligand side-chain context | |
| 50 | |
| 51 | ## Ligand Specification |
| 52 | |
| 53 | ### In PDB File |
| 54 | Ligand must be present as HETATM records: |
| 55 | ``` |
| 56 | ATOM ...protein atoms... |
| 57 | HETATM 1 C1 LIG A 999 x.xxx y.yyy z.zzz 1.00 0.00 C |
| 58 | ``` |
| 59 | |
| 60 | ### Supported Ligand Types |
| 61 | - Small molecules (HETATM) |
| 62 | - Metals (Zn, Fe, Mg, Ca, etc.) |
| 63 | - Cofactors (NAD, FAD, ATP) |
| 64 | - DNA/RNA |
| 65 | |
| 66 | ## Output format |
| 67 | |
| 68 | ``` |
| 69 | output/ |
| 70 | ├── seqs/ |
| 71 | │ └── protein.fa # FASTA sequences |
| 72 | └── protein_pdb/ |
| 73 | └── protein_0001.pdb # PDBs with designed sequence |
| 74 | ``` |
| 75 | |
| 76 | ## Sample output |
| 77 | |
| 78 | ### Successful run |
| 79 | ``` |
| 80 | $ python run.py --pdb_path enzyme_substrate.pdb --out_folder output/ --num_seq_per_target 8 |
| 81 | Loading LigandMPNN model weights... |
| 82 | Processing enzyme_substrate.pdb |
| 83 | Found ligand: LIG (12 atoms) |
| 84 | Generated 8 sequences in 3.1 seconds |
| 85 | |
| 86 | output/seqs/enzyme_substrate.fa: |
| 87 | >enzyme_substrate_0001, score=1.45, global_score=1.38 |
| 88 | MKTAYIAKQRQISFVKSHFSRQLE... |
| 89 | >enzyme_substrate_0002, score=1.52, global_score=1.41 |
| 90 | MKTAYIAKQRQISFVKSQFSRQLD... |
| 91 | ``` |
| 92 | |
| 93 | **What good output looks like:** |
| 94 | - Score: 1.0-2.0 (lower = more confident) |
| 95 | - Ligand detected and incorporated in context |
| 96 | - Active site residues preserved or optimized |
| 97 | |
| 98 | ## Decision tree |
| 99 | |
| 100 | ``` |
| 101 | Should I use LigandMPNN? |
| 102 | │ |
| 103 | ├─ What's in your binding site? |
| 104 | │ ├─ Small molecule / ligand → LigandMPNN ✓ |
| 105 | │ ├─ Metal ion (Zn, Fe, etc.) → LigandMPNN ✓ |
| 106 | │ ├─ Cofactor (NAD, FAD, ATP) → LigandMPNN ✓ |
| 107 | │ ├─ DNA/RNA → LigandMPNN ✓ |
| 108 | │ └─ Nothing / protein only → Use ProteinMPNN |
| 109 | │ |
| 110 | ├─ What type of design? |
| 111 | │ ├─ Enzyme active site → LigandMPNN ✓ |
| 112 | │ ├─ Metal binding site → LigandMPNN ✓ |
| 113 | │ ├─ Protein-protein binder → Use ProteinMPNN |
| 114 | │ └─ De novo scaffold → Use ProteinMPNN |
| 115 | │ |
| 116 | └─ Priority? |
| 117 | ├─ Solubility/expression → Consider SolubleMPNN |
| 118 | └─ Ligand context accuracy → LigandMPNN ✓ |
| 119 | ``` |
| 120 | |
| 121 | ## Typical performance |
| 122 | |
| 123 | | Campaign Size | Time (T4) | Cost (Modal) | Notes | |
| 124 | |---------------|-----------|--------------|-------| |
| 125 | | 100 backbones × 8 seq | 15-20 min | ~$2 | Standard | |
| 126 | | 500 backbones × 8 seq | 1-1.5h | ~$8 | Large campaign | |
| 127 | |
| 128 | **Throughput**: ~50-100 sequences/minute on T4 GPU. |
| 129 | |
| 130 | --- |
| 131 | |
| 132 | ## Verify |
| 133 | |
| 134 | ```bash |
| 135 | grep -c "^>" output/seqs/*.fa # Should match backbone_count × num_seq_per_target |
| 136 | ``` |
| 137 | |
| 138 | --- |
| 139 | |
| 140 | ## Troubleshooting |
| 141 | |
| 142 | **Ligand not recognized**: Check HETATM format, verify ligand residue name |
| 143 | **Poor binding residues**: Increase sampling around active site |
| 144 | **Missing contacts**: Verify ligand coordinates in PDB |
| 145 | |
| 146 | ### Error interpretation |
| 147 | |
| 148 | | Error | Cause | Fix | |
| 149 | |-------|-------|-----| |
| 150 | | `RuntimeError: CUDA out of memory` | Long protein or large batch | Reduce batch_size | |
| 151 | | `KeyError: 'LIG'` | Ligand not found in PDB | Check HETATM records | |
| 152 | | `ValueError: no ligand atoms` | Empty ligand | Verify ligand has atoms in PDB | |
| 153 | |
| 154 | --- |
| 155 | |
| 156 | **Next**: Structure prediction for validation → `protein-qc` for filtering. |