chemperium 0.0.1__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.
Files changed (67) hide show
  1. chemperium-0.0.1/.gitignore +248 -0
  2. chemperium-0.0.1/LICENSE +21 -0
  3. chemperium-0.0.1/PKG-INFO +287 -0
  4. chemperium-0.0.1/README.md +229 -0
  5. chemperium-0.0.1/coverage-badge.svg +1 -0
  6. chemperium-0.0.1/docs/Makefile +20 -0
  7. chemperium-0.0.1/docs/make.bat +35 -0
  8. chemperium-0.0.1/docs/source/api/chemperium.data.rst +37 -0
  9. chemperium-0.0.1/docs/source/api/chemperium.features.rst +29 -0
  10. chemperium-0.0.1/docs/source/api/chemperium.model.rst +21 -0
  11. chemperium-0.0.1/docs/source/api/chemperium.molecule.rst +29 -0
  12. chemperium-0.0.1/docs/source/api/chemperium.postprocessing.rst +29 -0
  13. chemperium-0.0.1/docs/source/api/chemperium.rst +34 -0
  14. chemperium-0.0.1/docs/source/api/chemperium.training.rst +53 -0
  15. chemperium-0.0.1/docs/source/api/modules.rst +7 -0
  16. chemperium-0.0.1/docs/source/conf.py +97 -0
  17. chemperium-0.0.1/docs/source/index.rst +20 -0
  18. chemperium-0.0.1/misc/eu.png +0 -0
  19. chemperium-0.0.1/misc/fwo.png +0 -0
  20. chemperium-0.0.1/misc/transpharm.png +0 -0
  21. chemperium-0.0.1/notebooks/demo.ipynb +230 -0
  22. chemperium-0.0.1/notebooks/train_model.ipynb +124 -0
  23. chemperium-0.0.1/pyproject.toml +124 -0
  24. chemperium-0.0.1/scripts/test.py +13 -0
  25. chemperium-0.0.1/scripts/train.py +16 -0
  26. chemperium-0.0.1/src/chemperium/__about__.py +3 -0
  27. chemperium-0.0.1/src/chemperium/__init__.py +4 -0
  28. chemperium-0.0.1/src/chemperium/data/__init__.py +0 -0
  29. chemperium-0.0.1/src/chemperium/data/load_data.py +287 -0
  30. chemperium-0.0.1/src/chemperium/data/load_test_data.py +182 -0
  31. chemperium-0.0.1/src/chemperium/data/parse_csv.py +71 -0
  32. chemperium-0.0.1/src/chemperium/features/__init__.py +0 -0
  33. chemperium-0.0.1/src/chemperium/features/calc_features.py +377 -0
  34. chemperium-0.0.1/src/chemperium/features/featurize.py +95 -0
  35. chemperium-0.0.1/src/chemperium/inp.py +154 -0
  36. chemperium-0.0.1/src/chemperium/model/__init__.py +0 -0
  37. chemperium-0.0.1/src/chemperium/model/mpnn.py +291 -0
  38. chemperium-0.0.1/src/chemperium/molecule/__init__.py +0 -0
  39. chemperium-0.0.1/src/chemperium/molecule/batch.py +89 -0
  40. chemperium-0.0.1/src/chemperium/molecule/graph.py +170 -0
  41. chemperium-0.0.1/src/chemperium/postprocessing/__init__.py +0 -0
  42. chemperium-0.0.1/src/chemperium/postprocessing/thermodynamics.py +113 -0
  43. chemperium-0.0.1/src/chemperium/postprocessing/uncertainty_quantification.py +58 -0
  44. chemperium-0.0.1/src/chemperium/training/__init__.py +0 -0
  45. chemperium-0.0.1/src/chemperium/training/evaluate.py +235 -0
  46. chemperium-0.0.1/src/chemperium/training/predict.py +362 -0
  47. chemperium-0.0.1/src/chemperium/training/represent.py +73 -0
  48. chemperium-0.0.1/src/chemperium/training/run.py +259 -0
  49. chemperium-0.0.1/src/chemperium/training/test.py +46 -0
  50. chemperium-0.0.1/src/chemperium/training/train.py +51 -0
  51. chemperium-0.0.1/test_data/liquid/logp/2d/model_0.keras +0 -0
  52. chemperium-0.0.1/test_data/liquid/logp/2d/scaler.pkl +0 -0
  53. chemperium-0.0.1/test_data/test_example.csv +14 -0
  54. chemperium-0.0.1/test_data/test_output/model.keras +0 -0
  55. chemperium-0.0.1/test_data/test_output/scaler.pkl +0 -0
  56. chemperium-0.0.1/test_data/test_output/test_preds.csv +3 -0
  57. chemperium-0.0.1/test_data/test_output/validation_preds.csv +4 -0
  58. chemperium-0.0.1/test_data/thermo/g3mp2b3/2d/model_0.keras +0 -0
  59. chemperium-0.0.1/test_data/thermo/g3mp2b3/2d/scaler.pkl +0 -0
  60. chemperium-0.0.1/test_data/thermo/g3mp2b3/3d/fact_sheet.json +1 -0
  61. chemperium-0.0.1/test_data/thermo/g3mp2b3/3d/model_0.keras +0 -0
  62. chemperium-0.0.1/test_data/thermo/g3mp2b3/3d/scaler.pkl +0 -0
  63. chemperium-0.0.1/test_data/thermo/g3mp2b3/3d/xtest.pkl +0 -0
  64. chemperium-0.0.1/tests/test_import.py +3 -0
  65. chemperium-0.0.1/tests/test_predict.py +38 -0
  66. chemperium-0.0.1/tests/test_train.py +17 -0
  67. chemperium-0.0.1/tox.ini +57 -0
