GithubHelp home page GithubHelp logo

shunsunsun / dracon Goto Github PK

View Code? Open in Web Editor NEW

This project forked from isayevlab/dracon

0.0 0.0 0.0 43.99 MB

License: Apache License 2.0

Shell 0.01% Python 0.77% CSS 1.95% HTML 0.07% Jupyter Notebook 97.19% Dockerfile 0.01%

dracon's Introduction

DRACON: Disconnected Graph Neural Networkfor Atom Mapping in Chemical Reactions

This repository is an author's implementation of the paper DRACON: Disconnected Graph Neural Networkfor Atom Mapping in Chemical Reactions

Overview

We propose a model that affords both predicting reaction outcomes and finding atom mapping at the same time. Two specific tasks are solved in parallel (see Fig.~\ref{fig:reaction}). Atoms of the main product and reaction centers are found. Centers of the reaction are atoms of the main product. The atoms change their configuration during the reaction. The configuration of an atom is an aggregate of characteristics of the atom and adjacent bonds. In terms of graph theory, both tasks are node-classification in a disconnected graph of reactant and product molecules. The novel Disconnected Graph Attention Convolution neural network (DRACON) solves the node-classification tasks. Atoms of the main product and centers of the reaction determine the outcome in the majority of reactions.

The overall model pipeline consists of four blocks. Firstly, each atom is mapped to a real vector according to its characteristics in the molecule. The model uses numerical characteristics of atoms. Secondly, the vectors are updated with Relational Graph Convolution Neural Network (RGCNN). The RGCNN generalizes Graph Convolution Neural Network for graphs with different edge types that correspond to chemical bonds. In this work, we use extended molecular graphs with molecules' and reaction's level nodes to pass information across different molecules. Then, the Transformer encoder processes the vectors. The block simulates intermolecular interaction, which is a mechanism of chemical reactions. Finally, the fully-connected neural network (FCNN) gives probabilities for each atom in the node classification problems.

Compared with other works, DRACON has several novel aspects in terms of neural network architecture. DRACON generalizes the graph convolution neural network for the disconnected molecular graphs. The natural structure of the DRACON is suitable to add features of molecules, atoms like valencies, hybridization, types of chemical bonds, etc.

The authors investigate vector representations of reactions. The best model demonstrates that pseudo-nodes in the extended graph of source molecules learn chemical information about the whole reaction. Similar representation correspond chemical reactions which have a similar mechanism.

The model analysis illustrates that it gains substantial chemical insight, and one could differentiate and group chemical reactions by their types in a fully unsupervised fashion

Requiremnts

Linux machine with Nvidia-1080Ti, Python 3.7.7 was used for the experiments with the folowing packages:

dgl-cu101==0.4
Django==3.0.7
matplotlib==3.2.1
numpy==1.18.2
pandas==1.0.3
PyYAML==5.3.1
scikit-learn
scipy
seaborn==0.10.0
torch==1.4.0
tqdm==4.45.0
rdkit

Data preprocessing

Our custom data preprocessor takes pandas dataframes stored in pickle. The dataframes should consist column 'smarts' with canonical reactions, and different other columns which will be stored in the processed dataset.

To create dataset, you should use the following commands:

cd scripts
python -u process_dataset.py --raw_dataset 'path to raw pickles directory' --save_path 'save directory'

Training

To train a model, you should use the following commands:

cd scripts
python -u experiment.py --config path to YAML configuration --device name of using device

Examples of .yml configurations are in experiments directory.

Online demo

We created an online demo which source code is in server directory. The demo is available at http://93.175.29.159:8000/.

dracon's People

Contributors

filippnikitin avatar isayev avatar dependabot[bot] 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.