Skip to main content

No project description provided

Project description

PrexSyn

arXiv readthedocs data

PrexSyn is an efficient, accurate, and programmable framework for exploring synthesizable chemical space.

PrexSyn is based on a decoder-only transformer architecture that autoregressively generates postfix notations of synthesis (a molecular representation based on chemical reactions and purchasable building blocks) conditioned on molecular descriptors.

PrexSyn is trained on a billion-scale datastream of postfix notations paired with molecular descriptors using only two GPUs and 32 CPU cores in two days. This is made possible by PrexSyn Engine, a real-time, high-throughput C++-based data generation pipeline.

[Documentation] [Paper] [PrexSyn Engine] [Data and Model Weights]

Capabilities

Capability Input Output Performance
Chemical space projection
Fingerprint/descriptor based generation
Molecular sampling

Usage

Documentation

Please refer to the documentation for detailed usage instructions on installation, data setup, reproducibility, and customization.

Quick example

To run a quick example, make sure uv is installed, then clone this repository. The command below is all you need to get started. No need to manually configure or download anything! On the first run, the preprocessed chemical space and model checkpoints will be downloaded automatically.

uv run python scripts/examples/projection.py \
    --smiles "COc1ccc(-c2ccnc(Nc3ccccc3)n2)cc1" \
    --draw-output-dir ./draw

The diagrams of the synthesis pathways will be saved in the ./draw directory.

examples

If you need to customize the environment (e.g., specific PyTorch/CUDA versions), please refer to the installation instructions for guidance.

Use PrexSyn in your own project

PrexSyn is designed to be modular and easy to integrate into your own projects. To get started, install PrexSyn directly from this repository (a PyPI release is planned), which will automatically install all required dependencies:

pip install git+https://github.com/luost26/prexsyn.git

The example below demonstrates how to use PrexSyn to generate synthesis pathways for a target SMILES string:

from prexsyn.shortcuts import AllInOneLoader, MoleculeProjector

config_path = "./data/trained_models/enamine2310_rxn115_202511.yml"

loader = AllInOneLoader(config_path)
projector = MoleculeProjector(
    model=loader.model().to("cuda").eval(),
    detokenizer=loader.detokenizer(),
    descriptor="ecfp4",
    num_samples=16,
)

result = projector.one("COc1ccc(-c2ccnc(Nc3ccccc3)n2)cc1")
for i, item in enumerate(result.items):
    print(item.get_tree())  # print the synthesis tree in python dict format

    img = item.get_image()
    img.save(f"output_{i}.png")  # save the synthesis tree diagram as a PNG image
    img.close()

More examples can be found in the scripts/examples directory.

Upgrade to PrexSyn v1

We have substantially refactored both the PrexSyn codebase and the PrexSyn Engine to improve usability, performance, and extensibility. Key updates include:

  • Improved usability: PrexSyn Engine is now available via PyPI.
  • Higher performance and stability: Data generation is now approximately 2× faster than reported in the paper, with improved robustness thanks to a more reliable compilation pipeline.
  • Greater flexibility: Chemical space definitions and training workflows are now easier to customize for new use cases.
  • Cleaner interfaces: Simplified and more consistent APIs for projection, fingerprint/descriptor-based generation, and sampling.
  • 🚧 Migrate molecular sampling benchmarks to the new codebase.

Note: Some features described in the original paper (mostly property-based queries) are no longer supported in the current version of PrexSyn. If you need these features, please use the v0 branch.

Citation

@article{luo2025prexsyn,
  title   = {Efficient and Programmable Exploration of Synthesizable Chemical Space},
  author  = {Shitong Luo and Connor W. Coley},
  year    = {2025},
  journal = {arXiv preprint arXiv: 2512.00384}
}

@inproceedings{luo2024chemprojector,
  title={Projecting Molecules into Synthesizable Chemical Spaces},
  author={Shitong Luo and Wenhao Gao and Zuofan Wu and Jian Peng and Connor W. Coley and Jianzhu Ma},
  booktitle={Forty-first International Conference on Machine Learning},
  year={2024}
}

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

prexsyn-1.1.2.tar.gz (32.6 kB view details)

Uploaded Source

Built Distribution

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

prexsyn-1.1.2-py3-none-any.whl (38.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: prexsyn-1.1.2.tar.gz
  • Upload date:
  • Size: 32.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for prexsyn-1.1.2.tar.gz
Algorithm Hash digest
SHA256 6fea9a3c724f04dccc641934c258db2bfd51302824de085309f8a8f3264dba13
MD5 43675e6dd6c1e338519ef32703992aed
BLAKE2b-256 1c8a37e66ce4fa7a202a69b2972e224e51699df4aee6295c41d6c13e4e390d34

See more details on using hashes here.

Provenance

The following attestation bundles were made for prexsyn-1.1.2.tar.gz:

Publisher: publish.yml on luost26/prexsyn

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: prexsyn-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 38.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for prexsyn-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b075269485de10da7d4ed9ca4ede9e47bce8303ccc78b3ce6b4c1b7dca8939dc
MD5 c5ca1090f1c2f1ad5609e28e72515a19
BLAKE2b-256 8f9bcc86f7c54da9972ae8a5bab45cb6d74eb5ebd104afe4e4e00d267cd98f5d

See more details on using hashes here.

Provenance

The following attestation bundles were made for prexsyn-1.1.2-py3-none-any.whl:

Publisher: publish.yml on luost26/prexsyn

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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