概述
Reactome 是一个免费、开源的精选通路数据库,包含 2,825+ 条人类通路。该技能可查询生物通路、执行过表征与表达分析、将基因映射到通路、通过 REST API 与 Python 客户端探索分子相互作用,面向系统生物学研究。
用途与适用场景
该技能适用于以下情况:
- 对基因或蛋白质列表执行通路富集分析
- 分析基因表达数据以识别相关生物通路
- 查询特定通路信息、反应或分子相互作用
- 将基因或蛋白质映射到生物通路与过程
- 探索疾病相关通路与机制
- 在 Reactome Pathway Browser 中可视化分析结果
- 进行跨物种的比较通路分析
主要能力
Reactome 提供两个主要 API 服务与一个 Python 客户端库:
1. 内容服务(Content Service)— 数据检索
查询和检索生物通路数据、分子相互作用与实体信息。常见操作包括:
- 检索通路信息与层级结构
- 查询特定实体(蛋白质、反应、复合物)
- 获取通路中的参与分子
- 访问数据库版本与元数据
- 探索通路区室与位置
API 基础 URL:https://reactome.org/ContentService
2. 分析服务(Analysis Service)— 通路分析
对基因列表与表达数据执行计算分析。分析类型包括:
- 过表征分析(Overrepresentation Analysis):从基因/蛋白质列表识别具有统计显著性的通路
- 表达数据分析(Expression Data Analysis):分析基因表达数据集以找到相关通路
- 物种比较(Species Comparison):比较不同生物体的通路数据
API 基础 URL:https://reactome.org/AnalysisService
3. reactome2py Python 包
封装 Reactome API 调用的 Python 客户端库,便于以编程方式访问。
安装命令:
uv pip install reactome2py
注意:reactome2py 包(3.0.0 版,2021 年 1 月发布)可用但已不再积极维护。如需最新功能,建议直接使用 REST API 调用。
使用方式
查询通路数据
使用 Content Service REST API,该服务采用 REST 协议并以 JSON 或纯文本格式返回数据。
获取数据库版本:
import requests
response = requests.get("https://reactome.org/ContentService/data/database/version")
version = response.text
print(f"Reactome version: {version}")
查询特定实体:
import requests
entity_id = "R-HSA-69278" # 示例通路 ID
response = requests.get(f"https://reactome.org/ContentService/data/query/{entity_id}")
data = response.json()
获取通路中的参与分子:
import requests
event_id = "R-HSA-69278"
response = requests.get(
f"https://reactome.org/ContentService/data/event/{event_id}/participatingPhysicalEntities"
)
molecules = response.json()
使用 reactome2py 包:
import reactome2py
from reactome2py import content
# 查询通路信息
pathway_info = content.query_by_id("R-HSA-69278")
# 获取数据库版本
version = content.get_database_version()
执行通路分析
过表征分析:提交基因/蛋白质标识符列表以找到富集通路。
使用 REST API:
import requests
# 准备标识符列表
identifiers = ["TP53", "BRCA1", "EGFR", "MYC"]
data = "\n".join(identifiers)
# 提交分析
response = requests.post(
"https://reactome.org/AnalysisService/identifiers/",
headers={"Content-Type": "text/plain"},
data=data
)
result = response.json()
token = result["summary"]["token"] # 保存 token 以便稍后检索结果
# 访问通路
for pathway in result["pathways"]:
print(f"{pathway['stId']}: {pathway['name']} (p-value: {pathway['entities']['pValue']})")
通过 token 检索分析结果:
# token 有效期为 7 天
response = requests.get(f"https://reactome.org/AnalysisService/token/{token}")
results = response.json()
表达数据分析:分析带有定量值的基因表达数据集。
输入格式(以 # 开头的表头 TSV):
#Gene Sample1 Sample2 Sample3
TP53 2.5 3.1 2.8
BRCA1 1.2 1.5 1.3
EGFR 4.5 4.2 4.8
提交表达数据:
import requests
# 读取 TSV 文件
with open("expression_data.tsv", "r") as f:
data = f.read()
response = requests.post(
"https://reactome.org/AnalysisService/identifiers/",
headers={"Content-Type": "text/plain"},
data=data
)
result = response.json()
物种投影:使用 /projection/ 端点将标识符专门映射到人类通路:
response = requests.post(
"https://reactome.org/AnalysisService/identifiers/projection/",
headers={"Content-Type": "text/plain"},
data=data
)
可视化结果
可通过使用分析 token 构造 URL,在 Reactome Pathway Browser 中可视化分析结果:
token = result["summary"]["token"]
pathway_id = "R-HSA-69278"
url = f"https://reactome.org/PathwayBrowser/#{pathway_id}&DTAB=AN&ANALYSIS={token}"
print(f"View results: {url}")
使用分析 Token
- 分析 token 有效期为 7 天
- token 允许检索先前计算的结果而无需重新提交
- 存储 token 以便跨会话访问结果
- 使用 GET /token/{TOKEN} 端点检索结果
数据格式与标识符
支持的标识符类型:
- UniProt 登录号(如 P04637)
- 基因符号(如 TP53)
- Ensembl ID(如 ENSG00000141510)
- EntrezGene ID(如 7157)
- 小分子的 ChEBI ID
系统会自动检测标识符类型。
输入格式要求:
- 过表征分析:纯文本标识符列表(每行一个),或 TSV 格式的单列
- 表达分析:TSV 格式,必须有以 "#" 开头的表头行;第 1 列为标识符;第 2 列及以后为数值表达值;小数点使用句点(.)
输出格式:所有 API 响应返回 JSON,包含:
- pathways:富集通路数组及统计指标
- summary:分析元数据与 token
- entities:匹配与未映射的标识符
- 统计值:pValue、FDR(错误发现率)
辅助脚本
该技能包含 scripts/reactome_query.py,用于常见 Reactome 操作的辅助脚本:
# 查询通路信息
python scripts/reactome_query.py query R-HSA-69278
# 执行过表征分析
python scripts/reactome_query.py analyze gene_list.txt
# 获取数据库版本
python scripts/reactome_query.py version
附加资源
- API 文档:https://reactome.org/dev
- 用户指南:https://reactome.org/userguide
- 文档门户:https://reactome.org/documentation
- 数据下载:https://reactome.org/download-data
- reactome2py 文档:https://reactome.github.io/reactome2py/
详细的 API 端点文档参见该技能中的 references/api_reference.md。
当前数据库统计(版本 94,2025 年 9 月)
- 2,825 条人类通路
- 16,002 个反应
- 11,630 个蛋白质
- 2,176 个小分子
- 1,070 种药物
- 41,373 条文献引用
限制
- reactome2py 包(3.0.0 版,2021 年 1 月发布)可用但已不再积极维护,建议直接使用 REST API 以获得最新功能。
- 分析 token 有效期为 7 天。
- 关于收费、价格与其他使用限制,资料中暂未提供。