Skip to main content

No project description provided

Project description

DirectMultiStep: Direct Route Generation for Multi-Step Retrosynthesis

Ruff Checked with mypy Code style: black License: MIT arXiv image

Overview

This work has been published in J. Chem. Inf. Model. The preprint for this work was posted on arXiv.

You can use DMS models without installation through our web interface at models.batistalab.com. Or, if you want, you can install the package from pypi pip install directmultistep. Check out dms.batistalab.com for full documentation.

How to use

Here's a quick example to generate a retrosynthesis route (you can get relevant checkpoints by running bash download_files.sh).

from directmultistep.generate import generate_routes
from pathlib import Path

data_path = Path(__file__).resolve().parents[1] / "data"
ckpt_path = data_path / "checkpoints"
fig_path = data_path / "figures"
config_path = data_path / "configs" / "dms_dictionary.yaml"

# Generate a route for a target molecule
target = "CNCc1cc(-c2ccccc2F)n(S(=O)(=O)c2cccnc2)c1"
starting_material = "CN"

# Find routes with different models:
# Using flash model with starting material
paths = generate_routes(
    target, 
    n_steps=2, 
    starting_material=starting_material, 
    model="flash", beam_size=5,
    config_path=config_path, ckpt_dir=ckpt_path
)

# Or use explorer model to automatically determine steps
paths = generate_routes(
    target,
    starting_material=starting_material,
    model="explorer",
    beam_size=5,
    config_path=config_path, ckpt_dir=ckpt_path
)

See use-examples/generate-route.py to see more examples with other models. Other example scripts include:

  • train-model.py: Train a new model with customizable configuration for local or cluster environments
  • eval-subset.py: Evaluate a trained model on a subset of data
  • paper-figures.py: Reproduce figures from the paper
  • visualize-train-curves.py: Plot training curves and metrics

Citing

If you use DirectMultiStep in an academic project, please consider citing our publication in J. Chem. Inf. Model:

@article{directmultistep,
    author = {Shee, Yu and Morgunov, Anton and Li, Haote and Batista, Victor S.},
    title = {DirectMultiStep: Direct Route Generation for Multistep Retrosynthesis},
    journal = {Journal of Chemical Information and Modeling},
    volume = {0},
    number = {0},
    pages = {null},
    year = {0},
    doi = {10.1021/acs.jcim.4c01982},
    URL = {https://doi.org/10.1021/acs.jcim.4c01982},
    eprint = {https://doi.org/10.1021/acs.jcim.4c01982}
}

Extra Materials

Through download_files.sh you can download canonicalized versions of eMols (23M SMILES), Buyables (329k SMILES), ChEMBL-5000 (5k SMILES), and USPTO-190 (190 SMILES). Using pre-canonicalized version saves you roughly a day of cpu time. If you happen to use these canonicalized versions, consider citing the repo from figshare:

@misc{shee2025figshare,
    author = {Yu Shee and Anton Morgunov},
    title = {Data for ``DirectMultiStep: Direct Route Generation for Multistep Retrosynthesis''},
    year = {2025},
    month = {3},
    howpublished = {\url{https://figshare.com/articles/dataset/Data_for_DirectMultiStep_Direct_Route_Generation_for_Multistep_Retrosynthesis_/28629470}},
    doi = {"10.6084/m9.figshare.28629470.v1"},
    note = {Accessed: 20xx-xx-xx}
}

Also check out the HigherLev Retro repo which is the source of the Buyables stock set. route-distances is the source of ChEMBL-5000. Retro* is the source of the eMols stock set and USPTO-190.

Licenses

All code is licensed under MIT License. The content of the pre-print on arXiv is licensed under CC-BY 4.0.

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

directmultistep-1.1.2.tar.gz (55.7 kB view details)

Uploaded Source

Built Distribution

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

directmultistep-1.1.2-py3-none-any.whl (63.3 kB view details)

Uploaded Python 3

File details

Details for the file directmultistep-1.1.2.tar.gz.

File metadata

  • Download URL: directmultistep-1.1.2.tar.gz
  • Upload date:
  • Size: 55.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.4

File hashes

Hashes for directmultistep-1.1.2.tar.gz
Algorithm Hash digest
SHA256 df8db9568749c64ac6a25e19534bf99cbd90e50c7221851758e2ef8aad9fb212
MD5 c96a28c576528d213cab7257f4a7616c
BLAKE2b-256 65b02dd7088aa1f1065456126ec1ab9f17ca13f113a863d81d52f5402e30af19

See more details on using hashes here.

File details

Details for the file directmultistep-1.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for directmultistep-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 77b7e462cf7cfe702f78cde49eebdb80bc6632a6c6c142f1f16935d66c0e255b
MD5 513b58068c2d92d3575a3117b2feaf50
BLAKE2b-256 0f6a91bf9d0baa95ec872141a947234f71bae4bdf454d68fbcd114dd36f05552

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