/chemicalx

A PyTorch based deep learning library for drug pair scoring.

Primary LanguagePythonApache License 2.0Apache-2.0


PyPI Version Docs Status Code Coverage Build Status

Documentation | External Resources | Datasets | Examples

ChemicalX is a deep learning library for drug-drug interaction, polypharmacy side effect and synergy prediction. The library consists of data loaders and integrated benchmark datasets. It also includes state-of-the-art deep neural network architectures that solve the drug pair scoring task. Implemented methods cover traditional SMILES string based techniques and neural message passing based models.


Drug Pair Scoring Explained

Our framework solves the so called drug pair scoring task of computational chemistry. In this task a machine learning model has to predict the outcome of administering two drugs together in a biological or chemical context. Deep learning models which solve this task have an architecture with two distinctive parts:

  1. A drug encoder layer which takes a pair of drugs as an input (blue and red drugs below).
  2. A head layer which outputs scores in the administration context - polypharmacy in our explanatory figure.


Case Study Tutorials

We provide in-depth case study tutorials in the Documentation, each covers an aspect of ChemicalX’s functionality.


Citing

If you find ChemicalX and the new datasets useful in your research, please consider adding the following citation:

@inproceedings{chemicalx,
               author = {Benedek Rozemberczki and Charles Tapley Hoyt and Benjamin Gyori},
               title = {{ChemicalX: A Deep Learning Library fo Drug Pair Scoring}},
               year = {2022},
}

A simple example


Methods Included

In detail, the following temporal graph neural networks were implemented.

2017

2018

2019

2020

2021


Auxiliary Layers


Head over to our documentation to find out more about installation, creation of datasets and a full list of implemented methods and available datasets. For a quick start, check out the examples in the examples/ directory.

If you notice anything unexpected, please open an issue. If you are missing a specific method, feel free to open a feature request.


Installation

Binaries are provided for Python version <= 3.9.

PyTorch 1.9.0

To install the binaries for PyTorch 1.9.0, simply run

pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+${CUDA}.html
pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.9.0+${CUDA}.html
pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-1.9.0+${CUDA}.html
pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.9.0+${CUDA}.html
pip install torch-geometric
pip install chemicalx

where ${CUDA} should be replaced by either cpu, cu102, or cu111 depending on your PyTorch installation.

cpu cu102 cu111
Linux
Windows
macOS
Expand to see installation guides for older PyTorch versions...

PyTorch 1.8.0

To install the binaries for PyTorch 1.8.0, simply run

$ pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.8.0+${CUDA}.html
$ pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.8.0+${CUDA}.html
$ pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-1.8.0+${CUDA}.html
$ pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.8.0+${CUDA}.html
$ pip install torch-geometric
$ pip install torch-geometric-temporal

where ${CUDA} should be replaced by either cpu, cu101, cu102, or cu111 depending on your PyTorch installation.

cpu cu101 cu102 cu111
Linux
Windows
macOS

PyTorch 1.7.0

To install the binaries for PyTorch 1.7.0, simply run

$ pip install torch-scatter==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.7.0.html
$ pip install torch-sparse==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.7.0.html
$ pip install torch-cluster==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.7.0.html
$ pip install torch-spline-conv==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.7.0.html
$ pip install torch-geometric
$ pip install torch-geometric-temporal

where ${CUDA} should be replaced by either cpu, cu92, cu101, cu102 or cu110 depending on your PyTorch installation.

cpu cu92 cu101 cu102 cu110
Linux
Windows
macOS

PyTorch 1.6.0

To install the binaries for PyTorch 1.6.0, simply run

$ pip install torch-scatter==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.6.0.html
$ pip install torch-sparse==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.6.0.html
$ pip install torch-cluster==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.6.0.html
$ pip install torch-spline-conv==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.6.0.html
$ pip install torch-geometric
$ pip install torch-geometric-temporal

where ${CUDA} should be replaced by either cpu, cu92, cu101 or cu102 depending on your PyTorch installation.

cpu cu92 cu101 cu102
Linux
Windows
macOS

Running tests

$ python setup.py test

License