# Alphafold

Validate protein designs using AlphaFold2 structure prediction.

- Repository: https://github.com/FreedomIntelligence/OpenClaw-Medical-Skills (3090 stars)
- Category: Design
- License: MIT
- Last updated: 2026-07-21
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill alphafold -g -a claude-code -y`
Codex: `npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill alphafold -g -a codex -y`
Cursor: `npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill alphafold -g -a cursor -y`
Gemini CLI: `npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill alphafold -g -a gemini-cli -y`

## Description

Validate 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 designs, (5) Multi-chain complex prediction with AlphaFold-Multimer. For faster single-chain prediction, use esm. For QC thresholds, use protein-qc.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# AlphaFold2 Structure Validation

## Prerequisites

| Requirement | Minimum | Recommended |
|-------------|---------|-------------|
| Python | 3.8+ | 3.10 |
| CUDA | 11.0+ | 12.0+ |
| GPU VRAM | 32GB | 40GB (A100) |
| RAM | 32GB | 64GB |
| Disk | 100GB | 500GB (for databases) |

## How to run

> **First time?** See [Installation Guide](../../docs/installation.md) to set up Modal and biomodals.

### Option 1: ColabFold (recommended for multimer)
```bash
cd biomodals
modal run modal_colabfold.py \
  --input-faa sequences.fasta \
  --out-dir output/
```

**GPU**: A100 (40GB) | **Timeout**: 3600s default

### Option 2: Local installation
```bash
git clone https://github.com/deepmind/alphafold.git
cd alphafold

python run_alphafold.py \
  --fasta_paths=query.fasta \
  --output_dir=output/ \
  --model_preset=monomer \
  --max_template_date=2026-01-01
```

### Option 3: ESMFold (fast single-chain)
```bash
modal run modal_esmfold.py \
  --sequence "MKTAYIAKQRQISFVK..."
```

## Key parameters

| Parameter | Default | Options | Description |
|-----------|---------|---------|-------------|
| `--model_preset` | monomer | monomer/multimer | Model type |
| `--num_recycle` | 3 | 1-20 | Recycling iterations |
| `--max_template_date` | - | YYYY-MM-DD | Template cutoff |
| `--use_templates` | True | True/False | Use template search |

## Output format

```
output/
├── ranked_0.pdb           # Best model
├── ranked_1.pdb           # Second best
├── ranking_debug.json     # Confidence scores
├── result_model_1.pkl     # Full results
├── msas/                  # MSA files
└── features.pkl           # Input features
```

### Extracting metrics
```python
import pickle

with open('result_model_1.pkl', 'rb') as f:
    result = pickle.load(f)

plddt = result['plddt']
ptm = result['ptm']
iptm = result.get('iptm', None)  # Multimer only
pae = result['predicted_aligned_error']
```

## Sample output

The rest: https://github.com/FreedomIntelligence/OpenClaw-Medical-Skills/blob/HEAD/skills/alphafold/SKILL.md
