Skip to content

inoue0426/drGT

Repository files navigation

🧬 drGT

Official implementation of drGT: Attention-Guided Gene Assessment for Drug Response in Drug-Cell-Gene Heterogeneous Network arXiv

drGT utilizes attention-based GNNs (e.g., GAT, GATv2, Transformer) to model a heterogeneous graph of drugs, cells, and genes. It predicts drug sensitivity and uncovers gene-level contributions via attention mechanisms.


🚀 Quick Start

Requires: Python 3.10 or 3.11 Uses uv for lightweight execution

  1. Clone the repository:
git clone https://github.com/inoue0426/drGT.git
cd drGT
  1. Run the prediction script directly (CPU or GPU):
./run_drGT.py --task test2 --data nci --method GATv2 --cell_or_drug cell

✅ If uv is not installed:

pip install uv
  1. Example output:
Using device: cpu
Best model found at epoch 2
ACC           : 0.511 (±0.009)
Precision     : 0.215 (±0.296)
Recall        : 0.221 (±0.438)
F1            : 0.170 (±0.289)
AUROC         : 0.535 (±0.024)
AUPR          : 0.532 (±0.029)

🧠 Using Pretrained Models

To evaluate without retraining:

from drGT import drGT
from drGT.metrics import evaluate_predictions

probs, true_labels, attention = drGT.predict('best_model.pt', sampler, params)
evaluate_predictions(true_labels, probs)

✅ Ensure that params match the pretrained model's configuration (e.g., GNN layer, hidden sizes, etc.).

📓 For a full example, see predict_with_pretrained_model.ipynb.


⚙️ Interactive Use with Jupyter

To analyze results or explore predictions interactively:

# Activate virtual environment
source .venv/bin/activate

# Install libraries
uv pip install -e .

# Register Jupyter kernel
python -m ipykernel install --user --name=drGT --display-name "Python (drGT)"

# Launch notebook
jupyter notebook

🔄 Retraining

To retrain drGT from scratch, please refer to the scripts in the Test1_random_split and Test2_leave_X_out directories (e.g., run_drGAT.py). These scripts support retraining under various experimental settings and data-splitting strategies.

To use your own dataset, you will need the following inputs:

  • A drug response matrix
  • Gene expression data
  • Drug chemical structures, provided as SMILES strings

You may adapt the drGT/load_data module to accommodate custom file formats or alternative data sources as required.


⚡️ GPU Acceleration

All experiments were conducted on Linux with NVIDIA A100. drGT benefits significantly from GPU acceleration via PyTorch and PyTorch Geometric.

✅ Ensure you install a CUDA-compatible PyTorch version (e.g., torch==2.x with CUDA 11.8 for A100)

👉 PyTorch Installation Guide


📁 Directory Overview

drGT/                 # Core model implementation
configs/              # YAML configs for experiments
Test1_random_split/   # Scripts for random masking experiments
Test2_leave_X_out/    # Scripts for leave-X-out experiments
preprocess/           # Data preprocessing notebooks
data/                 # Preprocessed datasets

❓ Questions or Issues

Please feel free to:

We're happy to help and collaborate!


📖 Citation

@article{inoue2024drgat,
  title={drGT: Attention-Guided Gene Assessment of Drug Response Utilizing a Drug-Cell-Gene Heterogeneous Network},
  author={Inoue, Yoshitaka and Lee, Hunmin and Fu, Tianfan and Luna, Augustin},
  journal={arXiv preprint arXiv:2405.08979},
  year={2024}
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published