Skip to main content

ShapG2P

ShapG2P: a strategy for biomarker pathway enrichment with PPI network topology and SHAP analysis.

Given a list of gene symbols (from a file or passed directly as a list), it returns a {pathway: SHAP score} dictionary sorted by score in descending order.

Method

  • Each gene is featurized by its PPI network distance to the genes of each pathway (exp(-d/2) similarity);
  • An XGBoost classifier distinguishes biomarkers from background genes (global 1:1 undersampling, SEED=42);
  • The mean absolute SHAP contribution (pred_contribs) of each pathway feature is used as the pathway SHAP score.

Bundled data: STRING human PPI network (17,613 genes), KEGG / Hallmark / WikiPathway pathways.

Install

pip install shapg2p

Or for local development:

cd shapg2p_pkg
pip install -e .

Usage

from shapg2p import score_pathways

genes = ['TP53', 'ATM', 'APOE', 'SOD1', 'CDKN2A', 'BRCA1', 'BRCA2', 'PTEN',
         'RB1', 'MYC', 'EGFR', 'KRAS', 'PIK3CA', 'AKT1', 'MTOR', 'BCL2',
         'IL6', 'TNF', 'IL1B', 'IL10', 'CXCL8', 'TGFB1', 'VEGFA', 'MMP9',
         'COL1A1', 'SPP1', 'CD44', 'STAT3', 'NFKB1', 'HIF1A', 'SIRT1',
         'FOXO3', 'NFE2L2', 'KEAP1', 'TERT', 'LMNA', 'WRN', 'PINK1',
         'PARK7', 'SNCA']

# from a gene symbol list
scores = score_pathways(genes)

# or from a file (CSV/TSV/TXT; common gene columns such as "gene symbol"
# are auto-detected, STRING_ID is also supported)
# scores = score_pathways('my_biomarkers.csv')

print(scores)
# {'p53 signaling pathway': 0.42, 'Alzheimer disease': 0.31, ...}

Each call takes about 1–3 minutes (one XGBoost training + full-genome SHAP computation).

Output

Returns dict[str, float]: pathway name → mean |SHAP| score, sorted descending. Only pathways with score > 0 are returned (irrelevant pathways are omitted). Duplicate pathway names across databases take the maximum score.

Dependencies

numpy / pandas / scipy / scikit-learn / xgboost (installed automatically with pip install shapg2p).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shapg2p-0.1.1.tar.gz (22.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shapg2p-0.1.1-py3-none-any.whl (22.0 MB view details)

Uploaded Python 3

File details

Details for the file shapg2p-0.1.1.tar.gz.

File metadata

  • Download URL: shapg2p-0.1.1.tar.gz
  • Upload date:
  • Size: 22.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.20

File hashes

Hashes for shapg2p-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0396a42a9ffc029b805d086915418948b004ee0902d984c21b50abf89b30af0e
MD5 e6f78d0b099f7764e9a01cc9063844c7
BLAKE2b-256 b2de7041270ba2fd2bbea1c393d49908478aa111dee5917c4277dff876bffdec

See more details on using hashes here.

File details

Details for the file shapg2p-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: shapg2p-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 22.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.20

File hashes

Hashes for shapg2p-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 28d926a38be295a0f7b243769f4a410a385a72050b8287c9d56fec49ec82f9bc
MD5 3841d4f142f50be22ad26af76881e5f1
BLAKE2b-256 ff1d9cdf1507fd8ce8ddf1e2b9c47eca0e03bd6b2ecfad9cee49b65a894f8d6e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page