Skip to main content

Atom-atom-mapping Utils

A collection of atom-atom-mapping utility functions.

Installation

The easiest way to use AAMUtils is by installing the PyPI package aamutils.

pip install aamutils

Usage

Use in command line

The input is a list of partial atom-atom-maps (AAMs). Data is read line-by-line from a text file. Each line should contain one reaction SMILES.

Here is a simple example extending the partial AAM to a complete AAM. First generate the input data:

echo "CCC[Cl:1].[N:2]>>CCC[N:2].[Cl:1]" > testinput.txt

Next, run AAMUtils to expand the partial AAM.

python3 -m aamutils expand testinput.txt

The output is written to 'testinput_extended.json'.

cat testinput_extended.json 
[
    {
        "input": "CCC[Cl:1].[N:2]>>CCC[N:2].[Cl:1]",
        "expanded_aam": "[Cl:1][CH2:5][CH2:4][CH3:3].[NH3:2]>>[ClH:1].[NH2:2][CH2:3][CH2:4][CH3:5]",
        "ilp_status": "Optimal",
        "optimization_result": 4.0,
        "invalid_reaction_center": false,
        "reaction_edges": 4
    }
]

Use in script

  from aamutils.aam_expand import extend_aam_from_rsmi

  rsmi = "CC[CH2:3][Cl:1].[N:2]>>CC[CH2:3][N:2].[Cl:1]"

  result_smiles = extend_aam_from_rsmi(rsmi)

  print(result_smiles)
  >>> "[Cl:1][CH2:3][CH2:5][CH3:4].[NH3:2]>>[ClH:1].[NH2:2][CH2:3][CH2:5][CH3:4]"

Benchmark

To rerun the benchmarks from the paper use the benchmark.py script. The reported results can be reproduced by running the following commands:

(1) Extend partial reaction center (50%, 75% and 100% missing atoms)

python3 benchmark.py --remove-mode rc --remove-ratio 0.5 --seed 42
python3 benchmark.py --remove-mode rc --remove-ratio 0.75 --seed 42
python3 benchmark.py --remove-mode rc --remove-ratio 1 --seed 42

(2) Extend partial AAM with fully mapped RC

python3 benchmark.py --remove-mode keep_rc --remove-ratio 1 --seed 42

Functionality

Here is an overview of implemented functionality:

  • SMILES to graph and graph to SMILES parsing
  • Reaction center validity checks
  • ITS graph generation
  • Expand partial AAM to complete AAM on balanced reactions
  • AAMing based on minimal chemical distance (MCD) for balanced reactions

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 aamutils 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aamutils 0.1.1
File Size Uploaded Provenance Actions
aamutils-0.1.1.tar.gz 1.0 MB With provenance Details for aamutils-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aamutils 0.1.1
File Interpreter ABI Platform Actions
aamutils-0.1.1-py3-none-any.whl Python 3 none any Details for aamutils-0.1.1-py3-none-any.whl

Total release size: 1.1 MB

Release files / aamutils-0.1.1.tar.gz

Download URL aamutils-0.1.1.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
ec1971a2d4bad142e85c6fd863d89cd1129b108828cdfb4ad7798be2353e9a0a
BLAKE2b-256 checksum
How to use checksums
3dc498e5f12be820868292eb6a6f2768b0f97f1a1141b612185962d1426fd795
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 27, 2026.

Transparency log

Release files / aamutils-0.1.1-py3-none-any.whl

Download URL aamutils-0.1.1-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f1a871709453fdd6f036dab4802e8b9ae61e3b1342de6441cc8b2e2bbbf507fd
BLAKE2b-256 checksum
How to use checksums
659127cc7b1d216e3ccd1321adb2b8acf56a9c1b2722e309bf63c0f02408a88b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 27, 2026.

Transparency log

Security for aamutils 0.1.1

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aamutils-0.1.1.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 Oct 27, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page