No project description provided
Project description
PrexSyn
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.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fea9a3c724f04dccc641934c258db2bfd51302824de085309f8a8f3264dba13
|
|
| MD5 |
43675e6dd6c1e338519ef32703992aed
|
|
| BLAKE2b-256 |
1c8a37e66ce4fa7a202a69b2972e224e51699df4aee6295c41d6c13e4e390d34
|
Provenance
The following attestation bundles were made for prexsyn-1.1.2.tar.gz:
Publisher:
publish.yml on luost26/prexsyn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prexsyn-1.1.2.tar.gz -
Subject digest:
6fea9a3c724f04dccc641934c258db2bfd51302824de085309f8a8f3264dba13 - Sigstore transparency entry: 1574348769
- Sigstore integration time:
-
Permalink:
luost26/prexsyn@1d13fd4937443fcf00ab4c1e79885393dd6a9e04 -
Branch / Tag:
refs/tags/v1.1.2 - Owner: https://github.com/luost26
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1d13fd4937443fcf00ab4c1e79885393dd6a9e04 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b075269485de10da7d4ed9ca4ede9e47bce8303ccc78b3ce6b4c1b7dca8939dc
|
|
| MD5 |
c5ca1090f1c2f1ad5609e28e72515a19
|
|
| BLAKE2b-256 |
8f9bcc86f7c54da9972ae8a5bab45cb6d74eb5ebd104afe4e4e00d267cd98f5d
|
Provenance
The following attestation bundles were made for prexsyn-1.1.2-py3-none-any.whl:
Publisher:
publish.yml on luost26/prexsyn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prexsyn-1.1.2-py3-none-any.whl -
Subject digest:
b075269485de10da7d4ed9ca4ede9e47bce8303ccc78b3ce6b4c1b7dca8939dc - Sigstore transparency entry: 1574348806
- Sigstore integration time:
-
Permalink:
luost26/prexsyn@1d13fd4937443fcf00ab4c1e79885393dd6a9e04 -
Branch / Tag:
refs/tags/v1.1.2 - Owner: https://github.com/luost26
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1d13fd4937443fcf00ab4c1e79885393dd6a9e04 -
Trigger Event:
release
-
Statement type: