Giter VIP home page Giter VIP logo

idpath's Introduction

iDPath

This is the PyTorch implementation for our paper published on Briefings in Bioinformatics:

Deep Learning Identifies Explainable Reasoning Paths of Mechanism of Drug Action for Drug Repurposing from Multilayer Biological Network

Introduction

iDPath is an interpretable deep learning-based path-reasoning framework to identify potential drugs for the treatment of diseases, by capturing the mechanism of drug action (MODA) based on simulating the paths from drugs to diseases in the human body.

Environment Requirement

The code has been tested running under Python 3.7. The required package are as follows:

  • pytorch == 1.6.0
  • numpy == 1.19.1
  • sklearn == 0.23.2
  • networkx == 2.5
  • pandas == 1.1.2

Installation

  1. To install the required packages for running iDPath, 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
  1. You may need to download the following files to run iDPath
  • Download the the shortest paths between all the targets of drugs and diseases and put two files (disease_path_dict.pkl and drug_path_dict.pkl) under the folder data/path.
  • Download the processed data and put these files under the folder data/processed.
  • Download the test data and put these files under the folder data/test.

Example to Run the Codes

Train

python train.py --config config/config.json 

Test

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/iDPath/0117_164440/model_best.pth) and use it for testing.

python test.py --config config/config.json --resume saved/models/iDPath/0117_164440/model_best.pth

Inference

  1. Data. To make an inference on the new drug-disease pair, you need to prepare a csv file named test.csv under the folder data/test with the following fields, where the drug is denoted by its PubChem CID and disease is denoted by its ICD10 code. Note that if your input drugs or diseases cannot be found in our dataset, the corresponding pairs will be ignored.
drug_pubchemcid	    disease_icd10
CID-132971	        ICD10-C61
  1. Pre-trained model. You can use your own pre-trained model or use our prepared one model_best.pth and put the config.json and model_best.pth to the folder data/test.
  2. Run. We provide an argument K in the inference_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
  1. Result. After the inference is done, you will get a file named result.csv under the folder saved/models/iDPath/xxxx_xxxxxx (where xxxx_xxxxxx is your runing time as the runing id). The result.csv contains the predicted probability of therapeutic effect and top-k critical paths of your input drug-disease pairs.

Dataset

Datasets used in the paper:

License

Distributed under the GPL-2.0 License License. See LICENSE for more information.

Contact

Jiannan Yang - [email protected]

idpath's People

Contributors

jasonjyang avatar

Stargazers

 avatar Chao XU avatar Enrique avatar  avatar LiYingCan avatar 戴早 avatar Liu Joy avatar  avatar SaraiQx avatar Julien avatar  avatar

Watchers

Kostas Georgiou avatar  avatar

idpath's Issues

About test_path_dict.pkl's generation

Dear author:
I am learning you article. It's a awesome article. I have a problem about under the test folder-test_path_dict.pkl. How can i get it ?by random shuffle the path array? but I found it has some negative sampling path? I hesitate it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.