Skip to main content

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:

  1. Create a conda environment with Python 3.11.10:

    conda create -n partialaams python=3.11.10 -y
    
  2. Activate the environment:

    conda activate partialaams
    
  3. Clone the GranMapache repository:

    git clone https://github.com/MarcosLaffitte/GranMapache.git
    
  4. Navigate to the GranMapache directory:

    cd GranMapache
    
  5. Install GranMapache:

    pip install .
    
  6. Return to the original directory:

    cd ..
    
  7. Remove the GranMapache directory:

    rm -rf GranMapache
    
  8. 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

  • gm  Graph-matching extension. Please refer to https://github.com/MarcosLaffitte/GranMapache
  • ilp  ILP-based extension
  • syn  Gluing Graph extension
  • extend  Color reorder extension
  • extend_g  Color 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


Download files

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

Source Distribution

partialaams-0.4.0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

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

partialaams-0.4.0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

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

Hashes for partialaams-0.4.0.tar.gz
Algorithm Hash digest
SHA256 820d13dd5836bd02b9601bd1687c046f337dab21c6e440b2109776c13885e8cb
MD5 4873bb5ebd766e14e525b85664676438
BLAKE2b-256 0c1d4925b33cc5c52172a47ee362906648b9fe3d610ee8eab11cff58bc30b680

See more details on using hashes here.

Provenance

The following attestation bundles were made for partialaams-0.4.0.tar.gz:

Publisher: publish-package.yml on TieuLongPhan/PartialAAMs

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

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

Hashes for partialaams-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 474549948d0b92992cb257b5c322a93ce1f9a63ce4afe8ac557e4ec02aa20c58
MD5 70806f37552060c564045bd79c0a79c0
BLAKE2b-256 5da3325b224d6114e89c1d0ad03f830c5664ed155be91f5c4ccecc0f19dc7a3e

See more details on using hashes here.

Provenance

The following attestation bundles were made for partialaams-0.4.0-py3-none-any.whl:

Publisher: publish-package.yml on TieuLongPhan/PartialAAMs

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