agentsclimarketplace

Alphafold database access

Skill findscripter/everything-skills/09-verticals/alphafold-database-access

类书式 AI Agent 技能大典 · 精选/中文化/互见成网的 500+ 开源技能,可作为 Claude Code 插件市场一键安装。A curated, cross-referenced encyclopedia of 500+ open-source agent skills.

Install
npx -y skills add findscripter/everything-skills --skill alphafold-database-access

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

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 1 stars1 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

当需要按 UniProt ID 获取 AlphaFold 预测的蛋白 3D 结构、置信度或批量蛋白组数据时使用;用 BioPython/REST API/Google Cloud 下载 mmCIF/PDB 并分析 pLDDT 与 PAE,产出结构文件、置信度报告与高可信区域。不适用于实验结构(用 PDB)或自行跑预测(用 ColabFold/本地 AlphaFold)。触发词:AlphaFold、UniProt、pLDDT、PAE、蛋白结构预测、蛋白组下载

The file declares its own license as CC-BY-4.0. 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

6.4 KB, ~2.0k tokens by cl100k_base, as published. Nobody here has run it

何时使用

适用:

  • 按 UniProt 登录号检索 AI 预测蛋白结构,下载 mmCIF/PDB 用于结构分析或对接。
  • 分析预测置信度:pLDDT(每残基)、PAE(结构域级相对定位)。
  • 经 Google Cloud 批量下载整个物种蛋白组预测。
  • 为缺乏实验数据的蛋白搭建结构模型、识别高可信结合位点、与 PDB 实验结构比对。

不该用(负边界):

  • 只需实验结构 → 直接用 PDB,不要用预测模型。
  • 要自己运行 AlphaFold 预测 → 用 ColabFold 或本地 AlphaFold,本技能只做"访问已有数据库"。
  • 预测模型不含配体、PTM、辅因子与多链上下文;高 pLDDT 不等于功能正确性,勿据此直接下功能结论。

步骤 / 指令

  1. 装依赖:pip install biopython requests numpy matplotlib;批量另装 pip install google-cloud-bigquery google-cloud-storage(BioPython 需 ≥1.80)。
  2. 检索预测元数据(单蛋白首选 BioPython)。
  3. 下载坐标文件(优先 mmCIF)与置信度/PAE JSON。
  4. 分析 pLDDT 分级、绘制 PAE 矩阵、抽取高可信区域。
  5. 大批量(>100 蛋白或整蛋白组)改走 Google Cloud(gsutil/BigQuery),顺序请求间隔 100–200ms,并发 ≤10。

关键约束:

  • AlphaFold ID 格式 AF-{UniProt}-F{片段号}(如 AF-P00520-F1);大蛋白(>2700 残基)拆 F1/F2…须逐片段检查。
  • 当前库版本 v4,所有文件 URL 必须带 _v4 后缀,可复现分析中固定版本号。
  • pLDDT 以 B-factor 存于结构文件。
  • 文件基址 https://alphafold.ebi.ac.uk/files/

置信度判读表

指标范围判读适用
pLDDT >90极高主链+侧链可靠精细分析、对接
pLDDT 70–90主链总体可靠折叠/结构域识别
pLDDT 50–70谨慎使用可能柔性/无序
pLDDT <50极低很可能无序从分析中剔除
PAE <5Å可信结构域相对位置可靠多域装配
PAE 5–10Å中等排布不确定各域独立处理
PAE >15Å不确定域可能可动勿信朝向

示例

检索 + 下载 + 看置信度:

from Bio.PDB import alphafold_db
import requests, numpy as np

uniprot_id = "P00520"  # ABL1 激酶
preds = list(alphafold_db.get_predictions(uniprot_id))
af_id = preds[0]['entryId']                                   # AF-P00520-F1
cif_file = alphafold_db.download_cif_for(preds[0], directory="./structures")

conf = requests.get(f"https://alphafold.ebi.ac.uk/files/{af_id}-confidence_v4.json").json()
scores = conf['confidenceScore']
print(f"平均 pLDDT: {np.mean(scores):.1f}, 高可信残基: {sum(1 for s in scores if s>90)}/{len(scores)}")

REST API(取下载 URL,便于集成):

data = requests.get(f"https://alphafold.ebi.ac.uk/api/prediction/{uniprot_id}").json()
pred = data[0]
print(pred['cifUrl'], pred['pdbUrl'], pred['paeDocUrl'])

下载文件(mmCIF 推荐;PDB 仅限 <99999 原子;bcif 体积小约 70%):

base = "https://alphafold.ebi.ac.uk/files"
cif = requests.get(f"{base}/{af_id}-model_v4.cif")
open(f"{af_id}.cif", "w").write(cif.text)
pae = requests.get(f"{base}/{af_id}-predicted_aligned_error_v4.json").json()
pae_matrix = np.array(pae['distance'])   # N×N,按设计非对称,聚类前需对称化

PAE 可视化(低 PAE 区=可信相对定位):

import matplotlib.pyplot as plt
plt.imshow(pae_matrix, cmap='viridis_r', vmin=0, vmax=30)
plt.colorbar(label='PAE (Å)'); plt.savefig(f'{af_id}_pae.png', dpi=300, bbox_inches='tight')

批量经 Google Cloud:

gsutil ls gs://public-datasets-deepmind-alphafold-v4/
# 按物种 taxonomy ID 下载整蛋白组(人 9606 / E.coli 83333 / 小鼠 10090)
gsutil -m cp gs://public-datasets-deepmind-alphafold-v4/proteomes/proteome-tax_id-9606-*_v4.tar .
gsutil cp gs://public-datasets-deepmind-alphafold-v4/accession_ids.csv .

BigQuery 筛高可信人源蛋白:

SELECT entryId, uniprotAccession, gene, globalMetricValue, fractionPlddtVeryHigh
FROM `bigquery-public-data.deepmind_alphafold.metadata`
WHERE organismScientificName = 'Homo sapiens'
  AND fractionPlddtVeryHigh > 0.8 AND isReviewed = TRUE
LIMIT 100

注意事项

  • 单蛋白用 BioPython,>100 蛋白/整蛋白组用 Google Cloud(并行快若干数量级)。
  • 下游分析前务必先查 pLDDT,剔除 <50 的无序区,再做对接/接触图/结合位点预测。
  • 多域蛋白用 PAE 而非仅 pLDDT 判断域朝向是否可信。
  • 本地缓存已下载文件(同版本文件为静态),避免重复下载。
  • 常见错误:404=该 UniProt 无预测;429=超速率限制,加 time.sleep(0.2) 或转 GCS;预测列表空=ID 不在库内或用规范同种型;ModuleNotFoundError: Bio.PDB.alphafold_db=升级 biopython>=1.80;GCS 失败=gcloud auth login 或用公共数据匿名访问。

互见

  • autodock-vina:以 AlphaFold 结构为受体做分子对接。
  • biopython:AlphaFold 之外的通用蛋白结构解析与分析。
  • 参考:AlphaFold DB https://alphafold.ebi.ac.uk/ ;Jumper et al. (2021) Nature 596;583 ;Varadi et al. (2024) NAR 52,D368。

采编自 jaechang-hits/SciAgent-Skills(CC-BY-4.0)。

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 327,132. 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.