/bondnet

A graph neural network for the prediction of bond dissociation energies for molecules of any charge. https://doi.org/10.1039/D0SC05251E

Primary LanguagePythonOtherNOASSERTION

Use the pretrained model: Binder

Train the model: Binder

Table of Contents

BonDNet is a graph neural network model for the prediction of bond dissociation energies (BDEs). It can be applied to both homolytic and heterolytic bond dissociations for molecules of any charge. This model is described in the paper: BonDNet: a graph neural network for the prediction of bond dissociation energies for charged molecules, Chemical Science, 2021.

BonDNet

Installation

Currently, we support installation from source:

  1. create a conda environment

    conda create --name bondnet
    conda activate bondnet
    conda install python==3.7
  2. install dependencies (see their websites for more options)

    conda install pytorch==1.6.0 torchvision -c pytorch   # https://pytorch.org
    conda install dgl==0.5.0 -c dglteam                   # https://www.dgl.ai/pages/start.html
    conda install pymatgen==2020.8.13 -c conda-forge      # https://pymatgen.org/installation.html
    conda install rdkit==2020.03.5 -c conda-forge         # https://rdkit.org/docs/Install.html
    conda install openbabel==3.1.1 -c conda-forge         # http://openbabel.org/wiki/Category:Installation
  3. install this repo

    git clone https://github.com/mjwen/bondnet.git
    pip install -e bondnet

Use pretrained model for prediction

For a quick prediction of the BDEs for a single molecule, try the live demo at: Binder

Alternatively, a command line interface (CLI) bondnet is provided for batch predictions. (Optional. We suggest switching to the pretrained branch for using the bondnet CLI to make predictions. It should be more stable. To install the pretrained branch , do cd bondnet, then git checkout pretrained, and finally pip install -e .)

  • A single molecule given by a SMILES or InChI string, e.g.:

    bondnet single "C1COC(=O)O1"
  • Multiple molecules listed in a file. Supported molecule format includes sdf, pdb, smiles and inchi, e.g.:

    bondnet multiple molecules.sdf -o results.sdf
  • Explicitly specifying the bond dissociation reactions. In this mode, a moleclue file listing all the molecules and a reaction file listing all the bond dissociation reactions are needed. Supported molecule format includes graph , sdf, pdb, smiles , and inchi. e.g.

    bondnet reaction -t graph molecule_graphs.json reactions.csv
    bondnet reaction -t sdf molecules.sdf reactions.csv 

More detailed instructions, example input files, and description of the file formats, can be found here.

Train the model

The train_bde.ipynb Jupyter notebook shows how to train BonDNet on a BDE dataset of both neutral and charged molecules. Try it at: Binder

The train_bde.ipynb Jupyter notebook trains a model on CPU. If you want to train on GPUs (a single GPU or distributed), take a look at train_bde_distributed.py. A model can be trained by

python train_bde_distributed.py  molecules.sdf  molecule_attributes.yaml  reactions.yaml

More detailed instructions, example input files, and description of the file formats, can be found here.