DeepSA: A Deep-learning Driven Predictor of Compound Synthesis Accessibility
With the continuous development of artificial intelligence technology, more and more deep-generation models are used for molecule generation. However, most new molecules generated by the generation models often face great challenges in terms of synthetic accessibility.
DeepSA is a deep learning-based tool for predicting the synthetic accessibility of compounds, helping users evaluate the synthesis difficulty of molecules to select more easily synthesizable molecules for drug discovery and development. DeepSA has a much higher early enrichment rate in discriminating molecules that are difficult to synthesize. This helps users to select less expensive molecules for synthesis, thus reducing the time for drug discovery and development.
Installation
Requirements
Dependencies can be installed using the following command:
conda create -n DeepSA python=3.12
conda activate DeepSA
# for gpu version
pip3 install autogluon==1.2
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
pip3 install rdkit
Install via pip
You can install DeepSA directly using pip:
pip install deepsa
News
2024-12, because AutoGluon stopped supporting python version 3.8 starting in October 2024. Therefore, we have updated DeepSA to use Python version 3.12 and updated the training and inference scripts to adapt to the latest version of AutoGluon, thanks for your interest in DeepSA!
2023-7, DeepSA_v1.0 has been released, welcome to provide feedback on the issue!
Data
The expand training and test datasets could be easily downloaded at https://drive.google.com/drive/folders/1iup6T3Bqyy-uvpdFyP0Of_WQqn-9l62h?usp=sharing
Usage
Python Package Usage
Predict synthetic accessibility of a single SMILES
from deepsa import predict_sa
# Predict a single SMILES
result = predict_sa("CCO") # Ethanol
print(f"Synthetic accessibility score: {result['SA_score']:.4f}")
print(f"Heavy atom count: {result['HA_num']}")
print(f"Ring count: {result['Ring_num']}")
print(f"Ring system count: {result['RingSystem_num']}")
print(f"Rule of five compliance: {result['rule_of_five']}")
Predict synthetic accessibility of multiple SMILES
import pandas as pd
from deepsa import predict_sa_from_file
# Create DataFrame containing SMILES
smiles_list = ["CCO", "c1ccccc1", "CC(=O)OC1=CC=CC=C1C(=O)O"]
df = pd.DataFrame({"smiles": smiles_list})
# Predict and save results
results = predict_sa_from_file(df, output_path="results.csv")
print(results[["smiles", "easy", "hard"]])
Predict from CSV file
from deepsa import predict_sa_from_file
# Predict from CSV file (file must contain smiles column)
results = predict_sa_from_file("compounds.csv")
Command line usage
# Predict a single SMILES
deepsa-predict "CCO"
# Predict SMILES from a CSV file
deepsa-predict compounds.csv --output results.csv
Usage For Researchers
If you want to train your own model, you can run it from the command line,
running:
python DeepSA_training.py <dataset.csv/training.csv:test.csv> DeepSA_model ./data/test_set.list
If you want to use the model we proposed,
running:
python DeepSA_predict.py <input_data.csv> DeepSA_model
Online Server
We deployed a pre-trained model on a dedicated server, which is publicly available at https://bailab.siais.shanghaitech.edu.cn/deepsa, to make it easy for biomedical researcher users to utilize DeepSA in their research activity.
Users can upload their SMILES or csv files to the server, and then they can quickly obtain the predicted results.
Citation
If you find this repository useful in your research, please consider citing our paper:
Wang, S., Wang, L., Li, F. et al. DeepSA: a deep-learning driven predictor of compound synthesis accessibility. J Cheminform 15, 103 (2023). https://doi.org/10.1186/s13321-023-00771-3
Contact
If you have any questions, please feel free to contact Shihang Wang (Email: wangshh12022@shanghaitech.edu.cn) or Lin Wang (Email: wanglin3@shanghaitech.edu.cn).
Pull requests are highly welcomed!
Acknowledgments
We are grateful for the support from HPC Platform of ShanghaiTech University.
Thank you all for your attention to this work.
Metadata
Release files for deepsa 0.1.2
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 |
|---|---|---|---|---|
| deepsa-0.1.2.tar.gz | 50.0 MB | Without provenance | Details for deepsa-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| deepsa-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for deepsa-0.1.2-py3-none-any.whl |
Total release size: 100.0 MB
Release files / deepsa-0.1.2.tar.gz
| Download URL | deepsa-0.1.2.tar.gz |
|---|---|
| Size | 50.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
609cf4dbb3df76519b943292fb1b5682fd56bc74cc0e847985613a7dd7fb938e
|
|
BLAKE2b-256 checksum How to use checksums |
518477e59ecdc0aec33d72e50d0b6b3f7443cceae476398063841d1fc3d4de87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / deepsa-0.1.2-py3-none-any.whl
| Download URL | deepsa-0.1.2-py3-none-any.whl |
|---|---|
| Size | 50.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c09182a6dbcc690265403d3b6dac57e76d0387e4bfb18404b7fd63b11f6ba98a
|
|
BLAKE2b-256 checksum How to use checksums |
fa366d9d3c9e938f6b1d49389fe0dc557432460ce81d9732c99afc99583f1a07
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Security for deepsa 0.1.2
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.