Skip to content

mldrugdiscovery/MRGVAE

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
May 19, 2021 22:24
April 2, 2021 21:30
May 19, 2021 22:11
March 25, 2021 13:47
February 17, 2021 23:10
March 25, 2021 13:47
February 17, 2021 23:10

MRGVAE

This repository contains our implementation of "A Deep Molecular Generative Model Based on Multi-Resolution Graph Variational Autoencoders"

Requirements

  • Python(version >= 3.6)
  • Pytorch(version >= 1.1.0)
  • RDKit (version >= 2019.03)
  • networkx (version >= 2.4 )
  • numpy (version >= 1.18 )

We highly recommend you to use conda for package management.

Vocab Extraction

Fragments and interchangeable fragments are extracted by the following commond. (replace ChEMBL_Subset4Training.txt with your own molecular dataset)

unzip data/ChEMBL_Subset4Training.zip 
python vocab_extract.py --mol_data ChEMBL_Subset4Training.txt --vocab_file chembl_vocab_frag_rd2.txt --bond_file chembl_vocab_bond_rd2.txt --radius 2 --ncpu 8

Molecule Processing

Molecules are converted into three-level hierarchical graphs using the fragment vocabulary from the first step.

mkdir chembl_train
python mol_preprocess.py --mol_data ChEMBL_Subset4Training.txt --vocab chembl_vocab_frag_rd2.txt --bond chembl_vocab_bond_rd2.txt --mol_folder chembl_train/ --radius 2 --ncpu 8

Model Training

Train the model with KL regularization, use

mkdir chembl_model
python train.py --mol_folder chembl_train --vocab chembl_vocab_frag_rd2.txt --bond chembl_vocab_bond_rd2.txt --model_folder chembl_model/  --epoch 10

Molecule Generation

To generate molecules, use

python generator.py --vocab chembl_vocab_frag_rd2.txt --bond chembl_vocab_bond_rd2.txt --model_folder chembl_model/model.0 --fragment_num 5  --num_decode 100  --batch_size 20 --gen_file 'gen.txt'

To generate molecules with fixed scaffold, use

python generatorwithscaffold.py --vocab chembl_vocab_frag_rd2.txt --bond chembl_vocab_bond_rd2.txt --model_folder chembl_model/model.0 --fragment_num 5  --num_decode 100  --batch_size 20 --radius 2 --gen_file 'gen.txt' --scaffold '*[CH:1]1CCn2cncc21'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages