SuperAPI AI 工具集

gwas-catalog-skill

数据与分析

查看项目

更新于 10-16 03:05

技能介绍

用途:该技能通过统一脚本调用 GWAS Catalog REST API v2,帮助用户查询研究(studies)、关联(associations)、SNP、EFO 性状、基因、文献、位点及元数据等公开数据。

主要能力与路径:可用路径包括 metadata、studies、studies/<accession>、associations、snps、efoTraits、genes、publications、loci。脚本支持 params、headers、json_body、form_body、record_path、response_format、max_items、max_depth、timeout_sec、save_raw、raw_output_path 等可选字段,可通过 record_path 定位 _embedded.<resource> 列表。单资源端点(如 studies/<accession>)一般无需 max_items;集合端点建议先用 API 的 size=10 和 max_items=10。若需完整 HATEOAS 载荷或分页链接,可设 save_raw=true 并用 raw_output_path 保存。

使用方式:所有 API 调用都通过 scripts/rest_request.py 执行,base_url 为 https://www.ebi.ac.uk/gwas/rest/api/v2。脚本从 stdin 读取一个 JSON 对象,必填字段为 base_url 与 path。示例:echo '{"base_url":"https://www.ebi.ac.uk/gwas/rest/api/v2","path":"studies","params":{"efo_trait":"asthma","size":10},"record_path":"_embedded.studies","max_items":10}' | python scripts/rest_request.py。默认返回精简的 markdown 摘要;仅当用户明确需要机器可读输出时,才逐字返回脚本 JSON。成功返回 ok、source、path、method、status_code、warnings 以及紧凑记录或摘要;失败返回 ok=false 及 error.code、error.message。长对话中应重新发起请求,不要依赖较早的工具输出;工具预览中显示的 ... 视为界面截断,而非实际请求内容。运行时依赖仅限该文件与 scripts/rest_request.py,无需其它引用。

限制:只能访问上述 GWAS Catalog v2 API 提供的资源;具体字段含义、速率限制、认证要求、参数完整列表及返回数据解读等,资料暂未提供。