$npx -y skills add adaptyvbio/protein-design-skills --skill alphafoldValidate protein designs using AlphaFold2 structure prediction. Use this skill when: (1) Validating designed sequences fold correctly, (2) Predicting binder-target complex structures, (3) Calculating confidence metrics (pLDDT, pTM, ipTM), (4) Self-consistency validation of design
| 1 | # AlphaFold2 Structure Validation |
| 2 | |
| 3 | ## Prerequisites |
| 4 | |
| 5 | | Requirement | Minimum | Recommended | |
| 6 | |-------------|---------|-------------| |
| 7 | | Python | 3.8+ | 3.10 | |
| 8 | | CUDA | 11.0+ | 12.0+ | |
| 9 | | GPU VRAM | 32GB | 40GB (A100) | |
| 10 | | RAM | 32GB | 64GB | |
| 11 | | Disk | 100GB | 500GB (for databases) | |
| 12 | |
| 13 | ## How to run |
| 14 | |
| 15 | > **First time?** See [Getting started](../../docs/getting-started.md) to set up Modal and biomodals. |
| 16 | |
| 17 | ### Option 1: Modal (AlphaFold-Multimer) |
| 18 | ```bash |
| 19 | cd biomodals |
| 20 | modal run modal_alphafold.py \ |
| 21 | --input-fasta sequences.fasta \ |
| 22 | --out-dir output/ |
| 23 | ``` |
| 24 | |
| 25 | **GPU**: A100 (40GB) | **Timeout**: 3600s default |
| 26 | |
| 27 | ### Option 2: Local installation |
| 28 | ```bash |
| 29 | git clone https://github.com/google-deepmind/alphafold.git |
| 30 | cd alphafold |
| 31 | |
| 32 | python run_alphafold.py \ |
| 33 | --fasta_paths=query.fasta \ |
| 34 | --output_dir=output/ \ |
| 35 | --model_preset=monomer \ |
| 36 | --max_template_date=2026-01-01 |
| 37 | ``` |
| 38 | |
| 39 | ### Option 3: ESMFold2 (fast single-sequence) |
| 40 | ```bash |
| 41 | printf '>protein|A\nMKTAYIAKQRQISFVK...\n' > seq.faa |
| 42 | uv run --with modal modal run modal_esmfold2.py --input-faa seq.faa |
| 43 | ``` |
| 44 | |
| 45 | ## Key parameters |
| 46 | |
| 47 | | Parameter | Default | Options | Description | |
| 48 | |-----------|---------|---------|-------------| |
| 49 | | `--model_preset` | monomer | monomer/multimer | Model type | |
| 50 | | `--num_recycle` | 3 | 1-20 | Recycling iterations | |
| 51 | | `--max_template_date` | - | YYYY-MM-DD | Template cutoff | |
| 52 | | `--use_templates` | True | True/False | Use template search | |
| 53 | |
| 54 | ## Output format |
| 55 | |
| 56 | ``` |
| 57 | output/ |
| 58 | ├── ranked_0.pdb # Best model |
| 59 | ├── ranked_1.pdb # Second best |
| 60 | ├── ranking_debug.json # Confidence scores |
| 61 | ├── result_model_1.pkl # Full results |
| 62 | ├── msas/ # MSA files |
| 63 | └── features.pkl # Input features |
| 64 | ``` |
| 65 | |
| 66 | ### Extracting metrics |
| 67 | ```python |
| 68 | import pickle |
| 69 | |
| 70 | with open('result_model_1.pkl', 'rb') as f: |
| 71 | result = pickle.load(f) |
| 72 | |
| 73 | plddt = result['plddt'] |
| 74 | ptm = result['ptm'] |
| 75 | iptm = result.get('iptm', None) # Multimer only |
| 76 | pae = result['predicted_aligned_error'] |
| 77 | ``` |
| 78 | |
| 79 | ## Sample output |
| 80 | |
| 81 | ### Successful run |
| 82 | ``` |
| 83 | $ python run_alphafold.py --fasta_paths complex.fasta --model_preset multimer |
| 84 | [INFO] Running MSA search... |
| 85 | [INFO] Running model 1/5... |
| 86 | [INFO] Running model 5/5... |
| 87 | [INFO] Relaxing structures... |
| 88 | |
| 89 | Results: |
| 90 | ranked_0.pdb: |
| 91 | pLDDT: 87.3 (mean) |
| 92 | pTM: 0.78 |
| 93 | ipTM: 0.62 |
| 94 | PAE (interface): 8.5 |
| 95 | |
| 96 | Saved to output/ |
| 97 | ``` |
| 98 | |
| 99 | **What good output looks like:** |
| 100 | - pLDDT: > 85 (mean, on 0-100 scale) or > 0.85 (normalized) |
| 101 | - pTM: > 0.70 |
| 102 | - ipTM: > 0.50 for complexes |
| 103 | - PAE_interface: < 10 |
| 104 | |
| 105 | ## Decision tree |
| 106 | |
| 107 | ``` |
| 108 | Should I use AlphaFold? |
| 109 | │ |
| 110 | ├─ What are you predicting? |
| 111 | │ ├─ Single protein → ESMFold (faster) |
| 112 | │ ├─ Protein-protein complex → AlphaFold/ColabFold ✓ |
| 113 | │ ├─ Protein + ligand → Chai or Boltz |
| 114 | │ └─ Batch of sequences → ColabFold ✓ |
| 115 | │ |
| 116 | ├─ What do you need? |
| 117 | │ ├─ Highest accuracy → AlphaFold/ColabFold ✓ |
| 118 | │ ├─ Fast screening → ESMFold |
| 119 | │ └─ MSA-free prediction → Chai or ESMFold |
| 120 | │ |
| 121 | └─ Which AF2 option? |
| 122 | ├─ Local installation → Full control, slow setup |
| 123 | ├─ ColabFold → Easier, MSA server |
| 124 | └─ Modal → Recommended for batch |
| 125 | ``` |
| 126 | |
| 127 | ## Typical performance |
| 128 | |
| 129 | | Campaign Size | Time (A100) | Cost (Modal) | Notes | |
| 130 | |---------------|-------------|--------------|-------| |
| 131 | | 100 complexes | 1-2h | ~$8 | With MSA server | |
| 132 | | 500 complexes | 5-10h | ~$40 | Standard campaign | |
| 133 | | 1000 complexes | 10-20h | ~$80 | Large campaign | |
| 134 | |
| 135 | **Per-complex**: ~30-60s with MSA server. |
| 136 | |
| 137 | --- |
| 138 | |
| 139 | ## Verify |
| 140 | |
| 141 | ```bash |
| 142 | find output -name "ranked_0.pdb" | wc -l # Should match input count |
| 143 | ``` |
| 144 | |
| 145 | --- |
| 146 | |
| 147 | ## Troubleshooting |
| 148 | |
| 149 | **Low pLDDT regions**: May indicate disorder or poor design |
| 150 | **Low ipTM**: Interface not confident, check hotspots |
| 151 | **High PAE off-diagonal**: Chains may not interact |
| 152 | **OOM errors**: Use ColabFold with MSA server instead |
| 153 | |
| 154 | ### Error interpretation |
| 155 | |
| 156 | | Error | Cause | Fix | |
| 157 | |-------|-------|-----| |
| 158 | | `RuntimeError: CUDA out of memory` | Sequence too long | Use A100 or split prediction | |
| 159 | | `KeyError: 'iptm'` | Running monomer on complex | Use multimer preset | |
| 160 | | `FileNotFoundError: database` | Missing MSA databases | Use ColabFold MSA server | |
| 161 | | `TimeoutError` | MSA search slow | Reduce num_recycles | |
| 162 | |
| 163 | --- |
| 164 | |
| 165 | **Next**: `protein-qc` for filtering and ranking. |