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)
Metadata
Release files for partialaams 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| partialaams-0.4.0.tar.gz | 18.9 kB | With provenance | Details for partialaams-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| partialaams-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for partialaams-0.4.0-py3-none-any.whl |
Total release size: 38.6 kB
Release files / partialaams-0.4.0.tar.gz
| Download URL | partialaams-0.4.0.tar.gz |
|---|---|
| Size | 18.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
820d13dd5836bd02b9601bd1687c046f337dab21c6e440b2109776c13885e8cb
|
|
BLAKE2b-256 checksum How to use checksums |
0c1d4925b33cc5c52172a47ee362906648b9fe3d610ee8eab11cff58bc30b680
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2025.
Transparency logRelease files / partialaams-0.4.0-py3-none-any.whl
| Download URL | partialaams-0.4.0-py3-none-any.whl |
|---|---|
| Size | 19.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
474549948d0b92992cb257b5c322a93ce1f9a63ce4afe8ac557e4ec02aa20c58
|
|
BLAKE2b-256 checksum How to use checksums |
5da3325b224d6114e89c1d0ad03f830c5664ed155be91f5c4ccecc0f19dc7a3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2025.
Transparency logSecurity for partialaams 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for partialaams-0.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.