Logo vun Alphafold Db

Alphafold Db

Communautéit
ssinder
alphafold-db

Downloads predicted protein structures from the EBI AlphaFold Database API and exports per-protein prediction metadata. Resolves the current PDB/CIF download URL from the API instead of hard-coding a model version, supports batch accession lists, resumable downloads, pLDDT-based quality filtering before spending bandwidth, and validates response content types so HTML error pages are never mistaken for structure files. This skill should be used when fetching AlphaFold models, retrieving predicted structures by UniProt accession, or collecting AlphaFold confidence metrics (pLDDT) is requested.

Iwwersiicht

Editeurssinder
Repositorybioinformatics-agent-skills
Skill-Nummalphafold-db
Stären
75
Forks
2
Matgeliwwert Fichieren
6
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 6 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum ssinder op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Alphafold Db an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/ssinder/bioinformatics-agent-skills/tree/main/skills/alphafold-db
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ssinder/bioinformatics-agent-skills.git /tmp/bioinformatics-agent-skills
mkdir -p .claude/skills
cp -r /tmp/bioinformatics-agent-skills/skills/alphafold-db .claude/skills/alphafold-db
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Alphafold Db an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Alphafold Db automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Alphafold Db net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

AlphaFold DB Structure Retrieval

Overview

This skill retrieves AlphaFold protein structure predictions from the EBI AlphaFold Database and exports the accompanying confidence metadata. It addresses the single biggest fragility in naive AlphaFold download scripts: the model version number is not stable. The AlphaFold DB retrains models periodically and increments the version suffix (model_v6 → model_v7, …), so any script that builds the URL as AF-{ACCESSION}-F1-model_v6.pdb will silently start returning 404s.

Instead, this skill calls GET /api/prediction/{accession} and takes the pdbUrl field straight from the response — the server always points at the current valid model. The same response also carries per-protein confidence metrics (global pLDDT and the residue fractions in each confidence band) which are free and can be used to filter low-quality models before downloading anything.

The skill also handles the second half of the AlphaFold workflow: selecting the best model from a multi-sample prediction and converting it to PDB format.

When to Use This Skill

  • Fetching predicted structures for a list of UniProt accessions
  • Collecting AlphaFold confidence metrics (pLDDT) without downloading structures
  • Screening a proteome for low-confidence regions before committing to downloads
  • Refreshing an existing structure collection after AlphaFold DB publishes new models
  • Populating a docking or interaction-analysis project with predicted coordinates
  • Picking the highest-confidence model out of an AlphaFold Server / ColabFold / AlphaFold DB prediction package and converting it to PDB

Quick Start

bash
export PYTHONPATH="$PWD/packages"

# 批量下载(ID 文件,每行一个)
python scripts/download_structures.py --ids ids.txt --output-dir structures/

# 直接给 ID
python scripts/download_structures.py --ids P69905 P04637 --output-dir structures/

# 只要元数据,不要 PDB(最快,用于先做质量筛选)
python scripts/download_structures.py --ids ids.txt --metadata-only --output-dir meta/

# 先按 pLDDT 过滤再下载,跳过低质量模型
python scripts/download_structures.py --ids ids.txt --min-plddt 70 --output-dir structures/

# 保留 AlphaFold 原始文件名
python scripts/download_structures.py --ids ids.txt --output-dir structures/ --keep-original-name

# 从多模型预测包里选最佳模型并转成 PDB
python scripts/select_best_model.py --input-dir folds/ --output-dir best/

# 只要排名表,不做转换
python scripts/select_best_model.py --input-dir folds/ --rank-only

Workflow

  1. Collect accessions — --ids accepts either a text file (one accession per line, # for comments) or accession strings directly. A leading header line is detected by pattern rather than skipped unconditionally, so a pure-ID file never loses its first entry.
  2. Query the API — alphafold_client.fetch_predictions() issues one request per accession through the shared http_session (exponential-backoff retry + rate limiting). The API returns a JSON array for a single accession, not an object; the client normalises list / dict / error-object shapes into one record type.
  3. Export metadata — every record is written to alphafold_metadata.csv and .json, including global_plddt and the four confidence-band fractions.
  4. Filter (optional) — with --min-plddt, models below the threshold are counted as filtered and never downloaded.
  5. Download — each pdbUrl is fetched with the response Content-Type checked against the expected PDB types and the payload written as bytes. Files that already exist are skipped unless --force is given.
  6. Report — a summary line reports downloaded / skipped / filtered / failed counts and lists the failed accessions.

Parameters

download_structures.py

ParameterDefaultDescription
--idsrequiredAccession list or path(s) to text files containing accessions
--output-diralphafold_structuresOutput directory for structures and metadata
--metadata-onlyoffQuery and export metadata only; skip file downloads
--min-plddtnoneSkip models whose global pLDDT is below this value (0–100)
--forceoffRe-download files that already exist
--keep-original-nameoffKeep AF-{ID}-F1-model_vN.pdb instead of {ID}.pdb
--timeout120Per-request timeout in seconds

select_best_model.py

ParameterDefaultDescription
--input-dirrequiredDirectory holding the prediction package (structures + summary_confidences_*.json)
--output-dir<input>_selectedWhere the selected model and ranking tables are written
--rank-onlyoffOnly write the ranking table; convert nothing
--rank-byranking_scoreMetric used for ordering: ranking_score / ptm / iptm / mean_plddt
--keep-alloffConvert every model instead of only the best one
--no-convertoffCopy the original files without converting CIF → PDB

Outputs

FileContent
{accession}.pdbDownloaded AlphaFold prediction (or AF-{ID}-F1-model_vN.pdb with --keep-original-name)
alphafold_metadata.csvOne row per protein: accession, gene, description, organism, model version, global pLDDT, confidence-band fractions, structure URLs
alphafold_metadata.jsonSame content as nested JSON
model_ranking.csvOne row per model: position, rank, file names, ranking_score, pTM, ipTM, mean pLDDT, disorder, clash
model_ranking.jsonSame content as nested JSON (plus the rank_by key used)
{structure_stem}.pdbThe selected model converted to PDB format

Validation

  • A downloaded file is really a PDB — the first lines must contain HEADER or ATOM records, and the last line should be END. A file containing HTML (<!DOCTYPE html>) means the server returned an error page; the script's Content-Type check rejects most such cases, but verify if a file is unusually small.
  • pLDDT sanity — AlphaFold's mean per-residue pLDDT is global_plddt. Globular proteins typically sit at 70–95; values below 50 indicate extensive low-confidence regions (often disorder), and values above 95 are unusual.
  • Confidence bands sum to 1 — fraction_plddt_very_low + fraction_plddt_low + fraction_plddt_confident + fraction_plddt_very_high should equal 1.0 (within rounding). A mismatch means the record was truncated.
  • Cross-check against UniProt — the sequence_length in the metadata must equal the UniProt entry length. A mismatch indicates the accession was mapped to a different isoform.
  • Coverage — roughly 230 million entries cover the UniProt reference proteomes; if many accessions report "no prediction", confirm the accessions are canonical rather than isoform or isoform-variant identifiers.
  • ranking_score is a ranking metric, not an accuracy metric — the official definition is 0.8 × ipTM + 0.2 × pTM + 0.5 × fraction_disordered − 100 × has_clash. It is designed to order predictions, not to be interpreted as "how good" the structure is. A structure with ranking_score = 1.0 is the best of its batch, not a 100%-accurate model.
  • PDB column alignment — PDB records are fixed-width. A converted file must have the chain ID at column 22, the residue number at 23–26, and the coordinates at 31–38 / 39–46 / 47–54. Misaligned records are silently misread by every downstream tool, so check with awk 'substr($0,22,1)' if a structure looks off.

References

  • references/methodology.md — API semantics, version-resolution strategy, pLDDT interpretation
  • references/troubleshooting.md — common failures and how to diagnose them

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Alphafold Db?

Downloads predicted protein structures from the EBI AlphaFold Database API and exports per-protein prediction metadata. Resolves the current PDB/CIF download URL from the API instead of hard-coding a model version, supports batch accession lists, resumable downloads, pLDDT-based quality filtering before spending bandwidth, and validates response content types so HTML error pages are never mistaken for structure files. This skill should be used when fetching AlphaFold models, retrieving predicted structures by UniProt accession, or collecting AlphaFold confidence metrics (pLDDT) is requested.

Firwat Alphafold Db op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Alphafold Db besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Alphafold Db an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/ssinder/bioinformatics-agent-skills/tree/main/skills/alphafold-db an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Alphafold Db benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Alphafold Db benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Alphafold Db domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Alphafold Db gratis?

Jo. De Skill gëtt vum ssinder ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