MCPcopy Create free account
hub / github.com/Mew233/pairwise

github.com/Mew233/pairwise @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
186 symbols 498 edges 20 files ⚖ MIT 10 documented · 5% ● updated 2mo ago★ 485

Browse by type

⨍ Functions 155◇ Types & classes 31
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

PAIRWISE: Deep Learning-based Prediction of Effective Personalized Drug Combinations in Cancer

PAIRWISE predicts whether a drug pair acts synergistically in a specific tumour sample. It fuses three modalities — molecular graphs of the two compounds, their drug–target interaction profiles propagated over a protein–protein interaction network, and the sample transcriptome — through an attention encoder into a single synergy probability.

This repository contains the model, the seven benchmarked baselines, and the code that reproduces figure and table in the manuscript.


1. Installation

conda create -n pairwise python=3.10
conda activate pairwise

# torch and dgl carry CUDA-specific wheels; install them first
pip install torch==2.3.0 --index-url https://download.pytorch.org/whl/cu121
pip install dgl==2.4.0 -f https://data.dgl.ai/wheels/torch-2.3/cu121/repo.html

git clone https://github.com/Mew233/pairwise.git
cd pairwise
pip install -e .

Verify:

python -c "import pairwise; print(pairwise.__version__)"

2. Data setup

data/
├── synergy_data/p13/drugcomb_trueset_NoDup.csv   # ~30K curated combinations
├── cell_line_data/CCLE/                          # expression, CNV, mutation, PPI graphs
├── cell_line_data/tcga/tcga_encoder.pth          # pretrained transcriptome autoencoder
├── drug_data/                                    # DTI matrices, structures.sdf, smiles.grover
└── gene_sets/

See paper/00_data/data_README.md for the full schema and for how the p13 benchmark was curated from 13 public screens.

3. Quick start

example/example2run.ipynb walks through prediction, feature extraction, fine-tuning, and training. Full-data training uses k_fold_trainer_graph_combonet (Adam lr=1e-4, BCE, batch 256, 50 epochs × 2 passes, 5-fold CV) and reaches ~0.85 AUROC (held-out / leave-combo).

Train a model

python -m pairwise.main --model pairwise --synergy_df p13 --train_test_mode train

Feature settings (drug_omics, cell_filtered_by, …) are read from pairwise/configs/config_<model>.json .

Evaluate a trained checkpoint

python -m pairwise.main --model pairwise --synergy_df p13 --train_test_mode test

Predictions are written to results/predicts_{model}_{dataset}.txt with columns index, actuals, predicts_{model}; checkpoints go to weights/best_model_{model}.pth.

The pairwise-train console script is installed as an alias for python -m pairwise.main.

GROVER, and DLBCL cooclassifier:

python scripts/download_grover.py

4. Models included

--model accepts any of the following. Each has a matching pairwise/configs/config_{model}.json declaring which drug and cell features it consumes.

Model Cell features Drug features Reference
pairwise expression → autoencoder GROVER embeddings + RWR-propagated DTI this work
transynergy_liu expression → transformer RWR-propagated DTI Liu & Xie 2021
multitaskdnn_kim expression → DNN fingerprints + DTI Kim et al. 2021
deepsynergy_preuer expression → DNN chemical descriptors Preuer et al. 2018
deepdds_wang expression → MLP SMILES → graph → GCN Wang et al. 2021
matchmaker_brahim expression → DNN chemical descriptors Kuru et al. 2021
TGSynergy expression → GCN SMILES → graph → GCN Zhu et al. 2022
graphsynergy cell–protein + PPI → GCN drug–protein + PPI → GCN Yang et al. 2021
LR, RF, ERT, XGBOOST expression / CNV / mutation DTI scikit-learn baselines

5. License

MIT

6. Citation

Chengqi X., et al. PAIRWISE: Deep Learning-based Prediction of Effective Personalized Drug Combinations in Cancer.

Core symbols most depended-on inside this repo

browse all functions →

Shape

Method 78
Function 77
Class 31

Languages

Python100%

Modules by API surface

pairwise/utilitis.py45 symbols
pairwise/dataloader.py27 symbols
pairwise/prepare_data.py22 symbols
pairwise/models/pairwise.py15 symbols
pairwise/models/transynergy_liu.py13 symbols
pairwise/models/granuality.py12 symbols
pairwise/models/graphsynergy.py10 symbols
pairwise/models/TGSynergy.py10 symbols
pairwise/select_features.py8 symbols
pairwise/models/baselines.py5 symbols
pairwise/pipeline.py4 symbols
pairwise/models/multitaskdnn_kim.py3 symbols

For agents

$ claude mcp add pairwise \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page