Collection of atom-atom-mapping utility functions.
Project description
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)
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 aamutils-0.0.10.tar.gz.
File metadata
- Download URL: aamutils-0.0.10.tar.gz
- Upload date:
- Size: 1.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ebc051cb056bbf2634fad320a7161ced3996b7035300ae8dd12fe63c0fbcf5f
|
|
| MD5 |
49b84a18e2e0b0de1ec4636fe2cc7415
|
|
| BLAKE2b-256 |
54602995c9b5efae17df0eb31ccf16fde1b9922321aeffc55732f0a699cff90e
|
Provenance
The following attestation bundles were made for aamutils-0.0.10.tar.gz:
Publisher:
publish-package.yml on klausweinbauer/AAMUtils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aamutils-0.0.10.tar.gz -
Subject digest:
2ebc051cb056bbf2634fad320a7161ced3996b7035300ae8dd12fe63c0fbcf5f - Sigstore transparency entry: 188937352
- Sigstore integration time:
-
Permalink:
klausweinbauer/AAMUtils@586379839e9504a32ae45068d234be85b0ca2859 -
Branch / Tag:
refs/tags/v0.0.10 - Owner: https://github.com/klausweinbauer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@586379839e9504a32ae45068d234be85b0ca2859 -
Trigger Event:
release
-
Statement type:
File details
Details for the file aamutils-0.0.10-py3-none-any.whl.
File metadata
- Download URL: aamutils-0.0.10-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.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f8c636f3101b0e0cb8bcd0128eb15603ecfea2be6c201a643756b5255682228
|
|
| MD5 |
1d4bafcb480fff19f6e8187b25ea9494
|
|
| BLAKE2b-256 |
7c5fd6452bdc2219c8e4ccb0bc2f7a5e4addf8c0307b1e743dcd01defecd2ced
|
Provenance
The following attestation bundles were made for aamutils-0.0.10-py3-none-any.whl:
Publisher:
publish-package.yml on klausweinbauer/AAMUtils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aamutils-0.0.10-py3-none-any.whl -
Subject digest:
6f8c636f3101b0e0cb8bcd0128eb15603ecfea2be6c201a643756b5255682228 - Sigstore transparency entry: 188937354
- Sigstore integration time:
-
Permalink:
klausweinbauer/AAMUtils@586379839e9504a32ae45068d234be85b0ca2859 -
Branch / Tag:
refs/tags/v0.0.10 - Owner: https://github.com/klausweinbauer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@586379839e9504a32ae45068d234be85b0ca2859 -
Trigger Event:
release
-
Statement type: