[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M73J5R3RR0FDD1XPS4QH6WDW":3,"skill-same:01M73J5R3RR0FDD1XPS4QH6WDW":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M73J5R3RR0FDD1XPS4QH6WDW","reactome-database",null,"Query Reactome pathways via REST: pathway queries, entity lookup, keyword search, gene list enrichment, hierarchy, cross-refs. Content + Analysis services. Python wrapper: reactome2py. For KEGG use kegg-database; for PPIs use string-database-ppi.","bg-szy\u002FTOP-SKILLS","bg-szy","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F106576190?v=4","01M73A4E8KPV67SFXRY8XZGNBX","ShuZhiyong","01M73A4E96MQ294MHM74TZBVQD",6,"CC-BY-4.0","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fawesome-skills\u002Freactome-database\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: reactome-database\ndescription: \"Query Reactome pathways via REST: pathway queries, entity lookup, keyword search, gene list enrichment, hierarchy, cross-refs. Content + Analysis services. Python wrapper: reactome2py. For KEGG use kegg-database; for PPIs use string-database-ppi.\"\nlicense: CC-BY-4.0\n---\n\n# Reactome Database — Biological Pathway Queries & Enrichment Analysis\n\n## Overview\n\nReactome is an open-source, curated database of biological pathways and reactions for 16+ species. It provides two REST APIs: the **Content Service** for querying pathway data, entities, and hierarchy, and the **Analysis Service** for gene\u002Fprotein list enrichment and expression data overlay. All endpoints return JSON (default) or other formats and require no authentication.\n\n## When to Use\n\n- Querying pathway details by stable ID (e.g., R-HSA-69620 for Cell Cycle)\n- Searching for pathways, reactions, or entities by keyword\n- Running gene list enrichment analysis (over-representation) against Reactome pathways\n- Retrieving pathway hierarchy and containment relationships\n- Mapping identifiers across databases (UniProt, Ensembl, NCBI, ChEBI)\n- Getting species-specific pathway data (human, mouse, rat, and 13+ other organisms)\n- Retrieving analysis results by token for sharing or re-filtering\n- Building pathway context for multi-omics integration workflows\n- For **KEGG metabolic pathways** and cross-database ID conversion, use `kegg-database` instead\n- For **protein-protein interaction networks**, use `string-database-ppi` instead\n- For **a Python wrapper with caching**, consider `reactome2py` (`pip install reactome2py`)\n\n## Prerequisites\n\n```bash\npip install requests\n```\n\n**API constraints**:\n- **No authentication required** — all endpoints are public\n- **No documented hard rate limit** — add `time.sleep(0.5)` between batch requests to be respectful\n- **Content Service base URL**: `https:\u002F\u002Freactome.org\u002FContentService`\n- **Analysis Service base URL**: `https:\u002F\u002Freactome.org\u002FAnalysisService`\n- **Identifier input**: gene\u002Fprotein lists accept UniProt IDs, Ensembl gene IDs, NCBI Gene IDs, HGNC symbols, ChEBI IDs, miRBase IDs, KEGG IDs, and more\n\n## Quick Start\n\n```python\nimport requests\nimport time\n\nCONTENT = \"https:\u002F\u002Freactome.org\u002FContentService\"\nANALYSIS = \"https:\u002F\u002Freactome.org\u002FAnalysisService\"\n\ndef reactome_get(base, path, params=None):\n    \"\"\"Generic Reactome REST API caller. Returns JSON or raises.\"\"\"\n    resp = requests.get(f\"{base}{path}\", params=params)\n    resp.raise_for_status()\n    try:\n        return resp.json()\n    except ValueError:\n        return resp.text\n\n# Check database version\nversion = reactome_get(CONTENT, \"\u002Fdata\u002Fdatabase\u002Fversion\")\nprint(f\"Reactome version: {version}\")\n\n# Query a pathway\npathway = reactome_get(CONTENT, \"\u002Fdata\u002Fquery\u002FR-HSA-69620\")\nprint(f\"Pathway: {pathway['displayName']}\")\nprint(f\"Species: {pathway['speciesName']}\")\ntime.sleep(0.5)\n\n# Search for pathways\nresults = reactome_get(CONTENT, \"\u002Fsearch\u002Fquery\", params={\"query\": \"apoptosis\", \"types\": \"Pathway\"})\nprint(f\"Found {results['found']} results for 'apoptosis'\")\n```\n\n## Core API\n\n### 1. Pathway & Entity Queries\n\nRetrieve detailed information about pathways, reactions, and biological entities by stable ID. Uses `reactome_get` helper from Quick Start.\n\n```python\n# Query pathway by stable ID\npathway = reactome_get(CONTENT, \"\u002Fdata\u002Fquery\u002FR-HSA-69620\")\nprint(f\"Name: {pathway['displayName']}\")\nprint(f\"Stable ID: {pathway['stId']}, Species: {pathway['speciesName']}\")\nprint(f\"Schema class: {pathway['schemaClass']}\")  # Pathway, TopLevelPathway, etc.\ntime.sleep(0.5)\n\n# Get participating physical entities in a pathway\nentities = reactome_get(CONTENT, f\"\u002Fdata\u002Fparticipants\u002F{pathway['stId']}\")\nprint(f\"\\nParticipating entities: {len(entities)}\")\nfor e in entities[:3]:\n    print(f\"  {e['displayName']} ({e['schemaClass']})\")\ntime.sleep(0.5)\n\n# Get participating molecules with reference entities (UniProt, ChEBI, etc.)\nrefs = reactome_get(CONTENT, f\"\u002Fdata\u002Fparticipants\u002F{pathway['stId']}\u002FreferenceEntities\")\nprint(f\"\\nReference entities: {len(refs)}\")\nfor r in refs[:3]:\n    print(f\"  {r['displayName']} — {r.get('databaseName', 'N\u002FA')}:{r.get('identifier', 'N\u002FA')}\")\n```\n\n### 2. Search & Discovery\n\nSearch across Reactome by keyword with faceted filtering.\n\n```python\n# Keyword search filtered to Pathways\nresults = reactome_get(CONTENT, \"\u002Fsearch\u002Fquery\", params={\n    \"query\": \"cell cycle\",\n    \"types\": \"Pathway\",\n    \"species\": \"Homo sapiens\",\n    \"cluster\": \"true\"\n})\nprint(f\"Total found: {results['found']}\")\nfor entry in results.get(\"results\", [])[:1]:\n    for e in entry.get(\"entries\", [])[:5]:\n        print(f\"  {e['stId']}: {e['name']}\")\ntime.sleep(0.5)\n\n# Search for proteins\u002Fcomplexes\nproteins = reactome_get(CONTENT, \"\u002Fsearch\u002Fquery\", params={\n    \"query\": \"TP53\", \"types\": \"Protein\", \"species\": \"Homo sapiens\"\n})\nprint(f\"\\nTP53 protein entries: {proteins['found']}\")\ntime.sleep(0.5)\n\n# Suggest (autocomplete)\nsuggestions = reactome_get(CONTENT, \"\u002Fsearch\u002Fsuggest\", params={\"query\": \"apopt\"})\nprint(f\"Suggestions: {suggestions}\")\n```\n\n**Searchable types**: `Pathway`, `Reaction`, `Protein`, `Complex`, `SmallMolecule`, `Gene`, `DNA`, `RNA`, `Drug`, `ReferenceEntity`\n\n### 3. Enrichment Analysis\n\nSubmit a gene\u002Fprotein list for over-representation analysis against Reactome pathways.\n\n```python\nimport requests\nimport time\n\nANALYSIS = \"https:\u002F\u002Freactome.org\u002FAnalysisService\"\n\n# Gene list (newline-separated identifiers — UniProt, HGNC symbols, Ensembl, etc.)\ngene_list = \"TP53\\nBRCA1\\nBRCA2\\nATM\\nCHEK2\\nCDK2\\nRB1\\nMDM2\\nCDKN1A\\nBAX\"\n\n# Submit for enrichment (POST with text body)\nresp = requests.post(\n    f\"{ANALYSIS}\u002Fidentifiers\u002F\",\n    headers={\"Content-Type\": \"text\u002Fplain\"},\n    data=gene_list,\n    params={\"pageSize\": 10, \"page\": 1, \"sortBy\": \"ENTITIES_FDR\", \"order\": \"ASC\"}\n)\nresp.raise_for_status()\nresult = resp.json()\n\nprint(f\"Analysis token: {result['summary']['token']}\")\nprint(f\"Pathways found: {result['pathwaysFound']}\")\nprint(f\"Identifiers found: {result['identifiersNotFound']}\")\nprint(f\"\\nTop enriched pathways:\")\nfor p in result[\"pathways\"][:5]:\n    print(f\"  {p['stId']}: {p['name']}\")\n    print(f\"    FDR: {p['entities']['fdr']:.2e}, \"\n          f\"Found: {p['entities']['found']}\u002F{p['entities']['total']}\")\ntime.sleep(0.5)\n```\n\n**Analysis accepts**: newline-separated identifiers, or tab-separated with expression values (for expression overlay). Supported IDs include UniProt, HGNC symbols, Ensembl, NCBI Gene, ChEBI, miRBase, KEGG, and more.\n\n### 4. Analysis Results & Filtering\n\nRetrieve previously computed analysis results by token and apply filters.\n\n```python\nimport requests\nimport time\n\nANALYSIS = \"https:\u002F\u002Freactome.org\u002FAnalysisService\"\n\n# Re-fetch results by token (from a previous analysis)\ntoken = \"MjAyNTA2MTcxMDA3MzRfMQ%3D%3D\"  # example — use token from Module 3\n\n# Get results with filtering\nresults = requests.get(f\"{ANALYSIS}\u002Ftoken\u002F{token}\", params={\n    \"pageSize\": 20,\n    \"page\": 1,\n    \"sortBy\": \"ENTITIES_FDR\",\n    \"species\": \"Homo sapiens\",\n    \"resource\": \"TOTAL\"  # TOTAL, UNIPROT, ENSEMBL, CHEBI, etc.\n})\nresults.raise_for_status()\ndata = results.json()\nprint(f\"Token: {data['summary']['token']}\")\nprint(f\"Pathways: {data['pathwaysFound']}\")\ntime.sleep(0.5)\n\n# Get identifiers found in a specific pathway\npathway_detail = requests.get(\n    f\"{ANALYSIS}\u002Ftoken\u002F{token}\u002Ffound\u002Fall\u002F{data['pathways'][0]['stId']}\"\n)\npathway_detail.raise_for_status()\nfound = pathway_detail.json()\nprint(f\"\\nIdentifiers found in {data['pathways'][0]['name']}:\")\nfor entity in found.get(\"entities\", [])[:5]:\n    mapsTo = [m[\"identifier\"] for m in entity.get(\"mapsTo\", [])]\n    print(f\"  {entity['id']} -> {mapsTo}\")\n```\n\n**Token persistence**: analysis tokens are valid for several hours. Share tokens to let collaborators view the same results without re-running. Filter by `resource` (TOTAL, UNIPROT, ENSEMBL, CHEBI, etc.) and `species`.\n\n### 5. Pathway Hierarchy & Events\n\nNavigate the Reactome pathway hierarchy from top-level pathways down to reactions.\n\n```python\n# Top-level pathways for human (9606 = NCBI taxonomy ID)\ntop = reactome_get(CONTENT, \"\u002Fdata\u002Fpathways\u002Ftop\u002F9606\")\nprint(f\"Top-level human pathways: {len(top)}\")\nfor p in top[:5]:\n    print(f\"  {p['stId']}: {p['displayName']}\")\ntime.sleep(0.5)\n\n# Get contained events (sub-pathways and reactions)\nevents = reactome_get(CONTENT, \"\u002Fdata\u002Fpathway\u002FR-HSA-69620\u002FcontainedEvents\")\nprint(f\"\\nContained events in Cell Cycle: {len(events)}\")\nfor e in events[:5]:\n    print(f\"  {e['stId']}: {e['displayName']} ({e['schemaClass']})\")\ntime.sleep(0.5)\n\n# Get the full ancestor chain for a pathway\nancestors = reactome_get(CONTENT, \"\u002Fdata\u002Fevent\u002FR-HSA-69620\u002Fancestors\")\nprint(f\"\\nAncestors of Cell Cycle:\")\nfor chain in ancestors:\n    names = [a[\"displayName\"] for a in chain]\n    print(f\"  {' > '.join(names)}\")\n```\n\n**Species identifiers**: use NCBI taxonomy IDs (9606=human, 10090=mouse, 10116=rat) or species names.\n\n### 6. Cross-References & Species\n\nMap identifiers across databases and query species-specific data.\n\n```python\n# List all species in Reactome\nspecies = reactome_get(CONTENT, \"\u002Fdata\u002Fspecies\u002Fall\")\nprint(f\"Species in Reactome: {len(species)}\")\nfor s in species[:5]:\n    print(f\"  {s['displayName']} (taxId: {s['taxId']})\")\ntime.sleep(0.5)\n\n# Map a Reactome entity to external references\nxrefs = reactome_get(CONTENT, \"\u002Fdata\u002Fquery\u002FR-HSA-69620\u002Fxrefs\")\nif isinstance(xrefs, list):\n    print(f\"\\nCross-references for R-HSA-69620: {len(xrefs)}\")\n    for x in xrefs[:5]:\n        print(f\"  {x}\")\ntime.sleep(0.5)\n\n# Get orthologous pathway in another species (human → mouse)\nmouse_ortho = reactome_get(CONTENT, \"\u002Fdata\u002Forthology\u002FR-HSA-69620\u002Fspecies\u002F10090\")\nif mouse_ortho:\n    for o in mouse_ortho[:3]:\n        print(f\"Mouse ortholog: {o['stId']}: {o['displayName']}\")\n```\n\n## Key Concepts\n\n### Pathway Hierarchy\n\nReactome organizes knowledge in a hierarchical structure:\n\n| Level | Schema Class | Example |\n|-------|-------------|---------|\n| Top-Level Pathway | `TopLevelPathway` | Cell Cycle, Immune System, Metabolism |\n| Pathway | `Pathway` | Cell Cycle Checkpoints, Mitotic G1-G1\u002FS phases |\n| Reaction | `Reaction` | TP53 binds RB1 |\n| Physical Entity | `EntityWithAccessionedSequence` | TP53 [cytosol] |\n\nPathways contain sub-pathways and reactions. Reactions connect input\u002Foutput physical entities. Each entity maps to reference databases (UniProt, ChEBI, Ensembl).\n\n### Supported Identifiers\n\nThe Analysis Service accepts a wide range of identifiers:\n\n| Database | Example ID | Type |\n|----------|-----------|------|\n| UniProt | P04637 | Protein |\n| HGNC Symbol | TP53 | Gene symbol |\n| Ensembl Gene | ENSG00000141510 | Gene |\n| NCBI Gene | 7157 | Gene |\n| ChEBI | CHEBI:15377 | Small molecule |\n| miRBase | hsa-miR-21-5p | microRNA |\n| KEGG Gene | hsa:7157 | Gene (KEGG format) |\n| Ensembl Protein | ENSP00000269305 | Protein |\n\n### Analysis Token System\n\nWhen you submit an analysis, Reactome returns a **token** — a URL-safe string that identifies your result set. Tokens enable:\n- **Re-fetching** results without re-running analysis (`GET \u002Ftoken\u002F{token}`)\n- **Filtering** results by species or resource after initial analysis\n- **Sharing** results with collaborators via URL: `https:\u002F\u002Freactome.org\u002FPathwayBrowser\u002F#\u002FDTAB=AN&ANALYSIS={token}`\n- Tokens expire after several hours; re-submit the gene list if needed\n\n## Common Workflows\n\n### Workflow 1: Gene List Enrichment Pipeline\n\n**Goal**: Submit a gene list, get enriched pathways, and explore top hits.\n\n```python\nimport requests\nimport time\n\nCONTENT = \"https:\u002F\u002Freactome.org\u002FContentService\"\nANALYSIS = \"https:\u002F\u002Freactome.org\u002FAnalysisService\"\n\n# Step 1: Submit gene list\ngenes = \"TP53\\nBRCA1\\nBRCA2\\nATM\\nCHEK2\\nCDK2\\nRB1\\nMDM2\\nCDKN1A\\nBAX\"\nresp = requests.post(\n    f\"{ANALYSIS}\u002Fidentifiers\u002F\",\n    headers={\"Content-Type\": \"text\u002Fplain\"},\n    data=genes,\n    params={\"pageSize\": 5, \"sortBy\": \"ENTITIES_FDR\", \"order\": \"ASC\"}\n)\nresp.raise_for_status()\nresult = resp.json()\ntoken = result[\"summary\"][\"token\"]\nprint(f\"Token: {token} | Pathways found: {result['pathwaysFound']}\")\n\n# Step 2: Show top pathways with FDR\nfor p in result[\"pathways\"][:5]:\n    fdr = p[\"entities\"][\"fdr\"]\n    ratio = f\"{p['entities']['found']}\u002F{p['entities']['total']}\"\n    print(f\"  {p['stId']}: {p['name']} (FDR={fdr:.2e}, {ratio})\")\ntime.sleep(0.5)\n\n# Step 3: Get details on top pathway\ntop_id = result[\"pathways\"][0][\"stId\"]\ndetail = requests.get(f\"{CONTENT}\u002Fdata\u002Fquery\u002F{top_id}\").json()\nprint(f\"\\nTop pathway: {detail['displayName']}\")\nprint(f\"Compartments: {[c['displayName'] for c in detail.get('compartment', [])]}\")\n```\n\n### Workflow 2: Pathway Exploration\n\n**Goal**: Navigate from a top-level pathway down to specific reactions and entities.\n\n```python\n# Uses reactome_get helper and CONTENT base URL from Quick Start\n\n# Step 1: Find pathway by search\nresults = reactome_get(CONTENT, \"\u002Fsearch\u002Fquery\",\n                       params={\"query\": \"DNA repair\", \"types\": \"Pathway\", \"species\": \"Homo sapiens\"})\ntop_hit = results[\"results\"][0][\"entries\"][0]\npid = top_hit[\"stId\"]\nprint(f\"Found: {pid} — {top_hit['name']}\")\ntime.sleep(0.5)\n\n# Step 2: Get sub-events\nevents = reactome_get(CONTENT, f\"\u002Fdata\u002Fpathway\u002F{pid}\u002FcontainedEvents\")\nreactions = [e for e in events if e[\"schemaClass\"] == \"Reaction\"]\nsubpaths = [e for e in events if \"Pathway\" in e[\"schemaClass\"]]\nprint(f\"Sub-pathways: {len(subpaths)}, Reactions: {len(reactions)}\")\ntime.sleep(0.5)\n\n# Step 3: Get participating molecules for a reaction\nif reactions:\n    rxn = reactions[0]\n    refs = reactome_get(CONTENT, f\"\u002Fdata\u002Fparticipants\u002F{rxn['stId']}\u002FreferenceEntities\")\n    print(f\"\\n{rxn['displayName']} participants:\")\n    for r in refs[:5]:\n        print(f\"  {r.get('databaseName', '?')}:{r.get('identifier', '?')} — {r['displayName']}\")\n```\n\n### Workflow 3: Expression Data Analysis\n\n**Goal**: Submit expression values alongside identifiers for pathway-level expression overlay.\n\n```python\nimport requests\n\nANALYSIS = \"https:\u002F\u002Freactome.org\u002FAnalysisService\"\n\n# Tab-separated: identifier \\t expression_value1 \\t expression_value2 ...\n# First line can be a header (auto-detected)\nexpression_data = \"\"\"#id\\tcontrol\\ttreated\nTP53\\t1.2\\t3.5\nBRCA1\\t2.1\\t1.8\nCDK2\\t0.9\\t4.2\nRB1\\t1.5\\t0.6\nMDM2\\t1.0\\t2.8\nCDKN1A\\t0.8\\t5.1\nBAX\\t1.1\\t3.9\"\"\"\n\nresp = requests.post(\n    f\"{ANALYSIS}\u002Fidentifiers\u002F\",\n    headers={\"Content-Type\": \"text\u002Fplain\"},\n    data=expression_data,\n    params={\"pageSize\": 10, \"sortBy\": \"ENTITIES_FDR\"}\n)\nresp.raise_for_status()\nresult = resp.json()\n\nprint(f\"Expression columns: {result['summary'].get('sampleName', 'N\u002FA')}\")\nprint(f\"Token: {result['summary']['token']}\")\nfor p in result[\"pathways\"][:3]:\n    exp = p[\"entities\"].get(\"exp\", [])\n    print(f\"  {p['name']}: FDR={p['entities']['fdr']:.2e}, expr={exp}\")\n```\n\n## Key Parameters\n\n| Parameter | Function\u002FEndpoint | Default | Options | Effect |\n|-----------|-------------------|---------|---------|--------|\n| `query` | `\u002Fsearch\u002Fquery` | — | Any string | Keyword search term |\n| `types` | `\u002Fsearch\u002Fquery` | All | `Pathway`, `Reaction`, `Protein`, etc. | Filter search by schema class |\n| `species` | `\u002Fsearch\u002Fquery`, analysis | All | Species name or taxon ID | Restrict to organism |\n| `pageSize` | Analysis, search | 20 | 1-250 | Results per page |\n| `sortBy` | Analysis | `ENTITIES_PVALUE` | `ENTITIES_FDR`, `ENTITIES_PVALUE`, `ENTITIES_FOUND`, `NAME` | Sort enrichment results |\n| `resource` | Analysis filtering | `TOTAL` | `TOTAL`, `UNIPROT`, `ENSEMBL`, `CHEBI`, etc. | Filter by identifier source |\n| `cluster` | `\u002Fsearch\u002Fquery` | `true` | `true`, `false` | Group search results by type |\n\n## Best Practices\n\n1. **Use `time.sleep(0.5)` between sequential requests**: Reactome has no documented hard rate limit, but rapid-fire requests may be throttled. Be courteous to the shared resource.\n\n2. **Save and reuse analysis tokens**: Tokens remain valid for hours. Store the token to re-filter results by species or resource without re-submitting.\n\n3. **Prefer stable IDs over database IDs**: Reactome stable IDs (R-HSA-69620) are permanent. Internal database IDs can change between releases.\n\n4. **Use `sortBy=ENTITIES_FDR`** for enrichment results: FDR-corrected p-values are more reliable than raw p-values for pathway-level significance.\n\n5. **Check `identifiersNotFound`** in analysis results: a high unmapped count may indicate wrong identifier type or outdated IDs.\n\n## Common Recipes\n\n### Recipe: Get All Genes in a Pathway\n\n```python\nimport requests\n\nCONTENT = \"https:\u002F\u002Freactome.org\u002FContentService\"\n\npathway_id = \"R-HSA-69620\"  # Cell Cycle\nrefs = requests.get(f\"{CONTENT}\u002Fdata\u002Fparticipants\u002F{pathway_id}\u002FreferenceEntities\").json()\ngenes = set()\nfor r in refs:\n    if r.get(\"databaseName\") == \"UniProt\":\n        genes.add(r.get(\"displayName\", r.get(\"identifier\")))\nprint(f\"UniProt proteins in {pathway_id}: {len(genes)}\")\nfor g in sorted(genes)[:10]:\n    print(f\"  {g}\")\n```\n\n### Recipe: Pathway Diagram URL\n\n```python\n# Generate a direct link to the Reactome pathway diagram\npathway_id = \"R-HSA-69620\"\ndiagram_url = f\"https:\u002F\u002Freactome.org\u002FPathwayBrowser\u002F#\u002F{pathway_id}\"\nprint(f\"View diagram: {diagram_url}\")\n\n# With analysis overlay\ntoken = \"YOUR_TOKEN\"\noverlay_url = f\"https:\u002F\u002Freactome.org\u002FPathwayBrowser\u002F#\u002F{pathway_id}&DTAB=AN&ANALYSIS={token}\"\nprint(f\"View with analysis: {overlay_url}\")\n```\n\n### Recipe: Batch Pathway Query\n\n```python\nimport requests\nimport time\n\nCONTENT = \"https:\u002F\u002Freactome.org\u002FContentService\"\n\npathway_ids = [\"R-HSA-69620\", \"R-HSA-109581\", \"R-HSA-1640170\"]\nsummaries = []\nfor pid in pathway_ids:\n    resp = requests.get(f\"{CONTENT}\u002Fdata\u002Fquery\u002F{pid}\")\n    resp.raise_for_status()\n    data = resp.json()\n    summaries.append({\n        \"stId\": data[\"stId\"],\n        \"name\": data[\"displayName\"],\n        \"species\": data[\"speciesName\"],\n        \"hasDiagram\": data.get(\"hasDiagram\", False)\n    })\n    time.sleep(0.5)\n\nfor s in summaries:\n    print(f\"{s['stId']}: {s['name']} (diagram: {s['hasDiagram']})\")\n```\n\n## Troubleshooting\n\n| Problem | Cause | Solution |\n|---------|-------|----------|\n| `404 Not Found` | Invalid stable ID or wrong species prefix | Verify ID format: `R-HSA-{number}` for human; use `\u002Fsearch\u002Fquery` to find valid IDs |\n| `400 Bad Request` | Malformed POST body or wrong Content-Type | Use `Content-Type: text\u002Fplain` for analysis; newline-separated identifiers |\n| Empty analysis results | Identifiers not recognized | Check `identifiersNotFound`; try different ID types (UniProt vs HGNC symbol) |\n| `500 Internal Server Error` | Server-side issue or very large input | Retry after delay; split large gene lists (>2000 IDs) into batches |\n| Token expired | Analysis results no longer available | Re-submit the gene list; tokens last several hours |\n| Wrong species results | No species filter applied | Add `species=Homo sapiens` parameter to search\u002Fanalysis |\n| Slow response | Large pathway with many entities | Use `pageSize` to paginate; cache results locally |\n| Cross-reference returns empty | Entity has no external DB mapping | Not all Reactome entities have UniProt\u002FEnsembl mappings; check entity schema class |\n\n## Bundled Resources\n\nThis skill consolidates content from:\n- **API reference** (465 lines): Content Service endpoints (data\u002Fquery, search, participants, pathway hierarchy, species, xrefs) and Analysis Service endpoints (identifiers, token retrieval, filtering) are covered across Core API modules 1-6. Supported identifier types are in Key Concepts. Response format details and error handling are in Troubleshooting.\n- **Query script** (286 lines): ReactomeClient class methods (query_pathway, get_pathway_entities, search_pathways, analyze_genes, get_analysis_by_token) are absorbed into Core API code blocks and Common Workflows.\n\n## Related Skills\n\n- **kegg-database** — KEGG pathway queries and metabolic network data; use for metabolic pathway focus and cross-database ID conversion\n- **string-database-ppi** — protein-protein interaction networks from STRING; complements Reactome pathway data with interaction evidence\n- **bioservices-multi-database** — unified Python interface to 40+ databases including Reactome via `bioservices.Reactome`\n- **cobrapy-metabolic-modeling** — constraint-based metabolic modeling; use Reactome pathway data as input for FBA analysis\n\n## References\n\n- [Reactome Content Service API](https:\u002F\u002Freactome.org\u002FContentService\u002F) — interactive API documentation (Swagger)\n- [Reactome Analysis Service API](https:\u002F\u002Freactome.org\u002FAnalysisService\u002F) — enrichment analysis API documentation\n- [Reactome website](https:\u002F\u002Freactome.org\u002F) — pathway browser, diagram viewer, species comparison\n- [reactome2py](https:\u002F\u002Fgithub.com\u002Freactome\u002Freactome2py) — official Python wrapper for Reactome APIs\n- Gillespie, M. et al. (2022) \"The reactome pathway knowledgebase 2022\" *Nucleic Acids Research* 50:D364-D370\n","# Reactome Database — Biological Pathway Queries & Enrichment Analysis\n\n## Overview\n\nReactome is an open-source, curated database of biological pathways and reactions for 16+ species. It provides two REST APIs: the **Content Service** for querying pathway data, entities, and hierarchy, and the **Analysis Service** for gene\u002Fprotein list enrichment and expression data overlay. All endpoints return JSON (default) or other formats and require no authentication.\n\n## When to Use\n\n- Querying pathway details by stable ID (e.g., R-HSA-69620 for Cell Cycle)\n- Searching for pathways, reactions, or entities by keyword\n- Running gene list enrichment analysis (over-representation) against Reactome pathways\n- Retrieving pathway hierarchy and containment relationships\n- Mapping identifiers across databases (UniProt, Ensembl, NCBI, ChEBI)\n- Getting species-specific pathway data (human, mouse, rat, and 13+ other organisms)\n- Retrieving analysis results by token for sharing or re-filtering\n- Building pathway context for multi-omics integration workflows\n- For **KEGG metabolic pathways** and cross-database ID conversion, use `kegg-database` instead\n- For **protein-protein interaction networks**, use `string-database-ppi` instead\n- For **a Python wrapper with caching**, consider `reactome2py` (`pip install reactome2py`)\n\n## Prerequisites\n\n```bash\npip install requests\n```\n\n**API constraints**:\n- **No authentication required** — all endpoints are public\n- **No documented hard rate limit** — add `time.sleep(0.5)` between batch requests to be respectful\n- **Content Service base URL**: `https:\u002F\u002Freactome.org\u002FContentService`\n- **Analysis Service base URL**: `https:\u002F\u002Freactome.org\u002FAnalysisService`\n- **Identifier input**: gene\u002Fprotein lists accept UniProt IDs, Ensembl gene IDs, NCBI Gene IDs, HGNC symbols, ChEBI IDs, miRBase IDs, KEGG IDs, and more\n\n## Quick Start\n\n```python\nimport requests\nimport time\n\nCONTENT = \"https:\u002F\u002Freactome.org\u002FContentService\"\nANALYSIS = \"https:\u002F\u002Freactome.org\u002FAnalysisService\"\n\ndef reactome_get(base, path, params=None):\n    \"\"\"Generic Reactome REST API caller. Returns JSON or raises.\"\"\"\n    resp = requests.get(f\"{base}{path}\", params=params)\n    resp.raise_for_status()\n    try:\n        return resp.json()\n    except ValueError:\n        return resp.text\n\n# Check database version\nversion = reactome_get(CONTENT, \"\u002Fdata\u002Fdatabase\u002Fversion\")\nprint(f\"Reactome version: {version}\")\n\n# Query a pathway\npathway = reactome_get(CONTENT, \"\u002Fdata\u002Fquery\u002FR-HSA-69620\")\nprint(f\"Pathway: {pathway['displayName']}\")\nprint(f\"Species: {pathway['speciesName']}\")\ntime.sleep(0.5)\n\n# Search for pathways\nresults = reactome_get(CONTENT, \"\u002Fsearch\u002Fquery\", params={\"query\": \"apoptosis\", \"types\": \"Pathway\"})\nprint(f\"Found {results['found']} results for 'apoptosis'\")\n```\n\n## Core API\n\n### 1. Pathway & Entity Queries\n\nRetrieve detailed information about pathways, reactions, and biological entities by stable ID. Uses `reactome_get` helper from Quick Start.\n\n```python\n# Query pathway by stable ID\npathway = reactome_get(CONTENT, \"\u002Fdata\u002Fquery\u002FR-HSA-69620\")\nprint(f\"Name: {pathway['displayName']}\")\nprint(f\"Stable ID: {pathway['stId']}, Species: {pathway['speciesName']}\")\nprint(f\"Schema class: {pathway['schemaClass']}\")  # Pathway, TopLevelPathway, etc.\ntime.sleep(0.5)\n\n# Get participating physical entities in a pathway\nentities = reactome_get(CONTENT, f\"\u002Fdata\u002Fparticipants\u002F{pathway['stId']}\")\nprint(f\"\\nParticipating entities: {len(entities)}\")\nfor e in entities[:3]:\n    print(f\"  {e['displayName']} ({e['schemaClass']})\")\ntime.sleep(0.5)\n\n# Get participating molecules with reference entities (UniProt, ChEBI, etc.)\nrefs = reactome_get(CONTENT, f\"\u002Fdata\u002Fparticipants\u002F{pathway['stId']}\u002FreferenceEntities\")\nprint(f\"\\nReference entities: {len(refs)}\")\nfor r in refs[:3]:\n    print(f\"  {r['displayName']} — {r.get('databaseName', 'N\u002FA')}:{r.get('identifier', 'N\u002FA')}\")\n```\n\n### 2. Search & Discovery\n\nSearch across Reactome by keyword with faceted filtering.\n\n```python\n# Keyword search filtered to Pathways\nresults = reactome_get(CONTENT, \"\u002Fsearch\u002Fquery\", params={\n    \"query\": \"cell cycle\",\n    \"types\": \"Pathway\",\n    \"species\": \"Homo sapiens\",\n    \"cluster\": \"true\"\n})\nprint(f\"Total found: {results['found']}\")\nfor entry in results.get(\"results\", [])[:1]:\n    for e in entry.get(\"entries\", [])[:5]:\n        print(f\"  {e['stId']}: {e['name']}\")\ntime.sleep(0.5)\n\n# Search for proteins\u002Fcomplexes\nproteins = reactome_get(CONTENT, \"\u002Fsearch\u002Fquery\", params={\n    \"query\": \"TP53\", \"types\": \"Protein\", \"species\": \"Homo sapiens\"\n})\nprint(f\"\\nTP53 protein entries: {proteins['found']}\")\ntime.sleep(0.5)\n\n# Suggest (autocomplete)\nsuggestions = reactome_get(CONTENT, \"\u002Fsearch\u002Fsuggest\", params={\"query\": \"apopt\"})\nprint(f\"Suggestions: {suggestions}\")\n```\n\n**Searchable types**: `Pathway`, `Reaction`, `Protein`, `Complex`, `SmallMolecule`, `Gene`, `DNA`, `RNA`, `Drug`, `ReferenceEntity`\n\n### 3. Enrichment Analysis\n\nSubmit a gene\u002Fprotein list for over-representation analysis against Reactome pathways.\n\n```python\nimport requests\nimport time\n\nANALYSIS = \"https:\u002F\u002Freactome.org\u002FAnalysisService\"\n\n# Gene list (newline-separated identifiers — UniProt, HGNC symbols, Ensembl, etc.)\ngene_list = \"TP53\\nBRCA1\\nBRCA2\\nATM\\nCHEK2\\nCDK2\\nRB1\\nMDM2\\nCDKN1A\\nBAX\"\n\n# Submit for enrichment (POST with text body)\nresp = requests.post(\n    f\"{ANALYSIS}\u002Fidentifiers\u002F\",\n    headers={\"Content-Type\": \"text\u002Fplain\"},\n    data=gene_list,\n    params={\"pageSize\": 10, \"page\": 1, \"sortBy\": \"ENTITIES_FDR\", \"order\": \"ASC\"}\n)\nresp.raise_for_status()\nresult = resp.json()\n\nprint(f\"Analysis token: {result['summary']['token']}\")\nprint(f\"Pathways found: {result['pathwaysFound']}\")\nprint(f\"Identifiers found: {result['identifiersNotFound']}\")\nprint(f\"\\nTop enriched pathways:\")\nfor p in result[\"pathways\"][:5]:\n    print(f\"  {p['stId']}: {p['name']}\")\n    print(f\"    FDR: {p['entities']['fdr']:.2e}, \"\n          f\"Found: {p['entities']['found']}\u002F{p['entities']['total']}\")\ntime.sleep(0.5)\n```\n\n**Analysis accepts**: newline-separated identifiers, or tab-separated with expression values (for expression overlay). Supported IDs include UniProt, HGNC symbols, Ensembl, NCBI Gene, ChEBI, miRBase, KEGG, and more.\n\n### 4. Analysis Results & Filtering\n\nRetrieve previously computed analysis results by token and apply filters.\n\n```python\nimport requests\nimport time\n\nANALYSIS = \"https:\u002F\u002Freactome.org\u002FAnalysisService\"\n\n# Re-fetch results by token (from a previous analysis)\ntoken = \"MjAyNTA2MTcxMDA3MzRfMQ%3D%3D\"  # example — use token from Module 3\n\n# Get results with filtering\nresults = requests.get(f\"{ANALYSIS}\u002Ftoken\u002F{token}\", params={\n    \"pageSize\": 20,\n    \"page\": 1,\n    \"sortBy\": \"ENTITIES_FDR\",\n    \"species\": \"Homo sapiens\",\n    \"resource\": \"TOTAL\"  # TOTAL, UNIPROT, ENSEMBL, CHEBI, etc.\n})\nresults.raise_for_status()\ndata = results.json()\nprint(f\"Token: {data['summary']['token']}\")\nprint(f\"Pathways: {data['pathwaysFound']}\")\ntime.sleep(0.5)\n\n# Get identifiers found in a specific pathway\npathway_detail = requests.get(\n    f\"{ANALYSIS}\u002Ftoken\u002F{token}\u002Ffound\u002Fall\u002F{data['pathways'][0]['stId']}\"\n)\npathway_detail.raise_for_status()\nfound = pathway_detail.json()\nprint(f\"\\nIdentifiers found in {data['pathways'][0]['name']}:\")\nfor entity in found.get(\"entities\", [])[:5]:\n    mapsTo = [m[\"identifier\"] for m in entity.get(\"mapsTo\", [])]\n    print(f\"  {entity['id']} -> {mapsTo}\")\n```\n\n**Token persistence**: analysis tokens are valid for several hours. Share tokens to let collaborators view the same results without re-running. Filter by `resource` (TOTAL, UNIPROT, ENSEMBL, CHEBI, etc.) and `species`.\n\n### 5. Pathway Hierarchy & Events\n\nNavigate the Reactome pathway hierarchy from top-level pathways down to reactions.\n\n```python\n# Top-level pathways for human (9606 = NCBI taxonomy ID)\ntop = reactome_get(CONTENT, \"\u002Fdata\u002Fpathways\u002Ftop\u002F9606\")\nprint(f\"Top-level human pathways: {len(top)}\")\nfor p in top[:5]:\n    print(f\"  {p['stId']}: {p['displayName']}\")\ntime.sleep(0.5)\n\n# Get contained events (sub-pathways and reactions)\nevents = reactome_get(CONTENT, \"\u002Fdata\u002Fpathway\u002FR-HSA-69620\u002FcontainedEvents\")\nprint(f\"\\nContained events in Cell Cycle: {len(events)}\")\nfor e in events[:5]:\n    print(f\"  {e['stId']}: {e['displayName']} ({e['schemaClass']})\")\ntime.sleep(0.5)\n\n# Get the full ancestor chain for a pathway\nancestors = reactome_get(CONTENT, \"\u002Fdata\u002Fevent\u002FR-HSA-69620\u002Fancestors\")\nprint(f\"\\nAncestors of Cell Cycle:\")\nfor chain in ancestors:\n    names = [a[\"displayName\"] for a in chain]\n    print(f\"  {' > '.join(names)}\")\n```\n\n**Species identifiers**: use NCBI taxonomy IDs (9606=human, 10090=mouse, 10116=rat) or species names.\n\n### 6. Cross-References & Species\n\nMap identifiers across databases and query species-specific data.\n\n```python\n# List all species in Reactome\nspecies = reactome_get(CONTENT, \"\u002Fdata\u002Fspecies\u002Fall\")\nprint(f\"Species in Reactome: {len(species)}\")\nfor s in species[:5]:\n    print(f\"  {s['displayName']} (taxId: {s['taxId']})\")\ntime.sleep(0.5)\n\n# Map a Reactome entity to external references\nxrefs = reactome_get(CONTENT, \"\u002Fdata\u002Fquery\u002FR-HSA-69620\u002Fxrefs\")\nif isinstance(xrefs, list):\n    print(f\"\\nCross-references for R-HSA-69620: {len(xrefs)}\")\n    for x in xrefs[:5]:\n        print(f\"  {x}\")\ntime.sleep(0.5)\n\n# Get orthologous pathway in another species (human → mouse)\nmouse_ortho = reactome_get(CONTENT, \"\u002Fdata\u002Forthology\u002FR-HSA-69620\u002Fspecies\u002F10090\")\nif mouse_ortho:\n    for o in mouse_ortho[:3]:\n        print(f\"Mouse ortholog: {o['stId']}: {o['displayName']}\")\n```\n\n## Key Concepts\n\n### Pathway Hierarchy\n\nReactome organizes knowledge in a hierarchical structure:\n\n| Level | Schema Class | Example |\n|-------|-------------|---------|\n| Top-Level Pathway | `TopLevelPathway` | Cell Cycle, Immune System, Metabolism |\n| Pathway | `Pathway` | Cell Cycle Checkpoints, Mitotic G1-G1\u002FS phases |\n| Reaction | `Reaction` | TP53 binds RB1 |\n| Physical Entity | `EntityWithAccessionedSequence` | TP53 [cytosol] |\n\nPathways contain sub-pathways and reactions. Reactions connect input\u002Foutput physical entities. Each entity maps to reference databases (UniProt, ChEBI, Ensembl).\n\n### Supported Identifiers\n\nThe Analysis Service accepts a wide range of identifiers:\n\n| Database | Example ID | Type |\n|----------|-----------|------|\n| UniProt | P04637 | Protein |\n| HGNC Symbol | TP53 | Gene symbol |\n| Ensembl Gene | ENSG00000141510 | Gene |\n| NCBI Gene | 7157 | Gene |\n| ChEBI | CHEBI:15377 | Small molecule |\n| miRBase | hsa-miR-21-5p | microRNA |\n| KEGG Gene | hsa:7157 | Gene (KEGG format) |\n| Ensembl Protein | ENSP00000269305 | Protein |\n\n### Analysis Token System\n\nWhen you submit an analysis, Reactome returns a **token** — a URL-safe string that identifies your result set. Tokens enable:\n- **Re-fetching** results without re-running analysis (`GET \u002Ftoken\u002F{token}`)\n- **Filtering** results by species or resource after initial analysis\n- **Sharing** results with collaborators via URL: `https:\u002F\u002Freactome.org\u002FPathwayBrowser\u002F#\u002FDTAB=AN&ANALYSIS={token}`\n- Tokens expire after several hours; re-submit the gene list if needed\n\n## Common Workflows\n\n### Workflow 1: Gene List Enrichment Pipeline\n\n**Goal**: Submit a gene list, get enriched pathways, and explore top hits.\n\n```python\nimport requests\nimport time\n\nCONTENT = \"https:\u002F\u002Freactome.org\u002FContentService\"\nANALYSIS = \"https:\u002F\u002Freactome.org\u002FAnalysisService\"\n\n# Step 1: Submit gene list\ngenes = \"TP53\\nBRCA1\\nBRCA2\\nATM\\nCHEK2\\nCDK2\\nRB1\\nMDM2\\nCDKN1A\\nBAX\"\nresp = requests.post(\n    f\"{ANALYSIS}\u002Fidentifiers\u002F\",\n    headers={\"Content-Type\": \"text\u002Fplain\"},\n    data=genes,\n    params={\"pageSize\": 5, \"sortBy\": \"ENTITIES_FDR\", \"order\": \"ASC\"}\n)\nresp.raise_for_status()\nresult = resp.json()\ntoken = result[\"summary\"][\"token\"]\nprint(f\"Token: {token} | Pathways found: {result['pathwaysFound']}\")\n\n# Step 2: Show top pathways with FDR\nfor p in result[\"pathways\"][:5]:\n    fdr = p[\"entities\"][\"fdr\"]\n    ratio = f\"{p['entities']['found']}\u002F{p['entities']['total']}\"\n    print(f\"  {p['stId']}: {p['name']} (FDR={fdr:.2e}, {ratio})\")\ntime.sleep(0.5)\n\n# Step 3: Get details on top pathway\ntop_id = result[\"pathways\"][0][\"stId\"]\ndetail = requests.get(f\"{CONTENT}\u002Fdata\u002Fquery\u002F{top_id}\").json()\nprint(f\"\\nTop pathway: {detail['displayName']}\")\nprint(f\"Compartments: {[c['displayName'] for c in detail.get('compartment', [])]}\")\n```\n\n### Workflow 2: Pathway Exploration\n\n**Goal**: Navigate from a top-level pathway down to specific reactions and entities.\n\n```python\n# Uses reactome_get helper and CONTENT base URL from Quick Start\n\n# Step 1: Find pathway by search\nresults = reactome_get(CONTENT, \"\u002Fsearch\u002Fquery\",\n                       params={\"query\": \"DNA repair\", \"types\": \"Pathway\", \"species\": \"Homo sapiens\"})\ntop_hit = results[\"results\"][0][\"entries\"][0]\npid = top_hit[\"stId\"]\nprint(f\"Found: {pid} — {top_hit['name']}\")\ntime.sleep(0.5)\n\n# Step 2: Get sub-events\nevents = reactome_get(CONTENT, f\"\u002Fdata\u002Fpathway\u002F{pid}\u002FcontainedEvents\")\nreactions = [e for e in events if e[\"schemaClass\"] == \"Reaction\"]\nsubpaths = [e for e in events if \"Pathway\" in e[\"schemaClass\"]]\nprint(f\"Sub-pathways: {len(subpaths)}, Reactions: {len(reactions)}\")\ntime.sleep(0.5)\n\n# Step 3: Get participating molecules for a reaction\nif reactions:\n    rxn = reactions[0]\n    refs = reactome_get(CONTENT, f\"\u002Fdata\u002Fparticipants\u002F{rxn['stId']}\u002FreferenceEntities\")\n    print(f\"\\n{rxn['displayName']} participants:\")\n    for r in refs[:5]:\n        print(f\"  {r.get('databaseName', '?')}:{r.get('identifier', '?')} — {r['displayName']}\")\n```\n\n### Workflow 3: Expression Data Analysis\n\n**Goal**: Submit expression values alongside identifiers for pathway-level expression overlay.\n\n```python\nimport requests\n\nANALYSIS = \"https:\u002F\u002Freactome.org\u002FAnalysisService\"\n\n# Tab-separated: identifier \\t expression_value1 \\t expression_value2 ...\n# First line can be a header (auto-detected)\nexpression_data = \"\"\"#id\\tcontrol\\ttreated\nTP53\\t1.2\\t3.5\nBRCA1\\t2.1\\t1.8\nCDK2\\t0.9\\t4.2\nRB1\\t1.5\\t0.6\nMDM2\\t1.0\\t2.8\nCDKN1A\\t0.8\\t5.1\nBAX\\t1.1\\t3.9\"\"\"\n\nresp = requests.post(\n    f\"{ANALYSIS}\u002Fidentifiers\u002F\",\n    headers={\"Content-Type\": \"text\u002Fplain\"},\n    data=expression_data,\n    params={\"pageSize\": 10, \"sortBy\": \"ENTITIES_FDR\"}\n)\nresp.raise_for_status()\nresult = resp.json()\n\nprint(f\"Expression columns: {result['summary'].get('sampleName', 'N\u002FA')}\")\nprint(f\"Token: {result['summary']['token']}\")\nfor p in result[\"pathways\"][:3]:\n    exp = p[\"entities\"].get(\"exp\", [])\n    print(f\"  {p['name']}: FDR={p['entities']['fdr']:.2e}, expr={exp}\")\n```\n\n## Key Parameters\n\n| Parameter | Function\u002FEndpoint | Default | Options | Effect |\n|-----------|-------------------|---------|---------|--------|\n| `query` | `\u002Fsearch\u002Fquery` | — | Any string | Keyword search term |\n| `types` | `\u002Fsearch\u002Fquery` | All | `Pathway`, `Reaction`, `Protein`, etc. | Filter search by schema class |\n| `species` | `\u002Fsearch\u002Fquery`, analysis | All | Species name or taxon ID | Restrict to organism |\n| `pageSize` | Analysis, search | 20 | 1-250 | Results per page |\n| `sortBy` | Analysis | `ENTITIES_PVALUE` | `ENTITIES_FDR`, `ENTITIES_PVALUE`, `ENTITIES_FOUND`, `NAME` | Sort enrichment results |\n| `resource` | Analysis filtering | `TOTAL` | `TOTAL`, `UNIPROT`, `ENSEMBL`, `CHEBI`, etc. | Filter by identifier source |\n| `cluster` | `\u002Fsearch\u002Fquery` | `true` | `true`, `false` | Group search results by type |\n\n## Best Practices\n\n1. **Use `time.sleep(0.5)` between sequential requests**: Reactome has no documented hard rate limit, but rapid-fire requests may be throttled. Be courteous to the shared resource.\n\n2. **Save and reuse analysis tokens**: Tokens remain valid for hours. Store the token to re-filter results by species or resource without re-submitting.\n\n3. **Prefer stable IDs over database IDs**: Reactome stable IDs (R-HSA-69620) are permanent. Internal database IDs can change between releases.\n\n4. **Use `sortBy=ENTITIES_FDR`** for enrichment results: FDR-corrected p-values are more reliable than raw p-values for pathway-level significance.\n\n5. **Check `identifiersNotFound`** in analysis results: a high unmapped count may indicate wrong identifier type or outdated IDs.\n\n## Common Recipes\n\n### Recipe: Get All Genes in a Pathway\n\n```python\nimport requests\n\nCONTENT = \"https:\u002F\u002Freactome.org\u002FContentService\"\n\npathway_id = \"R-HSA-69620\"  # Cell Cycle\nrefs = requests.get(f\"{CONTENT}\u002Fdata\u002Fparticipants\u002F{pathway_id}\u002FreferenceEntities\").json()\ngenes = set()\nfor r in refs:\n    if r.get(\"databaseName\") == \"UniProt\":\n        genes.add(r.get(\"displayName\", r.get(\"identifier\")))\nprint(f\"UniProt proteins in {pathway_id}: {len(genes)}\")\nfor g in sorted(genes)[:10]:\n    print(f\"  {g}\")\n```\n\n### Recipe: Pathway Diagram URL\n\n```python\n# Generate a direct link to the Reactome pathway diagram\npathway_id = \"R-HSA-69620\"\ndiagram_url = f\"https:\u002F\u002Freactome.org\u002FPathwayBrowser\u002F#\u002F{pathway_id}\"\nprint(f\"View diagram: {diagram_url}\")\n\n# With analysis overlay\ntoken = \"YOUR_TOKEN\"\noverlay_url = f\"https:\u002F\u002Freactome.org\u002FPathwayBrowser\u002F#\u002F{pathway_id}&DTAB=AN&ANALYSIS={token}\"\nprint(f\"View with analysis: {overlay_url}\")\n```\n\n### Recipe: Batch Pathway Query\n\n```python\nimport requests\nimport time\n\nCONTENT = \"https:\u002F\u002Freactome.org\u002FContentService\"\n\npathway_ids = [\"R-HSA-69620\", \"R-HSA-109581\", \"R-HSA-1640170\"]\nsummaries = []\nfor pid in pathway_ids:\n    resp = requests.get(f\"{CONTENT}\u002Fdata\u002Fquery\u002F{pid}\")\n    resp.raise_for_status()\n    data = resp.json()\n    summaries.append({\n        \"stId\": data[\"stId\"],\n        \"name\": data[\"displayName\"],\n        \"species\": data[\"speciesName\"],\n        \"hasDiagram\": data.get(\"hasDiagram\", False)\n    })\n    time.sleep(0.5)\n\nfor s in summaries:\n    print(f\"{s['stId']}: {s['name']} (diagram: {s['hasDiagram']})\")\n```\n\n## Troubleshooting\n\n| Problem | Cause | Solution |\n|---------|-------|----------|\n| `404 Not Found` | Invalid stable ID or wrong species prefix | Verify ID format: `R-HSA-{number}` for human; use `\u002Fsearch\u002Fquery` to find valid IDs |\n| `400 Bad Request` | Malformed POST body or wrong Content-Type | Use `Content-Type: text\u002Fplain` for analysis; newline-separated identifiers |\n| Empty analysis results | Identifiers not recognized | Check `identifiersNotFound`; try different ID types (UniProt vs HGNC symbol) |\n| `500 Internal Server Error` | Server-side issue or very large input | Retry after delay; split large gene lists (>2000 IDs) into batches |\n| Token expired | Analysis results no longer available | Re-submit the gene list; tokens last several hours |\n| Wrong species results | No species filter applied | Add `species=Homo sapiens` parameter to search\u002Fanalysis |\n| Slow response | Large pathway with many entities | Use `pageSize` to paginate; cache results locally |\n| Cross-reference returns empty | Entity has no external DB mapping | Not all Reactome entities have UniProt\u002FEnsembl mappings; check entity schema class |\n\n## Bundled Resources\n\nThis skill consolidates content from:\n- **API reference** (465 lines): Content Service endpoints (data\u002Fquery, search, participants, pathway hierarchy, species, xrefs) and Analysis Service endpoints (identifiers, token retrieval, filtering) are covered across Core API modules 1-6. Supported identifier types are in Key Concepts. Response format details and error handling are in Troubleshooting.\n- **Query script** (286 lines): ReactomeClient class methods (query_pathway, get_pathway_entities, search_pathways, analyze_genes, get_analysis_by_token) are absorbed into Core API code blocks and Common Workflows.\n\n## Related Skills\n\n- **kegg-database** — KEGG pathway queries and metabolic network data; use for metabolic pathway focus and cross-database ID conversion\n- **string-database-ppi** — protein-protein interaction networks from STRING; complements Reactome pathway data with interaction evidence\n- **bioservices-multi-database** — unified Python interface to 40+ databases including Reactome via `bioservices.Reactome`\n- **cobrapy-metabolic-modeling** — constraint-based metabolic modeling; use Reactome pathway data as input for FBA analysis\n\n## References\n\n- [Reactome Content Service API](https:\u002F\u002Freactome.org\u002FContentService\u002F) — interactive API documentation (Swagger)\n- [Reactome Analysis Service API](https:\u002F\u002Freactome.org\u002FAnalysisService\u002F) — enrichment analysis API documentation\n- [Reactome website](https:\u002F\u002Freactome.org\u002F) — pathway browser, diagram viewer, species comparison\n- [reactome2py](https:\u002F\u002Fgithub.com\u002Freactome\u002Freactome2py) — official Python wrapper for Reactome APIs\n- Gillespie, M. et al. (2022) \"The reactome pathway knowledgebase 2022\" *Nucleic Acids Research* 50:D364-D370\n",{"name":5,"license":15,"description":7},"master","63f17866001c5ca854bf2fa0b678ce277133de5b","skills\u002Fawesome-skills\u002Freactome-database",0,"https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS","https:\u002F\u002Fbg-szy.github.io\u002FTOP-SKILLS\u002F","https:\u002F\u002Fgithub.com\u002Fbg-szy","https:\u002F\u002Fwww.ecust.edu.cn\u002F","a student of East China University of Science and Technology","2026-11-15 03:38:02",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add bg-szy\u002FTOP-SKILLS --skill reactome-database",{"tool":40,"command":41},"bunx","bunx skills add bg-szy\u002FTOP-SKILLS --skill reactome-database",{"tool":43,"command":44},"pnpm","pnpm dlx skills add bg-szy\u002FTOP-SKILLS --skill reactome-database","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fawesome-skills\u002Freactome-database\u002FSKILL.md",true,[],[49,58,65,72,79,86],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":57},"01M7DXW9N826PKXK174PVW3038","serpmaven","Scrape Google search results (SERP) to JSON with SERP Maven (serpmaven) - a real Chrome browser on a residential proxy with sticky sessions. Run it as a CLI, a Python library, a local HTTP search API (`serve`), an MCP server or a Docker image; set the proxy login, workers, pages and cost tracking. Use when the user wants Google results, rank tracking, a self-hosted SERP API, or live Google search for an AI agent.","MIT","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fserpmaven\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":57},"01M7DXVHSTWDV65475QEQ915M7","revnu-landing-page-audit","Find out why a landing page isn't turning visitors into signups, demos or sales. Audits one page against what the ad, post or search that sends people there promised, then checks the first screen, proof, call to action, friction and mobile. Returns at most 7 prioritized fixes, plus what is fine and what could not be checked; rewrites specific lines and fixes the page in the repo when asked. Never promises a conversion lift. Works without a Revnu account. Use when the user says or asks: \"audit my landing page\", \"why isn't this page converting\", \"review my homepage\", \"my ads get clicks but no signups\", \"people bounce from the pricing page\", \"CRO review\", \"improve conversion rate\", \"is my hero section clear\", \"roast my landing page\", \"rewrite my headline\", \"what's wrong with this page\", \"landing page feedback\", \"make the signup page convert better\". Not for SEO or AI-search audits, page speed engineering on its own, or building a new page from scratch.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-landing-page-audit\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":57},"01M7DXV8X2D7B3VTD4HHYYHTGR","revnu-growth-context","Write down once who buys, what they're stuck on, what it costs, what proof you have and what you've already tried, so every growth task starts from facts instead of a questionnaire. Creates or updates .agents\u002Frevnu-growth.md from the repo, the live site and the user, and imports an existing product-marketing.md. Use when the user says \"set up our marketing context\", \"who is our ideal customer\", \"write our ICP\", \"describe the product for marketing\", \"positioning doc\", \"what's our brand voice\", \"remember this about our customers\", \"log what we tried\", \"what have we learned from marketing\", \"we changed pricing, update the context\", \"update our growth notes\", \"summarize the business for the agent\", \"import my product-marketing.md\", \"start a growth doc\", or before a first marketing, SEO, outreach or launch task when no context file exists. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-growth-context\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":57},"01M7DXV0DGJ1G0A60PAHC6J3C5","revnu-get-listed","Get onto the third-party pages AI answers and search cite when buyers ask for the best tool in your category: \"best X\" roundups, directories, review sites, GitHub awesome lists, community threads and comparison pages. Finds which ones are cited, ranks them by fit and effort, and drafts each submission, PR or pitch by the target's own rules. Use when the user says \"get us listed\", \"which directories should we submit to\", \"how do we get into best-of lists\", \"why does ChatGPT recommend competitors and not us\", \"get mentioned in AI answers\", \"submit to awesome lists\", \"get on G2\", \"where are our competitors listed\", \"pitch listicle authors\", \"find backlink opportunities\", \"launch directories\", \"get into roundups\", \"Product Hunt alternatives\", \"where should we be listed\", \"get cited by Perplexity\". Never submits, pays or posts without a yes. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-get-listed\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":57},"01M7DXTSPMGT9D6DSS0HP9BSTA","revnu-ai-readiness-audit","Audit whether your website gives ChatGPT, Perplexity, Claude, Gemini and Google's AI Overviews something worth quoting, and fix the pages that don't. Use when the user says or asks \"is my site ready for AI search\", \"audit my site for AI answers\", \"AEO audit\", \"GEO audit\", \"why doesn't ChatGPT quote our pricing\", \"make our pages citable by AI\", \"do I need llms.txt\", \"does schema help with ChatGPT\", \"check our structured data\", \"is our content visible without JavaScript\", \"AI SEO audit\", \"optimize our homepage for AI answers\", \"LLM SEO check\", \"why does AI get our product wrong\", \"fix our site for AI Overviews\". Checks fetchability and indexability, answers in the raw HTML, entity facts, schema (including JS-injected markup), headings, dates and llms.txt, then gives at most 10 prioritised fixes and edits the repo when asked. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-ai-readiness-audit\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":57},"01M7DXSZHCVTRS620GC3S97JZV","proxy-troubleshooting","Diagnose residential proxy failures, with NodeMaven's gateway as the reference - 407 with correct credentials, 406, 410, 500, a connection that hangs, ERR_TUNNEL_CONNECTION_FAILED in a browser, Playwright or Puppeteer ignoring proxy credentials, a sticky session that changes IP, geo-targeting that is silently ignored, passwords with special characters, and unexpected traffic from headless Chrome. Use when a proxy connection fails, returns the wrong location, or costs more traffic than expected.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fproxy-troubleshooting\u002FSKILL.md",[],[]]