Contact: Yurui Chen, [email protected]
This repository provides a tutorial on building a Graph Neural Network (GNN) for drug response prediction from scratch. The project includes data processing, model layers, and a Jupyter Notebook to run the full pipeline.
-
Drug response prediction plays a crucial role in precision medicine, aiming to determine how various drugs will impact specific cell lines or patients, ultimately assisting in creating personalized treatment strategies.
-
The GNN approach is highly effective for learning representations from small molecule graphs, making it well-suited for this type of task.
We will cover data processing, building the model, and running predictions step by step. You are expected to:
- Get familiar with the drug response prediction problem.
- Gain basic knowledge of the Graph Neural Network (GCN and GIN).
- Understand the pipeline to train and evaluate machine learning and deep learning models for drug responses.
We will use the GDSC project as the drug response dataset.
Join the WIFI:
The github repo is: https://github.com/matcyr/APBJC2024_GNN_Tutorial short link to the repo:
We will use colab to run the tutorial. Please click on
or scan:
To start, in your terminal, run:
git clone https://github.com/matcyr/APBJC2024_GNN_Tutorial.git
Then go to the project directory, by:
cd APBJC2024_GNN_Tutorial
The tutorial is based on Python. The key dependencies include:
pandas
numpy
torch
torch_geometric
Note: The provided dependencies are configured for CPU usage only. If you want to train the model using a GPU, please refer to the PyTorch website and PyTorch Geometric website for instructions on setting up a GPU-backed environment.
If you have a linux platform with conda installed, you can simply install the environment from the provided environment.yml
file. Run the following commands in your terminal:
conda env create -f environment.yml -n <env_name>
conda activate <env_name>
If you do not have Conda installed, or if you are using a Mac/Windows laptop. You can set up the environment using pip by following these instructions:
Run the following command in your terminal to create a virtual environment:
python -m venv <env_name>
or:
python3 -m venv <env_name>
-
macOS/Linux: Run the following command in your terminal:
source <env_name>/bin/activate
-
Windows: Run the following command in your Command Prompt (cmd):
<env_name>\Scripts\activate
After activating the virtual environment, run the following command to install the required dependencies:
sh install.sh
This will create a virtual environment named <env_name>
and install the required dependencies using the install.sh
script.
Run the following command to open the tutorial notebook:
jupyter notebook notebooks/APBJC_tutorial.ipynb