PartialAAMs provides a benchmarking framework for evaluating the effectiveness of Partial Atom-Atom Mappings (AAMs) extensions. It simplifies the generation, manipulation, and testing of AAMs for chemical reactions.
Project description
PartialAAMs
PartialAAMs is a library designed to provide a benchmarking framework for evaluating effectiveness of Partial Atom-Atom Mappings (AAMs) extension. It simplifies the generation, manipulation, and testing of AAMs for chemical reactions.
Installation
Follow the steps below to set up the environment and install the library:
-
Create a conda environment with Python 3.11.10:
conda create -n partialaams python=3.11.10 -y
-
Activate the environment:
conda activate partialaams
-
Clone the GranMapache repository:
git clone https://github.com/MarcosLaffitte/GranMapache.git
-
Navigate to the GranMapache directory:
cd GranMapache
-
Install GranMapache:
pip install .
-
Return to the original directory:
cd ..
-
Remove the GranMapache directory:
rm -rf GranMapache
-
Install additional requirements:
pip install -r requirements.txt
Usagebenchmark
Python Interface
Extend a partial atom-atom mapping (AAM) directly from reaction SMILES. Choose one of five strategies:
from partialaams.aam_expand import partial_aam_extension_from_smiles
# Define your (partial) reaction SMILES
rsmi = "[CH3][CH:1]=[CH2:2].[H:3][H:4]>>[CH3][CH:1]([H:3])[CH2:2][H:4]"
# Expected fully-mapped SMILES
expected = (
"[CH2:1]=[CH:2][CH3:3].[H:4][H:5]>>"
"[CH2:1]([CH:2]([CH3:3])[H:5])[H:4]"
)
# Try all five extension methods:
for method in ("ilp", "gm", "syn", "extend", "extend_g"):
result = partial_aam_extension_from_smiles(rsmi, method=method)
print(f"{method:8} →", result)
# You can validate with AAMValidator, e.g.:
# assert AAMValidator.smiles_check(result, expected)
Supported methods
gmGraph-matching extension. Please refer to https://github.com/MarcosLaffitte/GranMapacheilpILP-based extensionsynGluing Graph extensionextendColor reorder extensionextend_gColor reorder extension using gm isomorphism
Command-Line Interface
Once you’ve installed partialaams (e.g. via pip install . in your project root), you can run the CLI with:
python -m partialaams [OPTIONS] [RSMI]
Options
| Flag | Description | Default |
|---|---|---|
-i, --input |
Path to a file with one reaction SMILES per line, or a single SMILES string if the file does not exist. | — |
RSMI |
Reaction SMILES string (partial AAM). Use this instead of -i when processing a single reaction directly. |
— |
-m, --method |
Extension strategy. One of: gm, ilp, syn, extend, extend_g. |
gm |
-o, --output |
File path to write the extended SMILES to. If omitted, results stream to stdout. | stdout |
-l, --list-methods |
List all supported extension methods and exit. | — |
Examples
$ python -m partialaams -i "CC[CH2:3][Cl:1].[N:2]>>CC[CH2:3][N:2].[Cl:1]"
>> [Cl:1][CH2:5][CH2:4][CH3:3].[N:2]>>[Cl:1].[N:2][CH2:5][CH2:4][CH3:3]
Benchmarking
$ python benchmarking.py
Publication
Extension of Partial Atom-to-Atom Maps: Uniqueness and Algorithms
Citation
TODO
Contributing
License
This project is licensed under MIT License - see the License file for details.
Acknowledgments
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 partialaams-0.4.0.tar.gz.
File metadata
- Download URL: partialaams-0.4.0.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
820d13dd5836bd02b9601bd1687c046f337dab21c6e440b2109776c13885e8cb
|
|
| MD5 |
4873bb5ebd766e14e525b85664676438
|
|
| BLAKE2b-256 |
0c1d4925b33cc5c52172a47ee362906648b9fe3d610ee8eab11cff58bc30b680
|
Provenance
The following attestation bundles were made for partialaams-0.4.0.tar.gz:
Publisher:
publish-package.yml on TieuLongPhan/PartialAAMs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
partialaams-0.4.0.tar.gz -
Subject digest:
820d13dd5836bd02b9601bd1687c046f337dab21c6e440b2109776c13885e8cb - Sigstore transparency entry: 708576972
- Sigstore integration time:
-
Permalink:
TieuLongPhan/PartialAAMs@ab36f02518a2d8815bbde373da2933bf86680d37 -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/TieuLongPhan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@ab36f02518a2d8815bbde373da2933bf86680d37 -
Trigger Event:
release
-
Statement type:
File details
Details for the file partialaams-0.4.0-py3-none-any.whl.
File metadata
- Download URL: partialaams-0.4.0-py3-none-any.whl
- Upload date:
- Size: 19.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
474549948d0b92992cb257b5c322a93ce1f9a63ce4afe8ac557e4ec02aa20c58
|
|
| MD5 |
70806f37552060c564045bd79c0a79c0
|
|
| BLAKE2b-256 |
5da3325b224d6114e89c1d0ad03f830c5664ed155be91f5c4ccecc0f19dc7a3e
|
Provenance
The following attestation bundles were made for partialaams-0.4.0-py3-none-any.whl:
Publisher:
publish-package.yml on TieuLongPhan/PartialAAMs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
partialaams-0.4.0-py3-none-any.whl -
Subject digest:
474549948d0b92992cb257b5c322a93ce1f9a63ce4afe8ac557e4ec02aa20c58 - Sigstore transparency entry: 708576975
- Sigstore integration time:
-
Permalink:
TieuLongPhan/PartialAAMs@ab36f02518a2d8815bbde373da2933bf86680d37 -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/TieuLongPhan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@ab36f02518a2d8815bbde373da2933bf86680d37 -
Trigger Event:
release
-
Statement type: