In the treatment of complex diseases, a single drug often cannot provide sufficient efficacy. As a result, combination therapy has become a common approach. However, combining multiple drugs increases the likelihood of drug-drug interactions (DDIs), which may not only alter the efficacy of the drugs but also lead to harmful side effects
Follow the steps below to prepare your environment, run the model, and utilize the results.
To get started, clone this repository to your local machine:
git clone https://github.com/yourusername/comnet.git
cd comnetEnsure that you have the following dependencies:
- Python 3.7+
- PyTorch 1.10 or higher
- Torch-Geometric 2.3.1+
- RDKit for chemical informatics
- Additional libraries such as tqdm, tabulate, and yamlYou can use datasets like DrugBank, Twosides, or any custom DDI dataset. To get started, you'll need to preprocess your data. The preprocessing steps can be found in the src/tools/data_preprocessing.py script. The dataset should include:
- Molecular fingerprints
- SMILES sequences
- 3D graph representations
If you're using a custom dataset, make sure to align the data format with the expected structure.
Configure the model parameters using the config.yaml file. This includes specifying the dataset, model hyperparameters (e.g., hidden dimensions, dropout rate), and training configurations (e.g., batch size, learning rate).
model:
name: "ComNet-DDI"
hidden_dim: 64
dropout: 0.2
rmodule_dim: 128
training:
epochs: 500
batch_size: 256
lr: 0.001
weight_decay: 0.0005
iter_metric: "f1"
dataset:
name: "ddi"
data_root: "data/preprocessed/"
device:
gpu: "0"
save_dir: "save"
paths:
model_path: "save/best_model.pth"
result_path: "results/test_results.txt"Once the dataset is ready and the configuration is set, you can start training the model:
python train.py --config config.yamlAfter training, you can use the following command to test the model and evaluate its performance on the test set:
python test.py --config config.yamlComNet can be applied in several ways to enhance drug safety evaluation:
- Early identification of potential drug side effects 💥: Helps pharmaceutical researchers identify risky drug combinations before clinical trials.
- Drug safety assessment in clinical settings 🏥: Clinicians can use the model to evaluate the safety profiles of drug combinations.
- Drug discovery 🧬: By predicting DDIs and their associated side effects, ComNet can be part of the drug discovery pipeline to prioritize safer drug candidates.
Ensure your dataset includes:
- Molecular fingerprints in a format that can be processed by the model.
- SMILES sequences.
- 3D graph representations. You can refer to the
data_preprocessing.pyscript for preprocessing details.
While ComNet can run on CPU, we recommend using a GPU (CUDA-enabled) for faster training. Ensure that your system has a compatible GPU and that PyTorch with CUDA support is properly installed.
The evaluation metric is controlled through the iter_metric field in the config.yaml file. You can choose from:
- f1: F1 score (default)
- accuracy: Accuracy
- auc: Area under the curve (AUROC)
- score: Custom combination of metrics like AUROC and AP
ComNet is designed specifically for predicting side effects caused by drug combinations. If your dataset includes a wide range of side effects, the model will be able to predict more complex and varied interactions between drugs.
If you use ComNet in your research or have been inspired by it, please cite the following paper:
@article{doi:10.1021/acs.jcim.4c01737,
author = {Zhang, Zuolong and Liu, Fang and Shang, Xiaonan and Chen, Shengbo and Zuo, Fang and Wu, Yi and Long, Dazhi},
title = {ComNet: A Multiview Deep Learning Model for Predicting Drug Combination Side Effects},
journal = {Journal of Chemical Information and Modeling},
volume = {0},
number = {0},
pages = {null},
year = {0},
doi = {10.1021/acs.jcim.4c01737},
note ={PMID: 39749659},
URL = {https://doi.org/10.1021/acs.jcim.4c01737},
eprint = {https://doi.org/10.1021/acs.jcim.4c01737}
}