@@ -0,0 +1,248 @@
1
+ # Created by https://www.toptal.com/developers/gitignore/api/macos,python,windows,jupyternotebooks
2
+ # Edit at https://www.toptal.com/developers/gitignore?templates=macos,python,windows,jupyternotebooks
3
+
4
+ ### JupyterNotebooks ###
5
+ # gitignore template for Jupyter Notebooks
6
+ # website: http://jupyter.org/
7
+
8
+ .ipynb_checkpoints
9
+ */.ipynb_checkpoints/*
10
+
11
+ # IPython
12
+ profile_default/
13
+ ipython_config.py
14
+
15
+ # Remove previous ipynb_checkpoints
16
+ # git rm -r .ipynb_checkpoints/
17
+
18
+ ### macOS ###
19
+ # General
20
+ .DS_Store
21
+ .AppleDouble
22
+ .LSOverride
23
+
24
+ # Icon must end with two \r
25
+ Icon
26
+
27
+
28
+ # Thumbnails
29
+ ._*
30
+
31
+ # Files that might appear in the root of a volume
32
+ .DocumentRevisions-V100
33
+ .fseventsd
34
+ .Spotlight-V100
35
+ .TemporaryItems
36
+ .Trashes
37
+ .VolumeIcon.icns
38
+ .com.apple.timemachine.donotpresent
39
+
40
+ # Directories potentially created on remote AFP share
41
+ .AppleDB
42
+ .AppleDesktop
43
+ Network Trash Folder
44
+ Temporary Items
45
+ .apdisk
46
+
47
+ ### macOS Patch ###
48
+ # iCloud generated files
49
+ *.icloud
50
+
51
+ ### Python ###
52
+ # Byte-compiled / optimized / DLL files
53
+ __pycache__/
54
+ *.py[cod]
55
+ *$py.class
56
+
57
+ # C extensions
58
+ *.so
59
+
60
+ # Distribution / packaging
61
+ .Python
62
+ build/
63
+ develop-eggs/
64
+ dist/
65
+ downloads/
66
+ eggs/
67
+ .eggs/
68
+ lib/
69
+ lib64/
70
+ parts/
71
+ sdist/
72
+ var/
73
+ wheels/
74
+ share/python-wheels/
75
+ *.egg-info/
76
+ .installed.cfg
77
+ *.egg
78
+ MANIFEST
79
+
80
+ # PyInstaller
81
+ # Usually these files are written by a python script from a template
82
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
83
+ *.manifest
84
+ *.spec
85
+
86
+ # Installer logs
87
+ pip-log.txt
88
+ pip-delete-this-directory.txt
89
+
90
+ # Unit test / coverage reports
91
+ htmlcov/
92
+ .tox/
93
+ .nox/
94
+ .coverage
95
+ .coverage.*
96
+ .cache
97
+ nosetests.xml
98
+ coverage.xml
99
+ *.cover
100
+ *.py,cover
101
+ .hypothesis/
102
+ .pytest_cache/
103
+ cover/
104
+
105
+ # Translations
106
+ *.mo
107
+ *.pot
108
+
109
+ # Django stuff:
110
+ *.log
111
+ local_settings.py
112
+ db.sqlite3
113
+ db.sqlite3-journal
114
+
115
+ # Flask stuff:
116
+ instance/
117
+ .webassets-cache
118
+
119
+ # Scrapy stuff:
120
+ .scrapy
121
+
122
+ # Sphinx documentation
123
+ docs/_build/
124
+
125
+ # PyBuilder
126
+ .pybuilder/
127
+ target/
128
+
129
+ # Jupyter Notebook
130
+
131
+ # IPython
132
+
133
+ # pyenv
134
+ # For a library or package, you might want to ignore these files since the code is
135
+ # intended to run in multiple environments; otherwise, check them in:
136
+ # .python-version
137
+
138
+ # pipenv
139
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
140
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
141
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
142
+ # install all needed dependencies.
143
+ #Pipfile.lock
144
+
145
+ # poetry
146
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
147
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
148
+ # commonly ignored for libraries.
149
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
150
+ #poetry.lock
151
+
152
+ # pdm
153
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
154
+ #pdm.lock
155
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
156
+ # in version control.
157
+ # https://pdm.fming.dev/#use-with-ide
158
+ .pdm.toml
159
+
160
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
161
+ __pypackages__/
162
+
163
+ # Celery stuff
164
+ celerybeat-schedule
165
+ celerybeat.pid
166
+
167
+ # SageMath parsed files
168
+ *.sage.py
169
+
170
+ # Environments
171
+ .env
172
+ .venv
173
+ env/
174
+ venv/
175
+ ENV/
176
+ env.bak/
177
+ venv.bak/
178
+
179
+ # Spyder project settings
180
+ .spyderproject
181
+ .spyproject
182
+
183
+ # Rope project settings
184
+ .ropeproject
185
+
186
+ # mkdocs documentation
187
+ /site
188
+
189
+ # mypy
190
+ .mypy_cache/
191
+ .dmypy.json
192
+ dmypy.json
193
+
194
+ # Pyre type checker
195
+ .pyre/
196
+
197
+ # pytype static type analyzer
198
+ .pytype/
199
+
200
+ # Cython debug symbols
201
+ cython_debug/
202
+
203
+ # PyCharm
204
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
205
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
206
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
207
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
208
+ #.idea/
209
+
210
+ ### Python Patch ###
211
+ # Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
212
+ poetry.toml
213
+
214
+ # ruff
215
+ .ruff_cache/
216
+
217
+ # LSP config files
218
+ pyrightconfig.json
219
+
220
+ ### Windows ###
221
+ # Windows thumbnail cache files
222
+ Thumbs.db
223
+ Thumbs.db:encryptable
224
+ ehthumbs.db
225
+ ehthumbs_vista.db
226
+
227
+ # Dump file
228
+ *.stackdump
229
+
230
+ # Folder config file
231
+ [Dd]esktop.ini
232
+
233
+ # Recycle Bin used on file shares
234
+ $RECYCLE.BIN/
235
+
236
+ # Windows Installer files
237
+ *.cab
238
+ *.msi
239
+ *.msix
240
+ *.msm
241
+ *.msp
242
+
243
+ # Windows shortcuts
244
+ *.lnk
245
+
246
+ # End of https://www.toptal.com/developers/gitignore/api/macos,python,windows,jupyternotebooks
247
+ /caesar-data/
248
+ /.idea/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Maarten R. Dobbelaere
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,287 @@
1
+ Metadata-Version: 2.3
2
+ Name: chemperium
3
+ Version: 0.0.1
4
+ Summary: Chemperium package
5
+ Project-URL: source, https://github.com/mrodobbe/chemperium
6
+ Project-URL: tracker, https://github.com/mrodobbe/chemperium/issues
7
+ Author-email: "Maarten R. Dobbelaere" <mrodobbe.dobbelaere@ugent.be>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2024 Maarten R. Dobbelaere
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ License-File: LICENSE
30
+ Classifier: Development Status :: 3 - Alpha
31
+ Classifier: Intended Audience :: Developers
32
+ Classifier: License :: OSI Approved :: MIT License
33
+ Classifier: Operating System :: OS Independent
34
+ Classifier: Programming Language :: Python
35
+ Classifier: Programming Language :: Python :: 3
36
+ Classifier: Programming Language :: Python :: 3.8
37
+ Classifier: Programming Language :: Python :: 3.9
38
+ Classifier: Programming Language :: Python :: 3.10
39
+ Classifier: Programming Language :: Python :: 3.11
40
+ Classifier: Topic :: Software Development :: Build Tools
41
+ Requires-Python: >=3.8
42
+ Requires-Dist: keras<3.0
43
+ Requires-Dist: numpy
44
+ Requires-Dist: pandas
45
+ Requires-Dist: rdkit
46
+ Requires-Dist: scikit-learn
47
+ Requires-Dist: scipy
48
+ Requires-Dist: tensorflow<=2.15
49
+ Requires-Dist: tqdm
50
+ Provides-Extra: test
51
+ Requires-Dist: genbadge[coverage]; extra == 'test'
52
+ Requires-Dist: hypothesis; extra == 'test'
53
+ Requires-Dist: mypy; extra == 'test'
54
+ Requires-Dist: pytest; extra == 'test'
55
+ Requires-Dist: pytest-cov; extra == 'test'
56
+ Requires-Dist: tox; extra == 'test'
57
+ Description-Content-Type: text/markdown
58
+
59
+ ![Coverage Status](coverage-badge.svg)
60
+ # Chemperium
61
+ *Portmanteau of the Latin words Chemia and Imperium: "a chemical empire"*. <br><br>
62
+ Chemperium is a deep learning toolkit that aims to conquer the chemical space of compounds and properties.
63
+ The main focus of this tool is on the applicability and accuracy of trained models.
64
+ While many publications, tools, and datasets are out on molecular property prediction,
65
+ we target both experts and non-experts in cheminformatics to make fast and accurate predictions. <br>
66
+ In this package, we provide a validated software tool and trained machine learning models
67
+ to make reliable molecular property predictions with a minimum of code and time.
68
+
69
+ ## Table of Contents
70
+ - [Installation](#1-installation)
71
+ - [Usage](#2-usage)
72
+ * [Predicting Properties](#predicting-properties-with-chemperium)
73
+ + [Liquid-Phase Properties](#liquid-phase-properties)
74
+ + [Thermochemistry](#thermochemistry)
75
+ * [Training Models](#training-machine-learning-models)
76
+ * [Testing Models](#testing-trained-machine-learning-models)
77
+ * [Representation Learning](#creating-a-learned-representation)
78
+ - [Scripts](#3-scripts)
79
+ * [Command-Line Training](#training-a-model-via-command-line)
80
+ * [Command-Line Testing](#testing-a-model-via-command-line)
81
+ - [Tutorial](#4-tutorial)
82
+ - [Datasets](#5-datasets)
83
+ - [Reference](#6-reference)
84
+
85
+ ## 1. Installation
86
+ Chemperium is built upon NumPy, Pandas, RDKit, TensorFlow, Keras, and Scikit-Learn.
87
+ The package can be installed using pip:
88
+
89
+ Install a virtual environment in Anaconda:
90
+ ```
91
+ conda create -n chemperium python=3.11
92
+ conda activate chemperium
93
+ ```
94
+
95
+ ```
96
+ git clone https://github.com/mrodobbe/chemperium.git
97
+ cd chemperium
98
+ pip install .
99
+ ```
100
+
101
+ ## 2. Usage
102
+ Chemperium can be loaded as a python package by importing `chemperium`.
103
+ There are various options to predict properties of molecules or to train new models.
104
+
105
+ ### Predicting properties with chemperium
106
+ A distinction is made between liquid-phase properties and thermochemistry.
107
+ #### **Liquid-phase properties**
108
+ Liquid-phase properties are predicted with the module `chemperium.training.predict.Liquid`.
109
+ In this module, it is necessary to specify the target property, the dimension of molecular information (2D or 3D),
110
+ and the location of the trained models.
111
+
112
+ <br>*2D example for boiling point*<br>
113
+
114
+ ```
115
+ import chemperium as cp
116
+
117
+ bp_model = cp.Liquid("bp", "2d", <folder>)
118
+ prediction = bp_model.predict("COc1ccccc1")
119
+ ```
120
+
121
+ (currently supported properties: `bp`, `tc`, `pc`, `vp`, `logp`, `logs`)<br><br>
122
+ #### **Thermochemistry**
123
+ The prediction of thermochemical properties is done in a similar way
124
+ with the module `chemperium.training.predict.Thermo`. A distinction is made in the functions to predict enthalpy of formation, entropy of formation,
125
+ and gibbs free energy of formation.
126
+ It is possible to predict at temperatures between 298 K and 1500 K.
127
+ When 3D predictions are chosen, Δ-machine learning will be used and a lower level-of-theory estimate should be provided.
128
+ At this moment, all predictions are in `kcal/mol` for enthalpy and `cal/mol/K` for entropy.
129
+
130
+ <br>*3D example for CBS-QB3*<br>
131
+
132
+ ```
133
+ import chemperium as cp
134
+
135
+ smi = "COc1ccccc1"
136
+ xyz = '16\n' \
137
+ '\n' \
138
+ 'C 2.76930 0.32250 -0.00050\n' \
139
+ 'O 1.76340 -0.67620 -0.00000\n' \
140
+ 'C 0.45600 -0.27750 -0.00000\n' \
141
+ 'C -0.49220 -1.31180 -0.00020\n' \
142
+ 'C -1.84930 -1.01160 -0.00010\n' \
143
+ 'C -2.28360 0.31900 0.00010\n' \
144
+ 'C -1.33830 1.34160 0.00020\n' \
145
+ 'C 0.03130 1.05620 0.00020\n' \
146
+ 'H 3.72200 -0.21080 -0.00090\n' \
147
+ 'H 2.71000 0.95720 -0.89500\n' \
148
+ 'H 2.71080 0.95730 0.89390\n' \
149
+ 'H -0.13750 -2.33800 -0.00030\n' \
150
+ 'H -2.57430 -1.82150 -0.00030\n' \
151
+ 'H -3.34470 0.55070 0.00010\n' \
152
+ 'H -1.65940 2.38020 0.00040\n' \
153
+ 'H 0.74700 1.87060 0.00030'
154
+ llot = -5.13245
155
+
156
+ thermo = cp.Thermo("cbs-qb3", "3d", <folder>)
157
+
158
+ # Predict the standard enthalpy of formation at 298 K
159
+ h298_prediction = thermo.predict_enthalpy(smi, xyz, llot, quality_check=True)
160
+
161
+ # Predict the Gibbs free energy at 1000 K
162
+ g1000_prediction = thermo.predict_gibbs(smi, xyz, llot, t=1000)
163
+
164
+ # Predict the thermochemistry in Chemkin format
165
+ chemkin_inp = thermo.get_nasa_polynomials("anisole", smi, xyz, llot, chemkin=True)
166
+ ```
167
+
168
+
169
+ ### Training machine learning models
170
+ The `Thermo` and `Liquid` modules are trained in advance. It is also possible to train models by yourself.
171
+ For this purpose, the function `chemperium.training.train.train` is needed.
172
+ It requires three arguments: the location of a CSV file with training data,
173
+ a list with target properties, and (optionally) a dictionary with training arguments.
174
+ <br><br>
175
+ *Training a 3D MPNN for prediction of logP and logS*:
176
+
177
+ ```
178
+ import chemperium as cp
179
+
180
+ csv_location = "examples/example_data.csv"
181
+ props = ["logp", "logs"]
182
+ save_dir = "examples/output"
183
+ input_args = {"rdf": True,
184
+ "cutoff": 2.1,
185
+ "num_layers": 3,
186
+ "hidden_size": 128,
187
+ "depth": 4}
188
+ cp.train(csv_location, props, save_dir, input_args)
189
+ ```
190
+
191
+
192
+ ### Testing trained machine learning models
193
+ Property prediction models that have been trained with the function `chemperium.training.train.train` can
194
+ be used for predicting properties using the module `chemperium.training.test.test`.
195
+ The usage is highly resembling to the `train` function and requires following information:
196
+ * `smiles`: a list with SMILES identifiers
197
+ * `prop`: the target property/ies
198
+ * `save_dir`: the folder where the models are stored
199
+ * `xyz`: (optional) List with 3D coordinates of the target compounds
200
+ * `return_results`: (optional) A bool that states whether results should be returned as DataFrame. Defaults to False
201
+ * `input_args`: (optional) Dictionary with training arguments of the trained models
202
+
203
+ *Testing a 3D MPNN for prediction of logP and logS*:
204
+
205
+ ```
206
+ import chemperium as cp
207
+
208
+ smi = ["COc1ccccc1"]
209
+ xyz = ['16\n' \
210
+ '\n' \
211
+ 'C 2.76930 0.32250 -0.00050\n' \
212
+ 'O 1.76340 -0.67620 -0.00000\n' \
213
+ 'C 0.45600 -0.27750 -0.00000\n' \
214
+ 'C -0.49220 -1.31180 -0.00020\n' \
215
+ 'C -1.84930 -1.01160 -0.00010\n' \
216
+ 'C -2.28360 0.31900 0.00010\n' \
217
+ 'C -1.33830 1.34160 0.00020\n' \
218
+ 'C 0.03130 1.05620 0.00020\n' \
219
+ 'H 3.72200 -0.21080 -0.00090\n' \
220
+ 'H 2.71000 0.95720 -0.89500\n' \
221
+ 'H 2.71080 0.95730 0.89390\n' \
222
+ 'H -0.13750 -2.33800 -0.00030\n' \
223
+ 'H -2.57430 -1.82150 -0.00030\n' \
224
+ 'H -3.34470 0.55070 0.00010\n' \
225
+ 'H -1.65940 2.38020 0.00040\n' \
226
+ 'H 0.74700 1.87060 0.00030']
227
+ props = ["logp", "logs"]
228
+ save_dir = "examples/output"
229
+ input_args = {"rdf": True,
230
+ "cutoff": 2.1,
231
+ "num_layers": 3,
232
+ "hidden_size": 128,
233
+ "depth": 4}
234
+ results = cp.test(smi, props, save_dir, xyz, True, input_args)
235
+ ```
236
+
237
+ ### Creating a learned representation
238
+
239
+
240
+ ## 3. Scripts
241
+ It is also possible to train and test models via command line. Below, we show the example from
242
+ [Training](#training-machine-learning-models) and [Testing](#testing-trained-machine-learning-models).
243
+ ### Training a model via command line
244
+ The script can be found in scripts/train.py.
245
+ ```
246
+ python train.py --data "examples/example_data.csv" --save_dir "examples/output" --property "logp,logs"
247
+ --rdf --cutoff 2.1 --num_layers 3 --hidden_size 128 --depth 4
248
+ ```
249
+
250
+ ### Testing a model via command line
251
+ ```
252
+ python test.py --test_data "examples/example_test_data.csv" --save_dir "examples/output" --property "logp,logs"
253
+ --rdf --cutoff 2.1 --num_layers 3 --hidden_size 128 --depth 4
254
+ ```
255
+
256
+ ## 4. Tutorial
257
+ A small demo notebook is available in `notebooks/demo.ipynb`.
258
+
259
+ ## 5. Datasets
260
+ All datasets are available in the [Zenodo repository](https://www.doi.org/10.5281/zenodo.11409710).
261
+
262
+ ## 6. Reference
263
+ When using chemperium for your own work, please refer to the original publication: <br>
264
+ `M. R. Dobbelaere, I. Lengyel, C. V. Stevens, and K. M. Van Geem,
265
+ Geometric Deep Learning for Molecular Property Predictions with Chemical Accuracy Across Chemical Space,
266
+ Submitted, 2024.`
267
+
268
+ ```
269
+ @ARTICLE{Dobbelaere2024,
270
+ title = "Geometric Deep Learning for Molecular Property Predictions with Chemical Accuracy Across Chemical Space",
271
+ author = "Dobbelaere, Maarten R and Lengyel, Istvan and Stevens,
272
+ Christian V and Van Geem, Kevin M",
273
+ journal = "Submitted",
274
+ year = 2024,
275
+ language = "en"
276
+ }
277
+ ```
278
+
279
+ ## Acknowledgments
280
+ This software tool has been developed with support from the Research Fund of Flanders (FWO-Vlaanderen, grant 1S45522N),
281
+ the European Research Council (ERC grant 818607), and the European Union's Horizon Programme (grant 101057816,
282
+ "[TransPharm](https://transforming-pharma.eu/)").
283
+
284
+
285
+ <img src="misc/fwo.png" alt="fwo" height="50"/> <br> <br>
286
+ <img src="misc/transpharm.png" alt="transpharm" height="100"/>        
287
+ <img src="misc/eu.png" alt="EU" height="50"/>