Coder Social home page Coder Social logo

deceptrax123 / drug-drug-interaction-dataloader Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 79 KB

PyTorch code for an effective way of making a Molecular Graph Dataset in Torch Geometric involving a pair of graphs from chemical SMILE strings

License: MIT License

Python 100.00%
chemical-reactions gnns graph-neural-networks graphs pytorch torch-geometric deep-learning graph-datasets dataloader dataset drug-drug-interaction

drug-drug-interaction-dataloader's Introduction

Torch Geometric Dataset for applications involving Chemical(SMILE Strings) Interactions

The repository contains the code for an effective way of making a Molecular Graph Dataset in Torch Geometric involving a pair of graphs.

The above implementation makes use of both node features(atoms) and edge features(bonds)

The TWOSIDES Pharamacy Side Effects Dataset from TDC was used which you can refer to here.

Download Data

In order to download the Graphs, follow the following steps.

  • Clone the Repository:git clone [email protected]:Deceptrax123/GNN-Dataloader-For-Chemical-Interaction-Applications.git
  • Run pip install -r requirements.txt
  • Save the environment variables mentioned below in a .env file
  • Run Scripts/download_pipeline.py and follow the steps to effectively save the .pt files.
  • You may edit the number of concurrent processes according to your system specs.

Train and Run

To train and evaluate GNN models, the following modifications need to be made to the graph_dataset.py script.

  • Do not override the process() function
  • Use the processed_paths property in the same way as mentioned in the docs by giving the absolute path to each .pt file. This ensures the entire dataset isnt processed again.

Featurizing nodes and edges

  • Both node and edge level features have been included.
  • For atoms we use features such as their hybridization, atomic mass, presence in an aromatic ring, formal charge etc
  • For bonds we use features such as bond type(single,double, triple), stereochemical aspects and presence in a conjugation(Resonance)

Batching

  • Since 2 graphs need to be loaded, the Batching technique has been changed. More information on this can be found here.

Environment Variables

Key Value Description
tup_bins The path to the location that saves the tuple binaries of reactants and labels.
graph_files The root directory to where you want your graph .pt files to be stored

drug-drug-interaction-dataloader's People

Contributors

deceptrax123 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.