agentsclimarketplace

Alphafold

Skill naity/FM4Life/skills/alphafold

Skills for life science foundation models — structured knowledge bundles that let AI coding agents work with ESM, AlphaFold, RFdiffusion, DiffDock, scGPT, and more out of the box.

Install
npx -y skills add naity/FM4Life --skill alphafold

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Skill for protein structure prediction and analysis with AlphaFold. Use this skill whenever a user wants to predict or fetch a protein 3D structure, download structures from the AlphaFold Database (AFDB), run ColabFold for novel proteins, parse pLDDT confidence scores or PAE (predicted aligned error) from AlphaFold outputs, predict structures of protein complexes or multimers, or work with AlphaFold3 for proteins with DNA/RNA/small molecules. Also trigger when the user mentions AlphaFold, AF2, AF3, AFDB, ColabFold, pLDDT, PAE, predicted aligned error, protein folding, or structure prediction from sequence.

The file declares its own license as Apache-2.0 (code); CC BY 4.0 (model parameters). That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

9.4 KB, as published. Nobody here has run it

AlphaFold: Protein Structure Prediction

Overview

AlphaFold is DeepMind's protein structure prediction system. Most users don't need to install AlphaFold locally — there are faster, lighter alternatives that cover the majority of use cases:

NeedBest approach
Known UniProt proteinAFDB API — fetch precomputed structure instantly
Novel protein sequenceColabFold — no local databases needed
Novel protein, batch/HPCLocal AF2 (Docker) — full pipeline
Protein + DNA/RNA/ligandAlphaFold3 (web server or local)
Fast, no MSAESMFold (see skills/esm2)

Approach 1: AlphaFold Database (AFDB) API

The AFDB covers >200 million proteins from UniRef90 with precomputed structures. If your protein has a UniProt accession, fetch it in seconds — no GPU, no installation.

import requests

def fetch_afdb_structure(uniprot_id: str, output_dir: str = ".") -> dict:
    """
    Fetch AlphaFold structure for a UniProt ID.
    Returns metadata dict with paths to downloaded files.
    """
    from pathlib import Path

    # Get prediction metadata
    url = f"https://alphafold.ebi.ac.uk/api/prediction/{uniprot_id}"
    response = requests.get(url)
    response.raise_for_status()
    prediction = response.json()[0]  # list with one entry

    out_dir = Path(output_dir)
    out_dir.mkdir(parents=True, exist_ok=True)
    downloaded = {}

    # Download PDB
    pdb_url = prediction["pdbUrl"]
    pdb_path = out_dir / f"{uniprot_id}.pdb"
    pdb_path.write_bytes(requests.get(pdb_url).content)
    downloaded["pdb"] = str(pdb_path)

    # Download PAE JSON (pairwise confidence)
    if pae_url := prediction.get("paeDocUrl"):
        pae_path = out_dir / f"{uniprot_id}_pae.json"
        pae_path.write_bytes(requests.get(pae_url).content)
        downloaded["pae"] = str(pae_path)

    print(f"Downloaded {uniprot_id}: {pdb_path}")
    print(f"  pLDDT (mean): {prediction.get('globalMetricValue', 'N/A'):.1f}")
    print(f"  Model: {prediction.get('modelCreatedDate', 'N/A')}")
    return downloaded

# Example
files = fetch_afdb_structure("P00533")  # EGFR

See scripts/fetch_afdb.py for a CLI to batch-fetch many proteins.

Find a UniProt ID by gene/protein name

def find_uniprot_id(query: str, organism: str = "human") -> list[dict]:
    """Search UniProt by gene name or protein name."""
    url = "https://rest.uniprot.org/uniprotkb/search"
    params = {
        "query": f"{query} AND organism_name:{organism}",
        "format": "json",
        "fields": "accession,protein_name,gene_names,length",
        "size": 5,
    }
    r = requests.get(url, params=params)
    r.raise_for_status()
    results = r.json()["results"]
    return [
        {
            "uniprot_id": e["primaryAccession"],
            "name": e.get("proteinDescription", {}).get("recommendedName", {}).get("fullName", {}).get("value", ""),
            "gene": e.get("genes", [{}])[0].get("geneName", {}).get("value", ""),
            "length": e.get("sequence", {}).get("length", 0),
        }
        for e in results
    ]

hits = find_uniprot_id("EGFR", organism="human")
for h in hits:
    print(h)

Approach 2: ColabFold (Novel Proteins)

ColabFold uses MMseqs2 for fast MSA generation (no local databases needed) and runs AlphaFold2 on top. It's the practical choice for novel proteins not in the AFDB.

Installation

