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
Metadata
Release files for readretro-test3 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| readretro_test3-1.0.0.tar.gz | 82.3 kB | Without provenance | Details for readretro_test3-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| readretro_test3-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for readretro_test3-1.0.0-py3-none-any.whl |
Total release size: 187.5 kB
Release files / readretro_test3-1.0.0.tar.gz
| Download URL | readretro_test3-1.0.0.tar.gz |
|---|---|
| Size | 82.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
743c4958c20a9d6366fd784d800715c52ed9224f3fd99f782eaa1ad5b6da8cd0
|
|
BLAKE2b-256 checksum How to use checksums |
81226be153ca071a5f1956a053847b643b1b9b4623bf1173549ec98b1f1d9653
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.16
|
Release files / readretro_test3-1.0.0-py3-none-any.whl
| Download URL | readretro_test3-1.0.0-py3-none-any.whl |
|---|---|
| Size | 105.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4ea503ab6ecf8a2841583c8e51967c71c082435dbe6ef6f780180b2bcb6cb932
|
|
BLAKE2b-256 checksum How to use checksums |
e52bf965787b9da7657bf0a44128c45b06cedde205397b4d9ddfcc8f3b3bbc14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.16
|
Security for readretro-test3 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.