Skip to main content

A Deep-learning Driven Predictor of Compound Synthesis Accessibility

Project description

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

  1. 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']}")
  1. 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"]])
  1. 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")
  1. 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.

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

deepsa-0.1.2.tar.gz (50.0 MB view details)

Uploaded Source

Built Distribution

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

deepsa-0.1.2-py3-none-any.whl (50.0 MB view details)

Uploaded Python 3

File details

Details for the file deepsa-0.1.2.tar.gz.

File metadata

  • Download URL: deepsa-0.1.2.tar.gz
  • Upload date:
  • Size: 50.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for deepsa-0.1.2.tar.gz
Algorithm Hash digest
SHA256 609cf4dbb3df76519b943292fb1b5682fd56bc74cc0e847985613a7dd7fb938e
MD5 afc8a749c98f3759cacbb20bd2eb8a24
BLAKE2b-256 518477e59ecdc0aec33d72e50d0b6b3f7443cceae476398063841d1fc3d4de87

See more details on using hashes here.

File details

Details for the file deepsa-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: deepsa-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 50.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for deepsa-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c09182a6dbcc690265403d3b6dac57e76d0387e4bfb18404b7fd63b11f6ba98a
MD5 2000e1e7c55e12b48d2b83a3696d545d
BLAKE2b-256 fa366d9d3c9e938f6b1d49389fe0dc557432460ce81d9732c99afc99583f1a07

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