Query Reactome REST API for pathway analysis, enrichment, gene-pathway mapping, disease pathways, molecular interactions, expression analysis, for systems biology studies.
Reactome is a free, open-source, curated pathway database with 2,825+ human pathways. Query biological pathways, perform overrepresentation and expression analysis, map genes to pathways, explore molecular interactions via REST API and Python client for systems biology research.
When to Use This Skill
This skill should be used when:
Performing pathway enrichment analysis on gene or protein lists
Analyzing gene expression data to identify relevant biological pathways
Querying specific pathway information, reactions, or molecular interactions
Mapping genes or proteins to biological pathways and processes
Exploring disease-related pathways and mechanisms
Visualizing analysis results in the Reactome Pathway Browser
Conducting comparative pathway analysis across species
Core Capabilities
Reactome provides two main API services and a Python client library:
1. Content Service - Data Retrieval
Query and retrieve biological pathway data, molecular interactions, and entity information.
Common operations:
Retrieve pathway information and hierarchies
Query specific entities (proteins, reactions, complexes)
Get participating molecules in pathways
Access database version and metadata
Explore pathway compartments and locations
API Base URL:https://reactome.org/ContentService
2. Analysis Service - Pathway Analysis
Perform computational analysis on gene lists and expression data.
Analysis types:
Overrepresentation Analysis: Identify statistically significant pathways from gene/protein lists
Expression Data Analysis: Analyze gene expression datasets to find relevant pathways
Species Comparison: Compare pathway data across different organisms
API Base URL:https://reactome.org/AnalysisService
3. reactome2py Python Package
Python client library that wraps Reactome API calls for easier programmatic access.
Installation:
uv pip install reactome2py
Note: The reactome2py package (version 3.0.0, released January 2021) is functional but not actively maintained. For the most up-to-date functionality, consider using direct REST API calls.
Querying Pathway Data
Using Content Service REST API
The Content Service uses REST protocol and returns data in JSON or plain text formats.
import requests
entity_id = "R-HSA-69278" # Example pathway ID
response = requests.get(f"https://reactome.org/ContentService/data/query/{entity_id}")
data = response.json()
import reactome2py
from reactome2py import content
# Query pathway information
pathway_info = content.query_by_id("R-HSA-69278")
# Get database version
version = content.get_database_version()
For detailed API endpoints and parameters, refer to references/api_reference.md in this skill.
Performing Pathway Analysis
Overrepresentation Analysis
Submit a list of gene/protein identifiers to find enriched pathways.
Using REST API:
import requests
# Prepare identifier list
identifiers = ["TP53", "BRCA1", "EGFR", "MYC"]
data = "\n".join(identifiers)
# Submit analysis
response = requests.post(
"https://reactome.org/AnalysisService/identifiers/",
headers={"Content-Type": "text/plain"},
data=data
)
result = response.json()
token = result["summary"]["token"] # Save token to retrieve results later
# Access pathways
for pathway in result["pathways"]:
print(f"{pathway['stId']}: {pathway['name']} (p-value: {pathway['entities']['pValue']})")
Retrieve analysis by token:
# Token is valid for 7 days
response = requests.get(f"https://reactome.org/AnalysisService/token/{token}")
results = response.json()
Expression Data Analysis
Analyze gene expression datasets with quantitative values.