Skip to content

Repository files navigation

Pathways Knowledge Graph

119K nodes. 835K edges. Every human biological pathway, protein interaction, and GO annotation in one graph.

Pathways KG terminal demo

Part of the Samyama ecosystem — loaded into and queried via the graph engine at samyama-ai/samyama-graph. This repo holds the loader and source-data specifics for the KG.

License


We loaded Reactome pathways, STRING protein interactions, Gene Ontology, WikiPathways, and UniProt, then asked:

"Which protein has the most interaction partners?"

MATCH (p:Protein)-[:INTERACTS_WITH]-(other:Protein)
RETURN p.name AS protein, count(DISTINCT other) AS partners
ORDER BY partners DESC LIMIT 5
Protein Partners
TP53 571
UBC 524
EGFR 441
APP 395
ESR1 384

TP53 -- the most connected hub in the human interactome. Powered by Samyama Graph.

See all 100 benchmark queries →


Documentation

New here? Start with the guides:

Guide What it covers
GETTING_STARTED.md prerequisites (Python ≥ 3.10) · install · run the engine (Docker) · load the graph · first query
docs/QUERYING.md ask questions via MCP (Claude), the HTTP API, or the Samyama CLI
Biomedical Benchmark 100 example queries

Demo

A narrated terminal walkthrough — loads a real Reactome subset and answers four pathway-biology questions in plain Cypher (hierarchy, protein hub-centrality, protein-dense pathways).

The demo loads a fast, representative subset of REAL Reactome data: all 2,848 human pathways and their CHILD_OF hierarchy, plus the first 40,000 human protein-participation rows from UniProt2Reactome (2,745 proteins, 35,160 PARTICIPATES_IN edges). Edges are created one-by-one, so this caps the ~900K-row participation file to keep the demo under a minute. Load the full KG with python -m etl.loader --data-dir data.

# Run
source ~/projects/venv/bin/activate
PYTHONUNBUFFERED=1 python -m demo.demo

# Re-record
asciinema rec --overwrite --cols 92 --rows 32 --idle-time-limit 2.0 \
  -c "bash -c 'source ~/projects/venv/bin/activate && PYTHONUNBUFFERED=1 python -m demo.demo'" \
  demo/pathways.cast
agg demo/pathways.cast demo/pathways.gif
aws s3 cp demo/pathways.gif s3://samyama-data/demos/pathways.gif

Schema

5 node labels -- Protein (37,990), GOTerm (51,897), Complex (15,963), Reaction (9,988), Pathway (2,848)

9 edge types -- ANNOTATED_WITH (265K), INTERACTS_WITH (228K), PARTICIPATES_IN (140K), CATALYZES (121K), IS_A (59K), COMPONENT_OF (8K), PART_OF (7K), REGULATES (3K), CHILD_OF (3K)

5 data sources -- Reactome, STRING v12.0, Gene Ontology, WikiPathways, UniProt (all human, organism 9606)

Quick Start

Full walkthrough → GETTING_STARTED.md (prerequisites, Docker, loading, querying).

Load from snapshot (recommended)

Needs Python ≥ 3.10 for the tooling and Docker for the engine:

pip install -r requirements.txt
docker run --rm -p 8080:8080 -p 6379:6379 public.ecr.aws/f9f6l5u4/samyama-graph:1.1.0

curl -LO https://github.com/samyama-ai/samyama-graph/releases/download/kg-snapshots-v3/pathways.sgsnap  # ~9.6 MB
curl -X POST http://localhost:8080/api/tenants -H 'Content-Type: application/json' -d '{"id":"pathways","name":"Pathways KG"}'
curl -X POST http://localhost:8080/api/tenants/pathways/snapshot/import -F "file=@pathways.sgsnap"

Build from source

git clone https://github.com/samyama-ai/pathways-kg.git && cd pathways-kg
pip install -r requirements.txt          # or: pip install -e ".[dev]" for tests
python -m etl.download_data --data-dir data        # ~1.9 GB
python -m etl.loader --data-dir data --url http://localhost:8080     # → pathways tenant

Example Queries

-- Pathway crosstalk: shared proteins between pathways
MATCH (p1:Pathway)<-[:PARTICIPATES_IN]-(prot:Protein)-[:PARTICIPATES_IN]->(p2:Pathway)
WHERE p1.name < p2.name
WITH p1, p2, count(prot) AS shared WHERE shared >= 100
RETURN p1.name, p2.name, shared ORDER BY shared DESC LIMIT 10

-- TP53 two-hop neighborhood
MATCH (tp53:Protein {name: 'TP53'})-[:INTERACTS_WITH]-(hop1:Protein)-[:INTERACTS_WITH]-(hop2:Protein)
WHERE hop2 <> tp53
RETURN DISTINCT hop2.name AS protein LIMIT 15

Use with Claude (MCP)

python -m mcp_server.server --url http://localhost:8080 --graph pathways   # against a running engine
python -m mcp_server.server --data-dir data                               # embedded, loads on startup
python -m mcp_server.server --url http://localhost:8080 --list-tools       # see all tools

Register it with Claude and ask in natural language — full steps in docs/QUERYING.md.

Part of the Biomedical Trifecta

This KG is one of three biomedical knowledge graphs that together form Samyama's billion-edge benchmark: Clinical Trials (27M edges) + Pathways (835K edges) + Drug Interactions (388K edges), merged on load with PubMed (1.04B edges).

These four graphs are also loaded as part of a larger merged corpus — fifteen KGs plus two synthetic patient cohorts in a single store. BiomedQA has the node, edge and merge counts, and states how and when they were measured.

Links

Samyama Graph github.com/samyama-ai/samyama-graph
The Book samyama-ai.github.io/samyama-graph-book
Benchmark (100 queries) Biomedical Benchmark
Contact samyama.dev/contact

License

Apache 2.0

About

Biological pathways knowledge graph — Reactome, STRING, Gene Ontology, WikiPathways, UniProt → Samyama Graph Database

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages