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

Overview

The preprint for this work is posted on arXiv.

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

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.0.0rc1.tar.gz (10.6 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.0.0rc1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file directmultistep-1.0.0rc1.tar.gz.

File metadata

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

File hashes

Hashes for directmultistep-1.0.0rc1.tar.gz
Algorithm Hash digest
SHA256 e3d02b46c0d08909dccb1727c47e800468406ed0385c4113f24f047b0b16be40
MD5 8eb4ea2e5cd98c7f6d79fdb21f3572f5
BLAKE2b-256 03ad0931bc560b43da9b2041f603fb9a55e717fce21840cb008a83c62fcff7f5

See more details on using hashes here.

File details

Details for the file directmultistep-1.0.0rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for directmultistep-1.0.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 eafc120734bdd92361d95bdcfa16ca46fb96107a9c6166532f34b896d578bf54
MD5 6d343b4c28871f5033d4b371569c901d
BLAKE2b-256 e19d2da3929d6b7066308f7ff84eff8289a97372ded209525ca0e5b7acc66ef6

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