aamutils 0.0.1__tar.gz → 0.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {aamutils-0.0.1 → aamutils-0.0.3}/PKG-INFO +35 -7
- {aamutils-0.0.1 → aamutils-0.0.3}/README.md +34 -6
- {aamutils-0.0.1 → aamutils-0.0.3}/aamutils/__main__.py +4 -1
- {aamutils-0.0.1 → aamutils-0.0.3}/aamutils/cmd/expanding.py +3 -3
- aamutils-0.0.1/benchmarking.py → aamutils-0.0.3/benchmark.py +12 -2
- {aamutils-0.0.1 → aamutils-0.0.3}/pyproject.toml +1 -1
- {aamutils-0.0.1 → aamutils-0.0.3}/.github/workflows/publish-package.yml +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/.github/workflows/test-and-lint.yml +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/.gitignore +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/LICENSE +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/Makefile +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/aamutils/__init__.py +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/aamutils/algorithm/__init__.py +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/aamutils/algorithm/aaming.py +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/aamutils/algorithm/ilp.py +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/aamutils/cmd/__init__.py +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/aamutils/utils.py +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/conf.py +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/data/test_dataset.json +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/doc/getting_started.rst +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/doc/reference.rst +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/index.rst +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/lint.sh +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/make.bat +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/requirements.txt +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/test/__init__.py +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/test/algorithm/__init__.py +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/test/algorithm/test_aaming.py +0 -0
- {aamutils-0.0.1 → aamutils-0.0.3}/test/algorithm/test_ilp.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: aamutils
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.3
|
|
4
4
|
Summary: Collection of atom-atom-mapping utility functions.
|
|
5
5
|
Project-URL: homepage, https://github.com/klausweinbauer/AAMUtils
|
|
6
6
|
Project-URL: source, https://github.com/klausweinbauer/AAMUtils
|
|
@@ -26,7 +26,12 @@ A collection of atom-atom-mapping utility functions.
|
|
|
26
26
|
|
|
27
27
|
## Installation
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
The easiest way to use AAMUtils is by installing the PyPI package
|
|
30
|
+
[aamutils](https://pypi.org/project/aamutils/).
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
pip install aamutils
|
|
34
|
+
```
|
|
30
35
|
|
|
31
36
|
## Usage
|
|
32
37
|
|
|
@@ -43,7 +48,7 @@ echo "CCC[Cl:1].[N:2]>>CCC[N:2].[Cl:1]" > testinput.txt
|
|
|
43
48
|
Next, run AAMUtils to expand the partial AAM.
|
|
44
49
|
|
|
45
50
|
```bash
|
|
46
|
-
python3
|
|
51
|
+
python3 -m aamutils expand testinput.txt
|
|
47
52
|
```
|
|
48
53
|
|
|
49
54
|
The output is written to 'testinput_extended.json'.
|
|
@@ -56,17 +61,40 @@ cat testinput_extended.json
|
|
|
56
61
|
[
|
|
57
62
|
{
|
|
58
63
|
"input": "CCC[Cl:1].[N:2]>>CCC[N:2].[Cl:1]",
|
|
59
|
-
"expanded_aam": "[Cl:1][CH2:5][CH2:4][CH3:3].[NH3:2]>>[ClH:1].[NH2:2][CH2:
|
|
64
|
+
"expanded_aam": "[Cl:1][CH2:5][CH2:4][CH3:3].[NH3:2]>>[ClH:1].[NH2:2][CH2:3][CH2:4][CH3:5]",
|
|
60
65
|
"ilp_status": "Optimal",
|
|
61
|
-
"optimization_result":
|
|
66
|
+
"optimization_result": 4.0,
|
|
62
67
|
"invalid_reaction_center": false,
|
|
63
|
-
"reaction_edges":
|
|
68
|
+
"reaction_edges": 4
|
|
64
69
|
}
|
|
65
70
|
]
|
|
66
71
|
```
|
|
67
72
|
|
|
73
|
+
## Benchmark
|
|
74
|
+
|
|
75
|
+
To rerun the benchmarks from the paper use the ``benchmark.py`` script. The
|
|
76
|
+
reported results can be reproduced by running the following commands:
|
|
77
|
+
|
|
78
|
+
### (1) Extend partial reaction center (50%, 75% and 100% missing atoms)
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
python3 benchmark.py --remove-mode rc --remove-ratio 0.5
|
|
82
|
+
```
|
|
83
|
+
```
|
|
84
|
+
python3 benchmark.py --remove-mode rc --remove-ratio 0.75
|
|
85
|
+
```
|
|
86
|
+
```
|
|
87
|
+
python3 benchmark.py --remove-mode rc --remove-ratio 1
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### (2) Extend partial AAM with fully mapped RC
|
|
91
|
+
```
|
|
92
|
+
python3 benchmark.py --remove-mode keep_rc --remove-ratio 1
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
|
|
68
96
|
## Functionality
|
|
69
|
-
Here is an overview of implemented
|
|
97
|
+
Here is an overview of implemented functionality:
|
|
70
98
|
|
|
71
99
|
- SMILES to graph and graph to SMILES parsing
|
|
72
100
|
- Reaction center validity checks
|
|
@@ -4,7 +4,12 @@ A collection of atom-atom-mapping utility functions.
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The easiest way to use AAMUtils is by installing the PyPI package
|
|
8
|
+
[aamutils](https://pypi.org/project/aamutils/).
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
pip install aamutils
|
|
12
|
+
```
|
|
8
13
|
|
|
9
14
|
## Usage
|
|
10
15
|
|
|
@@ -21,7 +26,7 @@ echo "CCC[Cl:1].[N:2]>>CCC[N:2].[Cl:1]" > testinput.txt
|
|
|
21
26
|
Next, run AAMUtils to expand the partial AAM.
|
|
22
27
|
|
|
23
28
|
```bash
|
|
24
|
-
python3
|
|
29
|
+
python3 -m aamutils expand testinput.txt
|
|
25
30
|
```
|
|
26
31
|
|
|
27
32
|
The output is written to 'testinput_extended.json'.
|
|
@@ -34,17 +39,40 @@ cat testinput_extended.json
|
|
|
34
39
|
[
|
|
35
40
|
{
|
|
36
41
|
"input": "CCC[Cl:1].[N:2]>>CCC[N:2].[Cl:1]",
|
|
37
|
-
"expanded_aam": "[Cl:1][CH2:5][CH2:4][CH3:3].[NH3:2]>>[ClH:1].[NH2:2][CH2:
|
|
42
|
+
"expanded_aam": "[Cl:1][CH2:5][CH2:4][CH3:3].[NH3:2]>>[ClH:1].[NH2:2][CH2:3][CH2:4][CH3:5]",
|
|
38
43
|
"ilp_status": "Optimal",
|
|
39
|
-
"optimization_result":
|
|
44
|
+
"optimization_result": 4.0,
|
|
40
45
|
"invalid_reaction_center": false,
|
|
41
|
-
"reaction_edges":
|
|
46
|
+
"reaction_edges": 4
|
|
42
47
|
}
|
|
43
48
|
]
|
|
44
49
|
```
|
|
45
50
|
|
|
51
|
+
## Benchmark
|
|
52
|
+
|
|
53
|
+
To rerun the benchmarks from the paper use the ``benchmark.py`` script. The
|
|
54
|
+
reported results can be reproduced by running the following commands:
|
|
55
|
+
|
|
56
|
+
### (1) Extend partial reaction center (50%, 75% and 100% missing atoms)
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
python3 benchmark.py --remove-mode rc --remove-ratio 0.5
|
|
60
|
+
```
|
|
61
|
+
```
|
|
62
|
+
python3 benchmark.py --remove-mode rc --remove-ratio 0.75
|
|
63
|
+
```
|
|
64
|
+
```
|
|
65
|
+
python3 benchmark.py --remove-mode rc --remove-ratio 1
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### (2) Extend partial AAM with fully mapped RC
|
|
69
|
+
```
|
|
70
|
+
python3 benchmark.py --remove-mode keep_rc --remove-ratio 1
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
|
|
46
74
|
## Functionality
|
|
47
|
-
Here is an overview of implemented
|
|
75
|
+
Here is an overview of implemented functionality:
|
|
48
76
|
|
|
49
77
|
- SMILES to graph and graph to SMILES parsing
|
|
50
78
|
- Reaction center validity checks
|
|
@@ -4,9 +4,9 @@ import logging
|
|
|
4
4
|
import rdkit.Chem.rdmolfiles as rdmolfiles
|
|
5
5
|
import rdkit.Chem.rdmolops as rdmolops
|
|
6
6
|
|
|
7
|
-
from utils import mol_to_graph, set_aam, graph_to_mol, is_valid_rxn_smiles
|
|
8
|
-
from algorithm.ilp import expand_partial_aam_balanced
|
|
9
|
-
from algorithm.aaming import get_its, get_rc, is_rc_valid
|
|
7
|
+
from aamutils.utils import mol_to_graph, set_aam, graph_to_mol, is_valid_rxn_smiles
|
|
8
|
+
from aamutils.algorithm.ilp import expand_partial_aam_balanced
|
|
9
|
+
from aamutils.algorithm.aaming import get_its, get_rc, is_rc_valid
|
|
10
10
|
|
|
11
11
|
logger = logging.getLogger("aamutils")
|
|
12
12
|
|
|
@@ -50,7 +50,9 @@ def load_data():
|
|
|
50
50
|
return data
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
def run(n, remove_mode, remove_ratio):
|
|
53
|
+
def run(n, remove_mode, remove_ratio, seed=None):
|
|
54
|
+
if seed is not None:
|
|
55
|
+
random.seed(seed)
|
|
54
56
|
data = load_data()
|
|
55
57
|
testcase_cnt = 0
|
|
56
58
|
success_cnt = 0
|
|
@@ -136,6 +138,7 @@ if __name__ == "__main__":
|
|
|
136
138
|
default_rm_mode = "rc"
|
|
137
139
|
default_rm_ratio = 0.5
|
|
138
140
|
default_n = 1000
|
|
141
|
+
default_seed = None
|
|
139
142
|
|
|
140
143
|
parser = argparse.ArgumentParser(
|
|
141
144
|
prog="benchmarks.py",
|
|
@@ -171,6 +174,13 @@ if __name__ == "__main__":
|
|
|
171
174
|
+ " Default: {}"
|
|
172
175
|
).format(default_rm_ratio),
|
|
173
176
|
)
|
|
177
|
+
parser.add_argument(
|
|
178
|
+
"--seed",
|
|
179
|
+
default=default_seed,
|
|
180
|
+
help=(
|
|
181
|
+
"The seed used to initialize random number generation. " + "Default: {}"
|
|
182
|
+
).format(default_seed),
|
|
183
|
+
)
|
|
174
184
|
|
|
175
185
|
args = parser.parse_args()
|
|
176
|
-
run(args.n, args.remove_mode, args.remove_ratio)
|
|
186
|
+
run(args.n, args.remove_mode, args.remove_ratio, args.seed)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|