This is the PyTorch implementation for our paper: Hypergraph interpretable deep learning-based path-reasoning framework for drug repurposing
hyperiDPath is a hypergraph interpretable deep learning-based path-reasoning framework for drug discovery and repurposing. This framework focuses on higher-order interactions among various biomolecules, including transcription factors, genes, proteins, and chemicals.
The code has been tested running under Python 3.9.
- To install the required packages for running hyperiDPath, please use the following command first. If you meet any problems when installing pytorch, please refer to pytorch official website
pip install -r requirements.txt
- You may need to download the following files to run hyperiDPath
- Download the the data folder
- Download the result folder
python train.py --config config/config.json
When the training is finished, you will get a file that records the parameters for the best model, remember its location (such as saved/models/hyperiDPath/0319_180500/model_best.pth
) and use it for testing.
python test.py --config config/config.json --resume saved/models/hyperiDPath/0319_180500/model_best.pth
- Data. To make an inference on the new drug-disease pair, you need to prepare a csv file named
test.csv
under the folderdata/test
with the following fields, where the drug(node) is denoted by its drugbank ID and disease(hyperedge) is denoted by its C0XX code. Note that if your input drugs or diseases cannot be found in our dataset, the corresponding pairs will be ignored.
node_1,hyperedge_1
DB00001,C0040038
- Pre-trained model. You can use your own pre-trained model or use our prepared one
model_best.pth
and put theconfig.json
andmodel_best.pth
to the folderdata/test
. - Run. We provide an argument
K
in theinference_config.json
to control the output of the number of top-k critical paths identified by iDPath. Please use the following command to run the inference.
python inference.py --resume data/test/model_best.pth --config config/inference_config.json
- Result. After the inference is done, you will get a file named
result.csv
under the foldersaved/models/hyperiDPath/xxxx_xxxxxx
(wherexxxx_xxxxxx
is your runing time as the runing id). Theresult.csv
contains the predicted probability of therapeutic effect and top-k critical paths of your input drug-disease pairs.
Datasets used in the paper:
Distributed under the GPL-2.0 License License. See LICENSE
for more information.
Thanks to the author of iDPath for open-sourcing the code.
Bai Libing - LiBingBai10@gmail.com