Giter Club home page Giter Club logo

graph2edits's Introduction

DOI

Retrosynthesis prediction using an end-to-end graph neural network for molecular graph editing

Inspired by the arrow-pushing formalism in chemical reaction mechanisms, we present a novel end-to-end architecture for retrosynthesis prediction, Graph2Edits, based on graph neural network to predict the edits of the product graph in an auto-regressive manner, and sequentially generates transformation intermediates and final reactants according to the predicted edits sequence.

Environment Requirements

Create a virtual environment to run the code of Graph2Edits. Install pytorch with the cuda version that fits your device.

conda create -n graph2edits python=3.7 \
conda activate graph2edits \
conda install -c conda-forge rdkit=2019.09.2 \
conda install pytorch==1.6.0 torchvision==0.7.0 cudatoolkit=10.1 -c pytorch \
pip install numpy==1.17.3 \  

Data preprocessing

  1. generate the edit labels and the edits sequence for reaction
python preprocess.py --mode train \
python preprocess.py --mode valid \
python preprocess.py --mode test \
  1. prepare the data for training
python prepare_data.py

Train Graph2Edits model

Go to the graph2edits folder and run the following to train the model with specified dataset (default: USPTO_50k)

python train.py --dataset uspto_50k --use_rxn_class False

The trained model will be saved at graph2edits/experiments/uspto_50k/without_rxn_class/

Evaluate using a trained model

To evaluate the trained model, run

python eval.py

to get the raw prediction file saved at graph2edits/experiments/.../pred_results.txt

Reproducing our results

To reproduce our results, run

python eval.py --dataset uspto_50k --use_rxn_class False or True --experiments 27-06-2022--10-27-22 or 30-06-2022--00-19-29

This will display the results for reaction class unknown and known setting

graph2edits's People

Contributors

jamson-zhong 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.