Utility for reaction modeling using graph grammar
Project description
SynKit
Graph-native reaction informatics and supplied-mechanism verification
SynKit represents mapped reactions, Lewis-state graphs, transformation rules, and explicitly supplied electron-flow mechanisms. The in-development v2 API adds atomic curved-arrow/fishhook groups, radical state, relative atom- and bond-centered stereochemistry, deterministic replay certificates, and mechanism trajectory graphs. It validates annotations; it does not predict the chemically preferred mechanism.
Mechanism verification quick start
from synkit.Mechanism import MechanismRecord
mechanism = MechanismRecord.from_ef_smirks(text)
certificate = mechanism.verify(electron="strict", stereo="stepwise")
trajectory = mechanism.to_mtg()
mechanism.draw(certificate=certificate, path="mechanism.svg")
mechanism.to_json("mechanism.json")
Canonical internal electron loci are lp, σ, π, and ∙; adapters accept
documented ASCII and legacy spellings. Curved arrows carry two electrons and
fishhooks carry one electron. Coupled radical events commit atomically.
SynKit graph/rule metadata supports relative tetrahedral, square-planar,
trigonal-bipyramidal, octahedral, planar double-bond, and atrop-bond stereo.
The RDKit adapter round-trips all six families when the state is representable:
tetrahedral and planar-bond stereo plus assigned square-planar,
trigonal-bipyramidal, octahedral, and atrop-bond descriptors. Unknown
non-tetrahedral or atrop orientation fails explicitly instead of disappearing.
Coordinate inference, rigid-bond descriptor variants, enhanced stereo groups,
face-selectivity prediction, and physical inference of configurational
stability remain outside the current claims. The prerelease package version is
2.0.0.dev1; its mechanism schema remains 2.0.0-draft1 while that schema is
still under prerelease review.
Stereo-bearing reaction rules keep three concerns separate:
stereo_guards constrain reactant mappings, stereo_effects store stable
before/after descriptors plus optional transition-state stereo, and
stereo_outcomes control product distributions. RACEMIC always means an
equal 0.5/0.5 pair; unequal weights use ENANTIOMERIC_MIXTURE. Unknown parity
is exact unless a rule or reactor explicitly selects wildcard query semantics.
Reversing a branching rule accepts either reactant enantiomer and emits one
reverse product instead of incorrectly branching a second time.
stereo_isomorphic(left, right) enumerates structural graph isomorphisms and
accepts only mappings that preserve the complete relative descriptor registry.
This prevents a connectivity-only mapping from equating enantiomers while
still allowing a later stereo-valid mapping in a symmetric graph.
For more details on each utility within the repository, please refer to the documentation provided in the respective folders.
Table of Contents
Installation
-
Python Installation: Ensure that Python 3.11 or later is installed on your system. You can download it from python.org.
-
Creating a Virtual Environment (Optional but Recommended): It's recommended to use a virtual environment to avoid conflicts with other projects or system-wide packages. Use the following commands to create and activate a virtual environment:
python -m venv synkit-env
source synkit-env/bin/activate
Or Conda
conda create --name synkit-env python=3.11
conda activate synkit-env
- Install from PyPi: The easiest way to use SynTemp is by installing the PyPI package synkit.
pip install synkit
Optional if you want to install full version
pip install synkit[all]
-
Install via Docker
Pull the image:docker pull tieulongphan/synkit:latest # or a specific version: docker pull tieulongphan/synkit:1.0.0
Run a container (sanity check):
docker run --rm tieulongphan/synkit:latest
Contribute
We're welcoming new contributors to build this project better. Please not hesitate to inquire me via email.
Before you start, ensure your local development environment is set up correctly. Pull the latest version of the main branch to start with the most recent stable code.
git checkout main
git pull
Working on New Features
-
Create a New Branch:
For every new feature or bug fix, create a new branch from themainbranch. Name your branch meaningfully, related to the feature or fix you are working on.git checkout -b feature/your-feature-name
-
Develop and Commit Changes:
Make your changes locally, commit them to your branch. Keep your commits small and focused; each should represent a logical unit of work.git commit -m "Describe the change"
-
Run Quality Checks:
Before finalizing your feature, run the following commands to ensure your code meets our formatting standards and passes all tests:./lint.sh # Check code format pytest Test # Run tests
Fix any issues or errors highlighted by these checks.
Integrating Changes
-
Rebase onto Staging:
Once your feature is complete and tests pass, rebase your changes onto thestagingbranch to prepare for integration.git fetch origin git rebase origin/staging
Carefully resolve any conflicts that arise during the rebase.
-
Push to Your Feature Branch: After successfully rebasing, push your branch to the remote repository.
git push origin feature/your-feature-name
-
Create a Pull Request: Open a pull request from your feature branch to the
stagingbranch. Ensure the pull request description clearly describes the changes and any additional context necessary for review.
Contributing
Publication
SynKit: A Graph-Based Python Framework for Rule-Based Reaction Modeling and Analysis
License
This project is licensed under MIT License - see the License file for details.
Acknowledgments
The relative-stereo rule model is implemented from the ideas in M.
Papusha and K. Leonhard, “StereoMolGraph: Stereochemistry-Aware Molecular and
Reaction Graphs,” J. Chem. Inf. Model. (2026), and the MIT-licensed
StereoMolGraph repository,
cross-validation commit 2189f610f23eaaf992e2e01a12ea4d0532496601.
Non-tetrahedral permutation groups are adapted under the upstream MIT license;
the retained notice is in
LICENSES/StereoMolGraph-MIT.txt.
The optional development check is run with
python tools/stereo_conformance.py /path/to/StereoMolGraph; StereoMolGraph is
not a SynKit runtime dependency. Its unknown-parity wildcard equality is an
intentional difference: SynKit keeps stored-value equality exact and exposes
wildcards only through explicit rule-query policy.
This project has received funding from the European Unions Horizon Europe Doctoral Network programme under the Marie-Skłodowska-Curie grant agreement No 101072930 (TACsy -- Training Alliance for Computational)
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 synkit-2.0.0.dev1.tar.gz.
File metadata
- Download URL: synkit-2.0.0.dev1.tar.gz
- Upload date:
- Size: 825.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ae2babdab90cb51c9abc1a0c24a6f30020a4218969fc29d6a55f6f2b4361b0a
|
|
| MD5 |
d77f1a1d1f3ec803d954df1d778faa4b
|
|
| BLAKE2b-256 |
dfa1cc3f1827ab8c4d426f87e1dd2612a1fbf0758f4696901fa34bbaba640c15
|
Provenance
The following attestation bundles were made for synkit-2.0.0.dev1.tar.gz:
Publisher:
publish-package.yml on TieuLongPhan/SynKit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
synkit-2.0.0.dev1.tar.gz -
Subject digest:
4ae2babdab90cb51c9abc1a0c24a6f30020a4218969fc29d6a55f6f2b4361b0a - Sigstore transparency entry: 2187373452
- Sigstore integration time:
-
Permalink:
TieuLongPhan/SynKit@042c9120cb76e45518e75b4cbe1e3333991eaf43 -
Branch / Tag:
refs/heads/stereo - Owner: https://github.com/TieuLongPhan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@042c9120cb76e45518e75b4cbe1e3333991eaf43 -
Trigger Event:
push
-
Statement type:
File details
Details for the file synkit-2.0.0.dev1-py3-none-any.whl.
File metadata
- Download URL: synkit-2.0.0.dev1-py3-none-any.whl
- Upload date:
- Size: 1.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e38873a2351a67e3f1dacc40c57c0e263beac9832d7d43d124f4fb5891dd7df8
|
|
| MD5 |
550b8d88223ef25022726a3412f24e3c
|
|
| BLAKE2b-256 |
f94dc47d809244e830dcf581114e989683aae722629da7aa6d5d2f74403e2bf7
|
Provenance
The following attestation bundles were made for synkit-2.0.0.dev1-py3-none-any.whl:
Publisher:
publish-package.yml on TieuLongPhan/SynKit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
synkit-2.0.0.dev1-py3-none-any.whl -
Subject digest:
e38873a2351a67e3f1dacc40c57c0e263beac9832d7d43d124f4fb5891dd7df8 - Sigstore transparency entry: 2187373462
- Sigstore integration time:
-
Permalink:
TieuLongPhan/SynKit@042c9120cb76e45518e75b4cbe1e3333991eaf43 -
Branch / Tag:
refs/heads/stereo - Owner: https://github.com/TieuLongPhan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@042c9120cb76e45518e75b4cbe1e3333991eaf43 -
Trigger Event:
push
-
Statement type: