Coder Social home page Coder Social logo

linjc16 / r2-ddi Goto Github PK

View Code? Open in Web Editor NEW
13.0 2.0 1.0 20.86 MB

[BIB 2023] Official implementation of "R2-DDI: Relation-aware Feature Refinement for Drug-drug Interaction Prediction".

Dockerfile 0.08% Shell 0.84% Python 96.67% C++ 0.70% Cuda 1.27% Cython 0.43%

r2-ddi's Introduction

R2-DDI: Relation-aware Feature Refinement for Drug-drug Interaction Prediction

This repository is the official implementation of R2-DDI: Relation-aware Feature Refinement for Drug-drug Interaction Prediction. The code is originally forked from Fairseq and DVMP.

Requirements and Installation

  • PyTorch version == 1.8.0
  • PyTorch Geometric version == 1.6.3
  • RDKit version == 2020.09.5

You can build the Dockerfile or use the docker image teslazhu/pretrainmol36:latest.

To install the code from source, you should first install rdkit,

conda install -y -c conda-forge rdkit=2020.09.5

Then, install other dependencies, like

git clone https://github.com/linjc16/R2-DDI.git

pip install fairseq
pip uninstall -y fairseq 

pip install ninja
python setup.py build_ext --inplace

Getting Started

Dataset

The drugbank dataset can be seen in dataset folder. The twosides dataset can be download here.

Data Preprocessing

We evaluate our models on DrugBank and TwoSides benchmark sets. ddi_zoo/scripts/data_process and ddi_zoo/scripts/twosides/data_process are folders for preprocessing of DrugBank and TwoSides, respectively. To generate the binary data for fairseq, take the transductive setting for DrugBank as an example, run

python ddi_zoo/scripts/data_process/split_trans.py

python ddi_zoo/scripts/data_process/run_process_trans.py

bash ddi_zoo/scripts/data_process/run_binarize_trans.sh

Note that you need to change the file paths accordingly.

Training and Test

All traning and test scripts can be seen in ddi_zoo/scripts. For instance,

bash ddi_zoo/scripts/train_trans/run_gcn_feat_int_cons.sh new_build1 0.01 1e-4 256

bash ddi_zoo/scripts/train_trans/inf_gcn_feat_int_cons.sh new_build1 0.01 1e-4 256

Contact

Please feel free to submit a Github issue if you have any questions or find any bugs. We do not guarantee any support, but will do our best if we can help.

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.