pip install colabfold[alphafold-without-jax]
# Then install JAX with GPU support:
pip install "jax[cuda12]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html

Or use LocalColabFold for a fully self-contained install:

# See: https://github.com/YoshitakaMo/localcolabfold

Running ColabFold

# Single sequence / batch
colabfold_batch input.fasta output_dir/

# With templates (more accurate, slower)
colabfold_batch input.fasta output_dir/ --templates

# Multimer (protein complex)
colabfold_batch complex.fasta output_dir/ --model-type alphafold2_multimer_v3

# Fewer recycles for speed (default 3)
colabfold_batch input.fasta output_dir/ --num-recycle 1

Input FASTA for a monomer:

>protein_name
MKTAYIAKQRQISFVKSHFSRQLEERLGLIEVQAPILSRVGD...

Input FASTA for a complex (chain break with : in sequence or multiple entries):

>chainA
MKTAYIAKQRQISFVK
>chainB
AGLIVHSPQWFYK

ColabFold outputs the same file format as AlphaFold2 (see Output Formats below).

Approach 3: Local AlphaFold2 (Docker)

Only needed when running at scale, on an HPC, or when reproducibility with official AF2 matters. Requires:

  • Linux (macOS/Windows not supported)
  • NVIDIA GPU (A100 recommended)
  • ~2.62 TB disk for databases (SSD preferred)
# Clone and build
git clone https://github.com/google-deepmind/alphafold.git && cd alphafold
docker build -f docker/Dockerfile -t alphafold .

# Download databases (~556 GB download, ~2.62 TB unzipped)
scripts/download_all_data.sh /data/alphafold

# Run a monomer
python3 docker/run_docker.py \
  --fasta_paths=protein.fasta \
  --max_template_date=2022-01-01 \
  --model_preset=monomer \
  --data_dir=/data/alphafold \
  --output_dir=/results/

# Run a multimer (protein complex)
python3 docker/run_docker.py \
  --fasta_paths=complex.fasta \
  --model_preset=multimer \
  --data_dir=/data/alphafold \
  --output_dir=/results/

Model presets:

  • monomer — single chain, CASP14 model (recommended default)
  • monomer_ptm — adds pTM and PAE outputs
  • multimer — protein complexes (runs 25 predictions: 5 models × 5 seeds)

Database presets:

  • full_dbs — full accuracy (default)
  • reduced_dbs — faster, needs only ~600 GB, still good quality

AlphaFold3

AlphaFold3 handles proteins, DNA, RNA, small molecules, and ions in a single unified model. Released May 2024.

AF3 is the right choice when your system contains ligands, nucleic acids, or post-translational modifications.

Output Formats

All AlphaFold variants produce the same core outputs:

output_dir/
├── ranked_0.pdb          ← best structure (highest mean pLDDT)
├── ranked_1.pdb          ← second best, etc.
├── relaxed_model_1.pdb   ← after Amber energy minimization
├── unrelaxed_model_1.pdb ← raw model output
├── result_model_1.pkl    ← raw numpy arrays (pLDDT, PAE, distogram)
├── ranking_debug.json    ← pLDDT scores for each model
└── timings.json

pLDDT (0–100) is stored in the B-factor column of PDB files. Higher = more confident. Thresholds:

  • 90–100: very high confidence (dark blue in AF2 coloring)
  • 70–90: confident (light blue)
  • 50–70: low confidence (yellow)
  • < 50: very low confidence, likely disordered (orange/red)

See references/outputs.md for parsing pLDDT and PAE programmatically.

Scripts

# Fetch one or many proteins from AFDB by UniProt ID
python scripts/fetch_afdb.py P00533 P38398 Q9Y6K9 --output-dir structures/

# Fetch from a text file of UniProt IDs (one per line)
python scripts/fetch_afdb.py --from-file uniprot_ids.txt --output-dir structures/

Choosing Between AlphaFold and ESMFold

AlphaFold2 (via AFDB/ColabFold)ESMFold
AccuracyHigher (uses MSA)Lower but still good
SpeedSlower (MSA generation)Seconds per protein
DependenciesMMseqs2 (ColabFold) or AFDBHuggingFace transformers
Precomputed DBYes (AFDB)No
Ligand/DNA/RNANo (AF3 only)No

Use ESMFold when you need fast, large-scale folding with no MSA. Use AlphaFold when accuracy matters or the structure is in the AFDB.

Resources

References

  • references/outputs.md — parsing pLDDT, PAE, distogram from PDB and pickle outputs; confidence interpretation
  • references/colabfold.md — ColabFold installation options, MSA customization, advanced run options

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.