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)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aamutils-0.0.13.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aamutils-0.0.13-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file aamutils-0.0.13.tar.gz.

File metadata

  • Download URL: aamutils-0.0.13.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for aamutils-0.0.13.tar.gz
Algorithm Hash digest
SHA256 624e864c669338f5f76f7ce401ea2d3070b6e0a7ddf165ab0442cce0939ea270
MD5 45494907119b63d446e45ae43373b822
BLAKE2b-256 289cc07819097a2e8b2dd9b615a055da0306906554ea28a246c3c77d33c30d38

See more details on using hashes here.

Provenance

The following attestation bundles were made for aamutils-0.0.13.tar.gz:

Publisher: publish-package.yml on klausweinbauer/AAMUtils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aamutils-0.0.13-py3-none-any.whl.

File metadata

  • Download URL: aamutils-0.0.13-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for aamutils-0.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 4952468529567a656831d97a8ea22ba6b9e82bea24c05fcf40e464a1017730de
MD5 a867b55850332b77bea4a944ff15444a
BLAKE2b-256 0717b9086c8dbd86392de7ba37ab66fc609b1dba0b6f16d30f20d9a0abeac483

See more details on using hashes here.

Provenance

The following attestation bundles were made for aamutils-0.0.13-py3-none-any.whl:

Publisher: publish-package.yml on klausweinbauer/AAMUtils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page