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.0.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.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: directmultistep-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 8a15f1cf9b1fe4e985790e7b0c4218143c34d541e9598d60db54d376b8515658
MD5 7a9fc0bf1772d688dd975c6f06616b08
BLAKE2b-256 2926735c5e8fa671028884d99019843984c5ee20b721b33b94c2c7f9ae6d3f78

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for directmultistep-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 695ce4a7e6a8b41bf758ea631954f431ca6c66ce28b975a53f2d298c8664ba1a
MD5 307a4e044f8e48e51a78a2b8ba5d11dd
BLAKE2b-256 e6684388094e0dcbb00d39c389e8ed5d111c7fc2a9f82deba827dc5522219d6d

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