mcpField
G
gnomad-database

gnomad-database

github.com/google-deepmind数据与数据库3.4k2.1k 次安装5 天前更新
代码仓库

关于 gnomad-database

用于查询 gnomAD 遗传变异与约束数据的命令行技能,适合需要分析变异频率、基因约束指标或检索变异的基因组研究者;通过脚本查询并处理 API 速率限制。

主要功能

  1. 01按祖源查询等位基因频率
  2. 02纯合子计数与过滤频率
  3. 03基因约束指标
  4. 04按区域或基因搜索变异

适用场景

  1. 01比较变异在不同祖源中的频率
  2. 02查看 pLI 和 LOEUF 约束指标
  3. 03查找基因组区域内的变异
  4. 04按后果类型搜索基因变异

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/google-deepmind/science-skills --skill gnomad-database

安装后在 Claude Code 中输入/gnomad-database确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

references/
citation.bib
scripts/
get_gene_constraint.py
get_variant_frequency.py
search_variants.py

详细介绍

gnomAD 数据库

先决条件

  1. uv:阅读 uv 技能,并按照其中的设置说明操作,确保已安装 uv 且其位于 PATH 中。
  2. 用户通知:如果工作区根目录中尚不存在 .licenses/gnomad_database_LICENSE.txt,则 (1) 显著提醒用户查看 https://gnomad.broadinstitute.org/policies 和 https://gnomad.broadinstitute.org/data#api 中的条款,然后 (2) 创建该文件,记录通知文本和时间戳。

核心规则

  • 使用封装脚本:查询数据库时,始终执行提供的辅助脚本,而不是直接访问数据库。这些脚本会自动妥善遵守 gnomAD API 速率限制。
  • 通知:如果使用了此技能,请确保在输出中提及。

实用脚本

所有脚本都位于此技能安装目录下的 scripts/ 子目录中。运行脚本时,请使用脚本的绝对路径(例如 /path/to/gnomad_database/scripts/get_variant_frequency.py)。

**1. 变异频率。**检索外显子组、基因组以及总计(外显子组与基因组合并)数据中的全球和祖源特异性等位基因频率、纯合子计数以及 Grpmax Filtering AF(faf95/faf99)。过滤等位基因频率(FAF)是最大可信遗传祖源群体 AF(95% 或 99% 置信区间的下限)。变异 ID 格式必须为 chrom-pos-ref-alt(例如 1-55516888-G-GA)。或者,也可以提供 rsID。

# By variant ID:
uv run scripts/get_variant_frequency.py --variant_id {variant_id} [--dataset {dataset}] --output variant_frequency.json

# By rsID (e.g., rs1800562):
uv run scripts/get_variant_frequency.py --rsid {rsid} [--dataset {dataset}] --output variant_frequency.json

**2. 基因约束。**检索某个基因的约束指标。响应中会明确包含 pli,而 LOEUF 分数以 oe_lof_upper 表示。

uv run scripts/get_gene_constraint.py --gene {gene_symbol} --output {gene_symbol}_constraint.json

**3. 区域/基因变异搜索。**查找某个区域或基因中的所有变异。

# By region:
uv run scripts/search_variants.py --chrom {chrom} --start {start} --end {end} --output region_variants.json
# By gene:
uv run scripts/search_variants.py --gene {gene_symbol} --consequence {pLoF|missense} --output {gene_symbol}_variants.json

参考资料

有关数据的更多文档:https://gnomad.broadinstitute.org/data#api 更全面的数据库文档:https://gnomad.broadinstitute.org/help

评论

支持 Markdown