
Bio Structural Biology Alphafold Predictions
- 3 installs
- 1.1k repo stars
- Updated July 25, 2026
- gptomics/bioskills
Download AlphaFold predicted protein structures from the EBI database and analyze pLDDT confidence and PAE matrices.
About
Downloads AlphaFold structures (PDB, mmCIF, PAE) by UniProt ID and extracts per-residue pLDDT confidence and predicted aligned error. A developer uses it to obtain and assess predicted structures for proteins lacking experimental data.
- Download and batch-fetch AF structures with availability and metadata checks
- Extract pLDDT from B-factors and plot PAE with confidence interpretation tables
Bio Structural Biology Alphafold Predictions by the numbers
- 3 all-time installs (skills.sh)
- Ranked #1,661 of 2,064 Data Science & ML skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/gptomics/bioskills --skill bio-structural-biology-alphafold-predictionsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 3 |
|---|---|
| repo stars | ★ 1.1k |
| Last updated | July 25, 2026 |
| Repository | gptomics/bioskills ↗ |
What it does
Download AlphaFold predicted protein structures from the EBI database and analyze pLDDT confidence and PAE matrices.
Files
AlphaFold Predictions
Download and analyze AlphaFold predicted protein structures from the AlphaFold Protein Structure Database.
Download Structures
Single Structure by UniProt ID
import requests
def download_alphafold(uniprot_id, output_dir='.'):
'''Download AlphaFold structure for UniProt accession'''
base_url = 'https://alphafold.ebi.ac.uk/files'
pdb_url = f'{base_url}/AF-{uniprot_id}-F1-model_v4.pdb'
cif_url = f'{base_url}/AF-{uniprot_id}-F1-model_v4.cif'
response = requests.get(pdb_url)
if response.status_code == 200:
output_path = f'{output_dir}/AF-{uniprot_id}-F1-model_v4.pdb'
with open(output_path, 'w') as f:
f.write(response.text)
return output_path
return None
pdb_file = download_alphafold('P04637') # Human p53Check Availability
def check_alphafold_exists(uniprot_id):
'''Check if AlphaFold prediction exists'''
url = f'https://alphafold.ebi.ac.uk/api/prediction/{uniprot_id}'
response = requests.get(url)
return response.status_code == 200
if check_alphafold_exists('P04637'):
print('AlphaFold structure available')Get Metadata
def get_alphafold_info(uniprot_id):
'''Get AlphaFold prediction metadata'''
url = f'https://alphafold.ebi.ac.uk/api/prediction/{uniprot_id}'
response = requests.get(url)
if response.status_code == 200:
return response.json()[0]
return None
info = get_alphafold_info('P04637')
print(f"Gene: {info['gene']}")
print(f"Organism: {info['organismScientificName']}")
print(f"Model version: {info['latestVersion']}")File Types Available
Database version v4 (current as of 2025). The version number refers to the database release, not the AlphaFold model version.
| File | URL Pattern | Description |
|---|---|---|
| PDB | AF-{id}-F1-model_v4.pdb | Structure coordinates |
| mmCIF | AF-{id}-F1-model_v4.cif | Structure with metadata |
| PAE JSON | AF-{id}-F1-predicted_aligned_error_v4.json | Predicted aligned error |
def download_pae(uniprot_id, output_dir='.'):
'''Download PAE (predicted aligned error) matrix'''
url = f'https://alphafold.ebi.ac.uk/files/AF-{uniprot_id}-F1-predicted_aligned_error_v4.json'
response = requests.get(url)
if response.status_code == 200:
output_path = f'{output_dir}/AF-{uniprot_id}-F1-pae.json'
with open(output_path, 'w') as f:
f.write(response.text)
return output_path
return NoneAnalyze pLDDT Confidence Scores
Extract from PDB B-factors
AlphaFold stores pLDDT scores in the B-factor column.
from Bio.PDB import PDBParser
def extract_plddt(pdb_file):
'''Extract pLDDT confidence scores from AlphaFold PDB'''
parser = PDBParser(QUIET=True)
structure = parser.get_structure('protein', pdb_file)
residue_plddt = {}
for model in structure:
for chain in model:
for residue in chain:
if residue.id[0] == ' ': # Standard residue
ca = residue['CA'] if 'CA' in residue else list(residue.get_atoms())[0]
residue_plddt[residue.id[1]] = ca.get_bfactor()
return residue_plddt
plddt = extract_plddt('AF-P04637-F1-model_v4.pdb')
avg_plddt = sum(plddt.values()) / len(plddt)
print(f'Average pLDDT: {avg_plddt:.1f}')Confidence Interpretation
| pLDDT | Confidence | Interpretation |
|---|---|---|
| >90 | Very high | High accuracy, can be used as experimental |
| 70-90 | Confident | Good backbone, may have sidechain errors |
| 50-70 | Low | Caution, may be disordered |
| <50 | Very low | Likely disordered or wrong |
Plot pLDDT per Residue
import matplotlib.pyplot as plt
def plot_plddt(plddt_dict, output='plddt_plot.png'):
residues = sorted(plddt_dict.keys())
scores = [plddt_dict[r] for r in residues]
plt.figure(figsize=(12, 4))
plt.fill_between(residues, scores, alpha=0.3)
plt.plot(residues, scores)
plt.axhline(y=70, color='orange', linestyle='--', label='Confident threshold')
plt.axhline(y=90, color='green', linestyle='--', label='Very high threshold')
plt.xlabel('Residue')
plt.ylabel('pLDDT')
plt.ylim(0, 100)
plt.legend()
plt.savefig(output)
plt.close()
plot_plddt(plddt)Analyze PAE (Predicted Aligned Error)
import json
import numpy as np
import matplotlib.pyplot as plt
def load_pae(pae_file):
'''Load PAE matrix from JSON'''
with open(pae_file) as f:
data = json.load(f)
# AlphaFold v4 format
if 'predicted_aligned_error' in data[0]:
return np.array(data[0]['predicted_aligned_error'])
# Older format
return np.array(data['predicted_aligned_error'])
def plot_pae(pae_matrix, output='pae_plot.png'):
plt.figure(figsize=(8, 8))
plt.imshow(pae_matrix, cmap='Greens_r', vmin=0, vmax=30)
plt.colorbar(label='Expected position error (A)')
plt.xlabel('Scored residue')
plt.ylabel('Aligned residue')
plt.title('Predicted Aligned Error')
plt.savefig(output)
plt.close()
pae = load_pae('AF-P04637-F1-pae.json')
plot_pae(pae)PAE Interpretation
- Low PAE (green): Residues have well-defined relative positions
- High PAE (white): Uncertain relative positions (flexible linkers, domains)
- Diagonal blocks: Distinct structural domains
Batch Download
def batch_download_alphafold(uniprot_ids, output_dir='.'):
'''Download multiple AlphaFold structures'''
import os
os.makedirs(output_dir, exist_ok=True)
results = {}
for uid in uniprot_ids:
pdb_file = download_alphafold(uid, output_dir)
results[uid] = pdb_file
if pdb_file:
print(f'Downloaded: {uid}')
else:
print(f'Not found: {uid}')
return results
ids = ['P04637', 'P53_HUMAN', 'Q9Y6K9']
files = batch_download_alphafold(ids, 'alphafold_structures')Compare with Experimental Structure
from Bio.PDB import PDBParser, Superimposer
def compare_structures(alphafold_pdb, experimental_pdb):
'''Calculate RMSD between AlphaFold and experimental structure'''
parser = PDBParser(QUIET=True)
af_struct = parser.get_structure('af', alphafold_pdb)
exp_struct = parser.get_structure('exp', experimental_pdb)
# Get CA atoms from first chain
af_atoms = [r['CA'] for r in af_struct[0].get_residues() if 'CA' in r]
exp_atoms = [r['CA'] for r in exp_struct[0].get_residues() if 'CA' in r]
# Align by length (simple approach)
min_len = min(len(af_atoms), len(exp_atoms))
af_atoms = af_atoms[:min_len]
exp_atoms = exp_atoms[:min_len]
super_imposer = Superimposer()
super_imposer.set_atoms(exp_atoms, af_atoms)
rmsd = super_imposer.rms
return rmsdRelated Skills
- structural-biology/structure-io - Load and parse PDB/mmCIF files
- structural-biology/geometric-analysis - RMSD, superimposition
- database-access/uniprot-access - Get UniProt IDs for proteins
- structural-biology/structure-navigation - Navigate structure hierarchy
import requests
import os
from Bio.PDB import PDBParser
def download_alphafold(uniprot_id, output_dir='.'):
os.makedirs(output_dir, exist_ok=True)
base_url = 'https://alphafold.ebi.ac.uk/files'
pdb_url = f'{base_url}/AF-{uniprot_id}-F1-model_v4.pdb'
response = requests.get(pdb_url)
if response.status_code != 200:
print(f'Not found: {uniprot_id}')
return None
pdb_path = f'{output_dir}/AF-{uniprot_id}-F1-model_v4.pdb'
with open(pdb_path, 'w') as f:
f.write(response.text)
print(f'Downloaded: {pdb_path}')
return pdb_path
def analyze_plddt(pdb_file):
parser = PDBParser(QUIET=True)
structure = parser.get_structure('protein', pdb_file)
plddt_scores = []
for residue in structure[0].get_residues():
if residue.id[0] == ' ' and 'CA' in residue:
plddt_scores.append(residue['CA'].get_bfactor())
return {
'mean': sum(plddt_scores) / len(plddt_scores),
'min': min(plddt_scores),
'max': max(plddt_scores),
'n_residues': len(plddt_scores),
'high_confidence': sum(1 for s in plddt_scores if s > 70) / len(plddt_scores) * 100
}
if __name__ == '__main__':
pdb_file = download_alphafold('P04637', 'alphafold_structures')
if pdb_file:
stats = analyze_plddt(pdb_file)
print(f"\npLDDT Statistics:")
print(f" Mean: {stats['mean']:.1f}")
print(f" Range: {stats['min']:.1f} - {stats['max']:.1f}")
print(f" Residues: {stats['n_residues']}")
print(f" High confidence (>70): {stats['high_confidence']:.1f}%")
AlphaFold Predictions - Usage Guide
Overview
Download and analyze AI-predicted protein structures from the AlphaFold database, including confidence scores (pLDDT) and predicted aligned error (PAE) for assessing prediction quality.
Prerequisites
pip install biopython requests numpyQuick Start
Tell your AI agent what you want to do:
- "Download the AlphaFold structure for UniProt P04637"
- "Check the confidence scores for this AlphaFold prediction"
- "Identify low-confidence regions in this predicted structure"
Example Prompts
Downloading Structures
"Download the AlphaFold model for UniProt ID P53_HUMAN"
"Get the AlphaFold structure for P04637 in mmCIF format"
"Fetch AlphaFold predictions for these 5 UniProt IDs"
Analyzing Confidence
"Show me the pLDDT scores for this AlphaFold structure"
"Which regions have low confidence (pLDDT < 70)?"
"Plot the per-residue confidence scores"
PAE Analysis
"Download and visualize the PAE matrix for this protein"
"Identify domain boundaries from the PAE data"
"Which domain-domain interactions are reliable?"
Quality Assessment
"Compare this AlphaFold prediction with the experimental structure"
"Highlight the confident vs disordered regions"
"Is this prediction reliable enough for docking?"
What the Agent Will Do
1. Construct the AlphaFold database URL from UniProt ID 2. Download the structure file (PDB or mmCIF format) 3. Parse confidence scores from B-factor column (pLDDT) 4. Optionally fetch PAE matrix for inter-residue error estimates 5. Analyze and report on prediction quality
Database Access
Direct download URLs:
- Structure:
https://alphafold.ebi.ac.uk/files/AF-{UNIPROT_ID}-F1-model_v4.pdb - mmCIF:
https://alphafold.ebi.ac.uk/files/AF-{UNIPROT_ID}-F1-model_v4.cif - PAE:
https://alphafold.ebi.ac.uk/files/AF-{UNIPROT_ID}-F1-predicted_aligned_error_v4.json
API endpoint: https://alphafold.ebi.ac.uk/api/prediction/{UNIPROT_ID}
Confidence Score Interpretation
| pLDDT Range | Interpretation | Color (AlphaFold DB) |
|---|---|---|
| 90-100 | Very high confidence | Blue |
| 70-90 | Confident | Cyan |
| 50-70 | Low confidence | Yellow |
| <50 | Very low (likely disordered) | Orange |
Tips
- Check pLDDT before using - Regions with pLDDT < 70 should be treated cautiously
- Use PAE for domains - Low PAE between residues indicates reliable relative positioning
- B-factor column holds pLDDT - Parse with Bio.PDB and read
atom.bfactor - Single conformation only - AlphaFold predicts one state, not conformational ensembles
- Compare when possible - Validate against experimental structures if available
- 200M+ structures available - Coverage includes most UniProt sequences