Skip to main content

READRetro lib test

Project description

READRetro: Natural Product Biosynthesis Planning with Retrieval-Augmented Dual-View Retrosynthesis

This is the official code repository for the paper READRetro: Natural Product Biosynthesis Planning with Retrieval-Augmented Dual-View Retrosynthesis (bioRxiv, 2023).
We also provide a web version for ease of use.

Installation

Run the following commands to install the dependencies:

conda create -n readretro python=3.8
conda activate readretro
conda install pytorch==1.12.0 cudatoolkit=11.3 -c pytorch
pip install easydict pandas tqdm numpy==1.22 OpenNMT-py==2.3.0 networkx==2.5    # need to fix the miner version of numpy (np.bool was deprecated)
conda install -c conda-forge rdkit=2019.09

Model Preparation

We provide the trained models in Google Drive.
Place the checkpoints under the folders g2s/saved_models and retroformer/saved_models.
You can use your own models trained using the official codes (https://github.com/coleygroup/Graph2SMILES and https://github.com/yuewan2/Retroformer).

Single-step Planning and Evaluation

Run the following command to evaluate the single-step performance of the models:

CUDA_VISIBLE_DEVICES=${gpu_id} python eval_single.py                    # ensemble
CUDA_VISIBLE_DEVICES=${gpu_id} python eval_single.py -m retroformer     # Retroformer
CUDA_VISIBLE_DEVICES=${gpu_id} python eval_single.py -m g2s -s 200      # Graph2SMILES

Multi-step Planning

Run the following command to plan paths of multiple products using multiprocessing:

CUDA_VISIBLE_DEVICES=${gpu_id} python run_mp.py
# e.g., CUDA_VISIBLE_DEVICES=0 python run_mp.py

You can modify other hyperparameters described in run_mp.py.
Lower num_threads if you run out of GPU capacity.

Run the following command to plan the retrosynthesis path of your own molecule:

CUDA_VISIBLE_DEVICES=${gpu_id} python run.py ${product}
# e.g., CUDA_VISIBLE_DEVICES=0 python run.py 'O=C1C=C2C=CC(O)CC2O1'

You can modify other hyperparameters described in run.py.

Multi-step Evaluation

Run the following command to evaluate the planned paths of the test molecules:

python eval.py ${save_file}
# e.g., python eval.py result/debug.txt

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

readretro_test-1.0.9.tar.gz (81.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

readretro_test-1.0.9-py3-none-any.whl (105.2 kB view details)

Uploaded Python 3

File details

Details for the file readretro_test-1.0.9.tar.gz.

File metadata

  • Download URL: readretro_test-1.0.9.tar.gz
  • Upload date:
  • Size: 81.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for readretro_test-1.0.9.tar.gz
Algorithm Hash digest
SHA256 e8149cf84c2de5aa7310abf69946c164bdb7bd041c1d6dcc5d4580911258f9d2
MD5 5c8a7efbbd98e9f5f13f73cfed59ef6b
BLAKE2b-256 5105abc7cc9f3d24733142d2c24c790a652eb7b71b8341e5137ed3a86cea6a44

See more details on using hashes here.

File details

Details for the file readretro_test-1.0.9-py3-none-any.whl.

File metadata

  • Download URL: readretro_test-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 105.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for readretro_test-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 2285eb1264d15a4e6743735c14e5006fdc54ffcab997e1cca678a7ce1bf9e54a
MD5 4f84d9fee479fa68b580ffaaf92302a2
BLAKE2b-256 2edaf66ca5effd882cf89c9324bb60ec05c6f147d2f21c5aa8b3f8518c242a0f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page