toff 0.0.2__tar.gz → 0.2.0__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.
@@ -1,35 +1,39 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: toff
3
- Version: 0.0.2
4
- Summary: toff is a python package to get topologies from the OpenFF initiative
5
- Home-page: https://github.com/ale94mleon/toff
6
- Author: Alejandro Martínez León
7
- Author-email: ale94mleon@gmail.com
8
- License: Apache License 2.0
3
+ Version: 0.2.0
4
+ Summary: toff is a python package to get topologies from the OpenFF initiative.
5
+ Author-email: Alejandro Martínez-León <ale94mleon@gmail.com>
6
+ Project-URL: Hompage, https://github.com/ale94mleon/toff
9
7
  Project-URL: Discussions, https://github.com/ale94mleon/toff/discussions
10
8
  Project-URL: Documentation, https://toff.readthedocs.io/en/latest/
11
9
  Project-URL: Issues, https://github.com/ale94mleon/toff/issues
12
- Keywords: science,chemistry,molecular-dynamic,biology,drug-design
13
- Platform: linux
10
+ Keywords: science,chemistry,biology,drug-design,molecular-dynamic
14
11
  Classifier: Development Status :: 2 - Pre-Alpha
15
12
  Classifier: Operating System :: POSIX :: Linux
16
13
  Classifier: Operating System :: MacOS
17
14
  Classifier: Intended Audience :: Science/Research
18
15
  Classifier: License :: OSI Approved :: Apache Software License
19
16
  Classifier: Programming Language :: Python :: 3
20
- Classifier: Programming Language :: Python :: 3.8
21
17
  Classifier: Programming Language :: Python :: 3.9
22
18
  Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
23
21
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
24
22
  Classifier: Topic :: Scientific/Engineering :: Chemistry
25
23
  Classifier: Topic :: Scientific/Engineering :: Physics
26
- Requires-Python: <3.11,>=3.8
24
+ Requires-Python: >3.8
27
25
  Description-Content-Type: text/x-rst
28
- Provides-Extra: test
29
26
  License-File: LICENSE
27
+ Requires-Dist: pyyaml
28
+ Requires-Dist: parmed
29
+ Requires-Dist: rdkit
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest; extra == "dev"
32
+ Dynamic: license-file
30
33
 
31
34
  TOFF
32
35
  =======
36
+ |logo|
33
37
 
34
38
  .. list-table::
35
39
  :widths: 12 35
@@ -39,7 +43,7 @@ TOFF
39
43
  * - **Tutorials**
40
44
  - |binder|
41
45
  * - **CI/CD**
42
- - |tests| |codecov| |codacy| |CodeQL|
46
+ - |tests| |codecov| |codacy|
43
47
  * - **Build**
44
48
  - |pypi-version|
45
49
  * - **Source Code**
@@ -56,8 +60,10 @@ TOFF
56
60
  Description
57
61
  -----------
58
62
 
59
- **TOFF** (Topologies from OpenFF) is a python package to get topologies from the OpenFF initiative. It was strongly inspired in this `Aniket's script <https://github.com/aniketsh/OpenFF/blob/82a2b5803e36b72f3525e3b8631cf256fbd8e35a/openff_topology.py>`__.
63
+ **TOFF** (Topologies from OpenFF) is a Python package initially developed to get topologies from the OpenFF initiative. It was strongly inspired in this `Aniket's script <https://github.com/aniketsh/OpenFF/blob/82a2b5803e36b72f3525e3b8631cf256fbd8e35a/openff_topology.py>`__.
60
64
 
65
+ Since version **0.1.0** it is also possible to get `GAFF <https://ambermd.org/antechamber/gaff.html>`__ and
66
+ `Espaloma <https://docs.espaloma.org/en/latest/>`__.
61
67
 
62
68
  You can try it out prior to any installation on `Binder <https://mybinder.org/v2/gh/ale94mleon/TOFF/HEAD?labpath=%2Fdocs%2Fnotebooks%2F>`__.
63
69
 
@@ -81,12 +87,15 @@ Citing **TOFF**
81
87
 
82
88
  Please refer to the `citation page <https://TOFF.readthedocs.io/en/latest/source/citations.html>`__ on the documentation.
83
89
 
84
- Foundings
85
- ---------
90
+ Funding
91
+ -------
86
92
 
87
- This project received foundings from `Marie Skłodowska-Curie Actions <https://cordis.europa.eu/project/id/860592>`__. It was developed in the
93
+ This project received funding from `Marie Skłodowska-Curie Actions <https://cordis.europa.eu/project/id/860592>`__. It was developed in the
88
94
  `Computational Biophysics Group <https://biophys.uni-saarland.de/>`__ of `Saarland University <https://www.uni-saarland.de/en/home.html>`__.
89
95
 
96
+ .. |logo| image:: https://github.com/ale94mleon/toff/blob/main/docs/source/_static/logo.png?raw=true
97
+ :target: https://github.com/ale94mleon/toff/
98
+ :alt: logo
90
99
 
91
100
  .. |docs| image:: https://readthedocs.org/projects/toff/badge/?version=latest
92
101
  :target: https://toff.readthedocs.io/en/latest/?badge=latest
@@ -100,18 +109,14 @@ This project received foundings from `Marie Skłodowska-Curie Actions <https://c
100
109
  :target: https://github.com/ale94mleon/TOFF/actions/workflows/tests.yml
101
110
  :alt: tests
102
111
 
103
- .. |codecov| image:: https://codecov.io/gh/ale94mleon/TOFF/branch/main/graph/badge.svg?token=1lAwiIgp3z
104
- :target: https://codecov.io/gh/ale94mleon/TOFF
112
+ .. |codecov| image:: https://app.codacy.com/project/badge/Coverage/53c53c810b3c4767ab76f5d622ec6aef
113
+ :target: hhttps://app.codacy.com/gh/ale94mleon/TOFF/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage
105
114
  :alt: codecov
106
115
 
107
116
  .. |codacy| image:: https://app.codacy.com/project/badge/Grade/53c53c810b3c4767ab76f5d622ec6aef
108
- :target: https://www.codacy.com/gh/ale94mleon/TOFF/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=ale94mleon/TOFF&amp;utm_campaign=Badge_Grade
117
+ :target: https://app.codacy.com/gh/ale94mleon/TOFF/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade
109
118
  :alt: codacy
110
119
 
111
- .. |CodeQL| image:: https://github.com/ale94mleon/TOFF/actions/workflows/codeql-analysis.yml/badge.svg
112
- :target: https://github.com/ale94mleon/TOFF/actions/workflows/codeql-analysis.yml
113
- :alt: CodeQL
114
-
115
120
  .. |pypi-version| image:: https://img.shields.io/pypi/v/TOFF.svg
116
121
  :target: https://pypi.python.org/pypi/TOFF/
117
122
  :alt: pypi-version
@@ -126,6 +131,7 @@ This project received foundings from `Marie Skłodowska-Curie Actions <https://c
126
131
 
127
132
  .. |pyversions| image:: https://img.shields.io/pypi/pyversions/toff.svg
128
133
  :target: https://pypi.python.org/pypi/toff/
134
+
129
135
  .. |rdkit| image:: https://img.shields.io/static/v1?label=Powered%20by&message=RDKit&color=3838ff&style=flat&logo=data:image/x-icon;base64,AAABAAEAEBAQAAAAAABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAMAABILAAASCwAAAAAAAAAAAADc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/FBT/FBT/FBT/FBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/PBT/PBT/PBT/PBT/PBT/PBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/PBT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/PBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/PBT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/PBT/FBTc3Nzc3Nzc3Nz/FBT/PBT/ZGT/ZGT/ZGT/jIz/jIz/jIz/jIz/ZGT/ZGT/ZGT/PBT/FBTc3Nzc3Nz/FBT/PBT/ZGT/ZGT/jIz/jIz/jIz/jIz/jIz/jIz/ZGT/ZGT/PBT/FBTc3Nzc3Nz/FBT/PBT/ZGT/ZGT/jIz/jIz/tLT/tLT/jIz/jIz/ZGT/ZGT/PBT/FBTc3Nzc3Nz/FBT/PBT/ZGT/ZGT/jIz/jIz/tLT/tLT/jIz/jIz/ZGT/ZGT/PBT/FBTc3Nzc3Nz/FBT/PBT/ZGT/ZGT/jIz/jIz/jIz/jIz/jIz/jIz/ZGT/ZGT/PBT/FBTc3Nzc3Nz/FBT/PBT/ZGT/ZGT/ZGT/jIz/jIz/jIz/jIz/ZGT/ZGT/ZGT/PBT/FBTc3Nzc3Nzc3Nz/FBT/PBT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/PBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/PBT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/PBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/PBT/PBT/PBT/PBT/PBT/PBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/FBT/FBT/FBT/FBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nz/////+B////AP///gB///wAP//4AB//+AAf//gAH//4AB//+AAf//gAH//8AD///gB///8A////gf////////
130
136
  :target: https://www.rdkit.org/docs/index.html
131
137
  :alt: rdkit
@@ -1,5 +1,6 @@
1
1
  TOFF
2
2
  =======
3
+ |logo|
3
4
 
4
5
  .. list-table::
5
6
  :widths: 12 35
@@ -9,7 +10,7 @@ TOFF
9
10
  * - **Tutorials**
10
11
  - |binder|
11
12
  * - **CI/CD**
12
- - |tests| |codecov| |codacy| |CodeQL|
13
+ - |tests| |codecov| |codacy|
13
14
  * - **Build**
14
15
  - |pypi-version|
15
16
  * - **Source Code**
@@ -26,8 +27,10 @@ TOFF
26
27
  Description
27
28
  -----------
28
29
 
29
- **TOFF** (Topologies from OpenFF) is a python package to get topologies from the OpenFF initiative. It was strongly inspired in this `Aniket's script <https://github.com/aniketsh/OpenFF/blob/82a2b5803e36b72f3525e3b8631cf256fbd8e35a/openff_topology.py>`__.
30
+ **TOFF** (Topologies from OpenFF) is a Python package initially developed to get topologies from the OpenFF initiative. It was strongly inspired in this `Aniket's script <https://github.com/aniketsh/OpenFF/blob/82a2b5803e36b72f3525e3b8631cf256fbd8e35a/openff_topology.py>`__.
30
31
 
32
+ Since version **0.1.0** it is also possible to get `GAFF <https://ambermd.org/antechamber/gaff.html>`__ and
33
+ `Espaloma <https://docs.espaloma.org/en/latest/>`__.
31
34
 
32
35
  You can try it out prior to any installation on `Binder <https://mybinder.org/v2/gh/ale94mleon/TOFF/HEAD?labpath=%2Fdocs%2Fnotebooks%2F>`__.
33
36
 
@@ -51,12 +54,15 @@ Citing **TOFF**
51
54
 
52
55
  Please refer to the `citation page <https://TOFF.readthedocs.io/en/latest/source/citations.html>`__ on the documentation.
53
56
 
54
- Foundings
55
- ---------
57
+ Funding
58
+ -------
56
59
 
57
- This project received foundings from `Marie Skłodowska-Curie Actions <https://cordis.europa.eu/project/id/860592>`__. It was developed in the
60
+ This project received funding from `Marie Skłodowska-Curie Actions <https://cordis.europa.eu/project/id/860592>`__. It was developed in the
58
61
  `Computational Biophysics Group <https://biophys.uni-saarland.de/>`__ of `Saarland University <https://www.uni-saarland.de/en/home.html>`__.
59
62
 
63
+ .. |logo| image:: https://github.com/ale94mleon/toff/blob/main/docs/source/_static/logo.png?raw=true
64
+ :target: https://github.com/ale94mleon/toff/
65
+ :alt: logo
60
66
 
61
67
  .. |docs| image:: https://readthedocs.org/projects/toff/badge/?version=latest
62
68
  :target: https://toff.readthedocs.io/en/latest/?badge=latest
@@ -70,18 +76,14 @@ This project received foundings from `Marie Skłodowska-Curie Actions <https://c
70
76
  :target: https://github.com/ale94mleon/TOFF/actions/workflows/tests.yml
71
77
  :alt: tests
72
78
 
73
- .. |codecov| image:: https://codecov.io/gh/ale94mleon/TOFF/branch/main/graph/badge.svg?token=1lAwiIgp3z
74
- :target: https://codecov.io/gh/ale94mleon/TOFF
79
+ .. |codecov| image:: https://app.codacy.com/project/badge/Coverage/53c53c810b3c4767ab76f5d622ec6aef
80
+ :target: hhttps://app.codacy.com/gh/ale94mleon/TOFF/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage
75
81
  :alt: codecov
76
82
 
77
83
  .. |codacy| image:: https://app.codacy.com/project/badge/Grade/53c53c810b3c4767ab76f5d622ec6aef
78
- :target: https://www.codacy.com/gh/ale94mleon/TOFF/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=ale94mleon/TOFF&amp;utm_campaign=Badge_Grade
84
+ :target: https://app.codacy.com/gh/ale94mleon/TOFF/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade
79
85
  :alt: codacy
80
86
 
81
- .. |CodeQL| image:: https://github.com/ale94mleon/TOFF/actions/workflows/codeql-analysis.yml/badge.svg
82
- :target: https://github.com/ale94mleon/TOFF/actions/workflows/codeql-analysis.yml
83
- :alt: CodeQL
84
-
85
87
  .. |pypi-version| image:: https://img.shields.io/pypi/v/TOFF.svg
86
88
  :target: https://pypi.python.org/pypi/TOFF/
87
89
  :alt: pypi-version
@@ -96,6 +98,7 @@ This project received foundings from `Marie Skłodowska-Curie Actions <https://c
96
98
 
97
99
  .. |pyversions| image:: https://img.shields.io/pypi/pyversions/toff.svg
98
100
  :target: https://pypi.python.org/pypi/toff/
101
+
99
102
  .. |rdkit| image:: https://img.shields.io/static/v1?label=Powered%20by&message=RDKit&color=3838ff&style=flat&logo=data:image/x-icon;base64,AAABAAEAEBAQAAAAAABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAMAABILAAASCwAAAAAAAAAAAADc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/FBT/FBT/FBT/FBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/PBT/PBT/PBT/PBT/PBT/PBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/PBT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/PBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/PBT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/PBT/FBTc3Nzc3Nzc3Nz/FBT/PBT/ZGT/ZGT/ZGT/jIz/jIz/jIz/jIz/ZGT/ZGT/ZGT/PBT/FBTc3Nzc3Nz/FBT/PBT/ZGT/ZGT/jIz/jIz/jIz/jIz/jIz/jIz/ZGT/ZGT/PBT/FBTc3Nzc3Nz/FBT/PBT/ZGT/ZGT/jIz/jIz/tLT/tLT/jIz/jIz/ZGT/ZGT/PBT/FBTc3Nzc3Nz/FBT/PBT/ZGT/ZGT/jIz/jIz/tLT/tLT/jIz/jIz/ZGT/ZGT/PBT/FBTc3Nzc3Nz/FBT/PBT/ZGT/ZGT/jIz/jIz/jIz/jIz/jIz/jIz/ZGT/ZGT/PBT/FBTc3Nzc3Nz/FBT/PBT/ZGT/ZGT/ZGT/jIz/jIz/jIz/jIz/ZGT/ZGT/ZGT/PBT/FBTc3Nzc3Nzc3Nz/FBT/PBT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/PBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/PBT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/PBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/PBT/PBT/PBT/PBT/PBT/PBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/FBT/FBT/FBT/FBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nz/////+B////AP///gB///wAP//4AB//+AAf//gAH//4AB//+AAf//gAH//8AD///gB///8A////gf////////
100
103
  :target: https://www.rdkit.org/docs/index.html
101
104
  :alt: rdkit
@@ -0,0 +1,81 @@
1
+ [build-system]
2
+ requires=[
3
+ "setuptools>=61.0",
4
+ "versioningit",
5
+ ]
6
+ build-backend = "setuptools.build_meta"
7
+
8
+ [project.urls]
9
+ "Hompage" = "https://github.com/ale94mleon/toff"
10
+ "Discussions" = "https://github.com/ale94mleon/toff/discussions"
11
+ "Documentation" = "https://toff.readthedocs.io/en/latest/"
12
+ "Issues" = "https://github.com/ale94mleon/toff/issues"
13
+
14
+ [project]
15
+ name = "toff"
16
+ dynamic = ["version"]
17
+ description = "toff is a python package to get topologies from the OpenFF initiative."
18
+ readme = "README.rst"
19
+
20
+ authors=[
21
+ {name="Alejandro Martínez-León", email="ale94mleon@gmail.com"},
22
+ ]
23
+
24
+ classifiers = [
25
+ "Development Status :: 2 - Pre-Alpha",
26
+ "Operating System :: POSIX :: Linux",
27
+ "Operating System :: MacOS",
28
+ "Intended Audience :: Science/Research",
29
+ "License :: OSI Approved :: Apache Software License",
30
+ "Programming Language :: Python :: 3",
31
+ "Programming Language :: Python :: 3.9",
32
+ "Programming Language :: Python :: 3.10",
33
+ "Programming Language :: Python :: 3.11",
34
+ "Programming Language :: Python :: 3.12",
35
+ "Topic :: Scientific/Engineering :: Bio-Informatics",
36
+ "Topic :: Scientific/Engineering :: Chemistry",
37
+ "Topic :: Scientific/Engineering :: Physics"
38
+ ]
39
+ keywords = [
40
+ "science",
41
+ "chemistry",
42
+ "biology",
43
+ "drug-design",
44
+ "molecular-dynamic",
45
+ ]
46
+
47
+ requires-python = "> 3.8"
48
+ dependencies = [
49
+ "pyyaml",
50
+ "parmed",
51
+ "rdkit"
52
+ ]
53
+
54
+ [project.optional-dependencies]
55
+ dev = ["pytest"]
56
+
57
+ [tool.versioningit]
58
+ default-version = "1+unknown"
59
+
60
+ [tool.versioningit.format]
61
+ distance = "{base_version}"
62
+ dirty = "{base_version}"
63
+ distance-dirty = "{base_version}"
64
+
65
+ [tool.versioningit.vcs]
66
+ method = "git"
67
+ match = ["*"]
68
+ default-tag = "0.0.0"
69
+
70
+ [tool.versioningit.write]
71
+ file = "src/toff/_version.py"
72
+
73
+ [tool.setuptools]
74
+ include-package-data = true
75
+
76
+ [tool.setuptools.packages.find]
77
+ where = ["src"]
78
+
79
+
80
+ [project.scripts]
81
+ parameterize = "toff.cli:__parameterize_cmd"
toff-0.2.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -5,7 +5,8 @@ For information of TOFF:
5
5
  Docs: https://TOFF.readthedocs.io/en/latest/
6
6
  Source Code: https://github.com/ale94mleon/TOFF
7
7
  """
8
- from ._version import __version__, __version_tuple__
9
- from .utils import *
8
+ from toff._version import __version__
9
+ from toff.utils import *
10
+
10
11
  __author__ = "Alejandro Martínez León"
11
- __email__ = "ale94mleon@gmail.com"
12
+ __email__ = "ale94mleon@gmail.com"
@@ -0,0 +1 @@
1
+ __version__ = "0.2.0"
@@ -6,8 +6,13 @@ For information of TOFF:
6
6
  Source Code: https://github.com/ale94mleon/TOFF
7
7
  """
8
8
 
9
- from toff import __version__, Parameterize
10
- import yaml, argparse, warnings
9
+ import argparse
10
+ import warnings
11
+
12
+ import yaml
13
+
14
+ from toff import Parameterize, __version__
15
+
11
16
 
12
17
  def __parameterize_cmd():
13
18
  parser = argparse.ArgumentParser(description=__doc__,
@@ -25,8 +30,8 @@ def __parameterize_cmd():
25
30
  print(f"You are using toff:{__version__}")
26
31
  with open(args.yaml_file, 'r') as c:
27
32
  Config = yaml.safe_load(c)
28
- InitKwargs = ['force_field_code','ext_types','hmr_factor','overwrite','out_dir']
29
- CallKwargs = ['input_mol','mol_resi_name','gen_conformer']
33
+ InitKwargs = ['force_field_code', 'ext_types', 'hmr_factor', 'overwrite', 'safe_naming_prefix', 'out_dir']
34
+ CallKwargs = ['input_mol', 'mol_resi_name']
30
35
 
31
36
  UserExtraNonValidKwargs = set(Config.keys()) - set(InitKwargs + CallKwargs)
32
37
  if 'input_mol' not in Config:
@@ -38,4 +43,4 @@ def __parameterize_cmd():
38
43
  UserCallKwargs = {kwarg: Config[kwarg] for kwarg in Config if kwarg in CallKwargs}
39
44
  parameterizer = Parameterize(**UserInitKwargs)
40
45
  print(parameterizer)
41
- parameterizer(**UserCallKwargs)
46
+ parameterizer(**UserCallKwargs)
@@ -1,18 +1,21 @@
1
1
  #!/usr/bin/env python3
2
2
  # -*- coding: utf-8 -*-
3
- import numpy as np
4
- import os, warnings, tempfile
3
+ import os
4
+ import tempfile
5
+ import warnings
5
6
  from copy import deepcopy
7
+ from typing import Iterable, List
8
+
9
+ import numpy as np
10
+ import parmed
11
+ from openff.toolkit.topology import Molecule
12
+ from openff.toolkit.typing.engines import smirnoff
13
+ from openmm import app
6
14
  from rdkit import Chem
7
15
  from rdkit.Chem import AllChem
8
- from openff.toolkit.typing.engines.smirnoff import ForceField
9
- from openff.toolkit.topology import Molecule
10
- from openmm.app import PDBFile
11
- import parmed
12
- from typing import List, Iterable
13
16
 
17
+ # This module was strongly inspired in https://github.com/aniketsh/OpenFF/blob/82a2b5803e36b72f3525e3b8631cf256fbd8e35a/openff_topology.py
14
18
 
15
- #This module was strongly inspired in https://github.com/aniketsh/OpenFF/blob/82a2b5803e36b72f3525e3b8631cf256fbd8e35a/openff_topology.py
16
19
 
17
20
  def confgen(mol: Chem.rdchem.Mol):
18
21
  """Create a 3D model for the molecule only
@@ -40,7 +43,8 @@ def confgen(mol: Chem.rdchem.Mol):
40
43
 
41
44
  return mol
42
45
 
43
- def get_rdkit_mol(input_path_mol:str):
46
+
47
+ def get_rdkit_mol(input_path_mol: str):
44
48
  """Get a file with a definition of a molecule and return the corresponded RDKit molecule object
45
49
  with a conformation if there not present.
46
50
 
@@ -77,6 +81,7 @@ def get_rdkit_mol(input_path_mol:str):
77
81
  elif extension == 'mol':
78
82
  mol = Chem.MolFromMolFile(input_path_mol)
79
83
  elif extension == 'sdf':
84
+ # TODO, check what happens if more than one conformation is provided. Maybe it is beneficial and this information is used by OpenFF
80
85
  mol = Chem.SDMolSupplier(input_path_mol)[0]
81
86
  elif extension == 'mol2':
82
87
  mol = Chem.MolFromMol2File(input_path_mol)
@@ -91,7 +96,8 @@ def get_rdkit_mol(input_path_mol:str):
91
96
  warnings.warn("Molecule was not converted. Check the input")
92
97
  return mol
93
98
 
94
- def topology_writer(ligand_structure:parmed.structure.Structure, ext_types:List[str] = None, overwrite = False, out_dir:str = '.') -> None:
99
+
100
+ def topology_writer(ligand_structure: parmed.structure.Structure, ext_types: List[str] = None, overwrite: bool = False, out_dir: str = '.') -> None:
95
101
  """A toff wrapper around the `save` method of :meth:`parmed.structure.Structure`
96
102
 
97
103
  Parameters
@@ -112,7 +118,7 @@ def topology_writer(ligand_structure:parmed.structure.Structure, ext_types:List[
112
118
  """
113
119
 
114
120
  valid_ext_types = [
115
- 'pdb', 'pqr', 'cif','pdbx',
121
+ 'pdb', 'pqr', 'cif', 'pdbx',
116
122
  'parm7', 'prmtop', 'psf', 'top',
117
123
  'gro', 'mol2', 'mol3', 'crd',
118
124
  'rst7', 'inpcrd', 'restrt', 'ncrst',
@@ -124,11 +130,12 @@ def topology_writer(ligand_structure:parmed.structure.Structure, ext_types:List[
124
130
  ext_type = ext_type.lower()
125
131
  if ext_type in valid_ext_types:
126
132
  path = os.path.join(out_dir, f"{ligand_structure.atoms[0].residue.name}.{ext_type}")
127
- ligand_structure.save(path, overwrite = overwrite)
133
+ ligand_structure.save(path, overwrite=overwrite)
128
134
  else:
129
135
  warnings.warn(f"{ext_type} is not a valid extension type. Only: {valid_ext_types}")
130
136
 
131
- def get_partial_charges(ligand_structure:parmed.structure.Structure):
137
+
138
+ def get_partial_charges(ligand_structure: parmed.structure.Structure):
132
139
  """get the partial charges from a :meth:`parmed.structure.Structure` object.
133
140
 
134
141
  Parameters
@@ -143,7 +150,8 @@ def get_partial_charges(ligand_structure:parmed.structure.Structure):
143
150
  """
144
151
  return np.array([atom.charge for atom in ligand_structure])
145
152
 
146
- def set_partial_charges(ligand_structure:Chem.rdchem.Mol, partial_charges:Iterable):
153
+
154
+ def set_partial_charges(ligand_structure: Chem.rdchem.Mol, partial_charges: Iterable):
147
155
  """Set new partial charges to a :meth:`parmed.structure.Structure` object
148
156
 
149
157
  Parameters
@@ -162,7 +170,8 @@ def set_partial_charges(ligand_structure:Chem.rdchem.Mol, partial_charges:Iterab
162
170
  atom.charge = charge
163
171
  return ligand_structure
164
172
 
165
- def charge_sanitizer(rdkit_mol:Chem.rdchem.Mol, ligand_structure:parmed.structure.Structure, max_iter:int = 100):
173
+
174
+ def charge_sanitizer(rdkit_mol: Chem.rdchem.Mol, ligand_structure: parmed.structure.Structure, max_iter: int = 100):
166
175
  """Check and correct (if needed) if the formal charge from the rdkit_mol is not the same as the sum of
167
176
  of the partial charges of the ligand_structure.
168
177
 
@@ -189,7 +198,7 @@ def charge_sanitizer(rdkit_mol:Chem.rdchem.Mol, ligand_structure:parmed.structur
189
198
 
190
199
  # Round up the formal charge
191
200
  for atom in ligand_structure:
192
- atom.charge = round(atom.charge,7)
201
+ atom.charge = round(atom.charge, 7)
193
202
 
194
203
  partial_charges = get_partial_charges(ligand_structure)
195
204
  diff = round(partial_charges.sum() - formal_charge, 6)
@@ -214,7 +223,8 @@ def charge_sanitizer(rdkit_mol:Chem.rdchem.Mol, ligand_structure:parmed.structur
214
223
  # print("No charge correction needed.")
215
224
  return ligand_structure
216
225
 
217
- def safe_naming(ligand_structure:parmed.structure.Structure, prefix:str = 'z', inplace:bool = True):
226
+
227
+ def safe_naming(ligand_structure: parmed.structure.Structure, prefix: str = 'z', inplace: bool = True):
218
228
  """Add a prefix to the atom types in order to avoid
219
229
  incompatibilities with other force fields
220
230
 
@@ -243,27 +253,113 @@ def safe_naming(ligand_structure:parmed.structure.Structure, prefix:str = 'z', i
243
253
  else:
244
254
  return ligand_structure
245
255
 
256
+
257
+ def generate_structure(rdkit_mol: Chem.rdchem.Mol, force_field_type: str = 'openff', force_field_code: str = None) -> parmed.structure.Structure:
258
+ """Generate a Structure object with the topology information from the specified force field.
259
+ OpenFF, GAFF and Espaloma flavors are supported
260
+
261
+ Parameters
262
+ ----------
263
+ rdkit_mol : Chem.rdchem.Mol
264
+ An RDKit molecule
265
+ force_field_type : str, optional
266
+ This is used to identify the force field. Valid options are openff, gaff, espaloma (case insensitive), by default 'openff'
267
+ force_field_code : str, optional
268
+ This is the code that represent the force field. Any valid OpenFF, GAFF or Espaloma string representation.
269
+ Visit the `openff-forcefields <https://github.com/openforcefield/openff-forcefields>`__
270
+ and `openmmforcefields <https://github.com/openmm/openmmforcefields>` for
271
+ more information. Its default value will dynamically change depending on force_field_type as:
272
+ * openff -> openff_unconstrained-2.0.0.offxml
273
+ * gaff -> gaff-2.11
274
+ * espaloma -> espaloma-0.3.1
275
+
276
+ Returns
277
+ -------
278
+ parmed.structure.Structure
279
+ The Structure object with its corresponding force field parameters
280
+
281
+ Raises
282
+ ------
283
+ Exception
284
+ Invalid force_field_type.
285
+ """
286
+ force_field_code_default = {
287
+ 'openff': 'openff_unconstrained-2.0.0.offxml',
288
+ 'gaff': 'gaff-2.11',
289
+ 'espaloma': 'espaloma-0.3.1'
290
+ }
291
+ # Check validity of force_field_type
292
+ force_field_type = force_field_type.lower()
293
+ if force_field_type in force_field_code_default:
294
+ # Update the internal default options if the user provided a force_field_code
295
+ if force_field_code:
296
+ force_field_code_default[force_field_type] = force_field_code
297
+ else:
298
+ raise Exception(f"{force_field_type = } is not valid. Choose from: {force_field_code_default.keys()}.")
299
+ # Create temporal pdb file
300
+ tmp_pdb = tempfile.NamedTemporaryFile(suffix='.pdb')
301
+ Chem.MolToPDBFile(rdkit_mol, tmp_pdb.name)
302
+
303
+ # Generate the topology
304
+ molecule = Molecule(rdkit_mol)
305
+ pdb_obj = app.PDBFile(tmp_pdb.name)
306
+ print(f'Parameterizing with {force_field_code_default[force_field_type]}')
307
+ if force_field_type == 'openff':
308
+ system = smirnoff.ForceField(force_field_code_default[force_field_type]).create_openmm_system(molecule.to_topology())
309
+ elif force_field_type == 'gaff':
310
+ forcefield_obj = app.ForceField()
311
+ # Create the GAFF template generator
312
+ from openmmforcefields.generators import GAFFTemplateGenerator
313
+ template_generator = GAFFTemplateGenerator(molecules=molecule, forcefield=force_field_code_default[force_field_type])
314
+ forcefield_obj.registerTemplateGenerator(template_generator.generator)
315
+ system = forcefield_obj.createSystem(pdb_obj.topology)
316
+ elif force_field_type == 'espaloma':
317
+ import espaloma as esp
318
+ # create an Espaloma Graph object to represent the molecule of interest
319
+ molecule_graph = esp.Graph(molecule)
320
+ # load pretrained model
321
+ espaloma_model = esp.get_model(version=force_field_code_default[force_field_type].split("espaloma-")[-1])
322
+ # apply a trained espaloma model to assign parameters
323
+ espaloma_model(molecule_graph.heterograph)
324
+ # create an OpenMM System for the specified molecule
325
+ system = esp.graphs.deploy.openmm_system_from_graph(molecule_graph)
326
+ else:
327
+ raise ValueError(f"{force_field_type} is not valid, select from {force_field_code_default.keys()}")
328
+
329
+ structure = parmed.openmm.load_topology(pdb_obj.topology, system=system, xyz=pdb_obj.positions)
330
+ tmp_pdb.close()
331
+ return structure
332
+
333
+
246
334
  class Parameterize:
247
335
  """This is the main class for the parameterization
248
336
  """
249
337
 
250
338
  def __init__(
251
339
  self,
252
- force_field_code:str = 'openff_unconstrained-2.0.0.offxml',
253
- ext_types:List[str] = None,
254
- hmr_factor:float = None,
255
- overwrite:bool = False,
256
- safe_naming_prefix:str = None,
257
- out_dir:str = '.',
340
+ force_field_type: str = 'openff',
341
+ force_field_code: str = None,
342
+ ext_types: List[str] = None,
343
+ hmr_factor: float = None,
344
+ overwrite: bool = False,
345
+ safe_naming_prefix: str = None,
346
+ out_dir: str = '.',
258
347
  ) -> None:
259
348
  """This is the constructor of the class.
349
+ GAFF and Espaloma capabilities came on version toff:0.1.0
260
350
 
261
351
  Parameters
262
352
  ----------
353
+ force_field_type : str, optional
354
+ This is used to identify the force field. Valid options are openff, gaff, espaloma (case insensitive), by default 'openff'
263
355
  force_field_code : str, optional
264
- Any valid Open Force Field string representation.
265
- Visit the `GitHub repo <https://github.com/openforcefield/openff-forcefields>`__ for
266
- more information, by default 'openff_unconstrained-2.0.0.offxml'
356
+ This is the code that represent the force field. Any valid OpenFF, GAFF or Espaloma string representation.
357
+ Visit the `openff-forcefields <https://github.com/openforcefield/openff-forcefields>`__
358
+ and `openmmforcefields <https://github.com/openmm/openmmforcefields>` for
359
+ more information. Its default value will dynamically change depending on force_field_type as:
360
+ * openff -> openff_unconstrained-2.0.0.offxml
361
+ * gaff -> gaff-2.11
362
+ * espaloma -> espaloma-0.3.1
267
363
  ext_types : List[str], optional
268
364
  Any extension from:
269
365
  'pdb', 'pqr', 'cif','pdbx',
@@ -286,6 +382,7 @@ class Parameterize:
286
382
  """
287
383
 
288
384
  self.force_field_code = force_field_code
385
+ self.force_field_type = force_field_type.lower()
289
386
  self.ext_types = ext_types
290
387
  self.hmr_factor = hmr_factor
291
388
  self.overwrite = overwrite
@@ -302,7 +399,7 @@ class Parameterize:
302
399
  f"overwrite = {self.overwrite}, safe_naming_prefix = {self.safe_naming_prefix}, "\
303
400
  f"out_dir = {self.out_dir})"
304
401
 
305
- def __call__(self, input_mol, mol_resi_name:str = "MOL"):
402
+ def __call__(self, input_mol, mol_resi_name: str = "MOL"):
306
403
  """This class is callable. And this is its implementation.
307
404
  it will return the specified files (ext_types in __init__) in the directory out_dir.
308
405
 
@@ -310,7 +407,7 @@ class Parameterize:
310
407
  ----------
311
408
  input_mol : str, Chem.rdchem.Mol molecule
312
409
  Could be a path to any file compatible with :meth:`toff.utils.get_rdkit_mol`:
313
- (.inchi, .smi, .mol, .mol2)
410
+ (.inchi, .smi, .mol, .sdf, .mol2)
314
411
  or any valid RDKit molecule
315
412
  mol_resi_name : str, optional
316
413
  The residue name that will have the ligand. It is recommended to use
@@ -326,7 +423,7 @@ class Parameterize:
326
423
  if isinstance(input_mol, Chem.rdchem.Mol):
327
424
  rdkit_mol = confgen(input_mol)
328
425
  elif isinstance(input_mol, str):
329
- rdkit_mol = get_rdkit_mol(input_path_mol = input_mol)
426
+ rdkit_mol = get_rdkit_mol(input_path_mol=input_mol)
330
427
  else:
331
428
  raise Exception(f'input_mol must be an instance of Chem.rdchem.Mol or str. But it is {type(input_mol)}')
332
429
 
@@ -334,22 +431,15 @@ class Parameterize:
334
431
  warnings.warn(f"mol_resi_name = {mol_resi_name} is to large. consider to use a code with no more than 4 characters.")
335
432
 
336
433
  # Create if needed the output directory
337
- if not os.path.isdir(self.out_dir): os.makedirs(self.out_dir)
338
-
339
- # Create temporal pdb file
340
- tmp_pdb = tempfile.NamedTemporaryFile(suffix='.pdb')
341
- Chem.MolToPDBFile(rdkit_mol, tmp_pdb.name)
342
-
343
- # Generate the topology
344
- try:
345
- openff_mol = Molecule(rdkit_mol)
346
- ligand_pdbfile = PDBFile(tmp_pdb.name)
347
- ligand_system = ForceField(self.force_field_code).create_openmm_system(openff_mol.to_topology())
348
- ligand_structure = parmed.openmm.load_topology(ligand_pdbfile.topology, ligand_system, xyz = ligand_pdbfile.positions)
349
- except Exception as e:
350
- raise Exception(e)
351
- tmp_pdb.close()
352
-
434
+ if not os.path.isdir(self.out_dir):
435
+ os.makedirs(self.out_dir)
436
+
437
+ ligand_structure = generate_structure(
438
+ rdkit_mol=rdkit_mol,
439
+ force_field_type=self.force_field_type,
440
+ force_field_code=self.force_field_code
441
+ )
442
+
353
443
  # Make Hydrogens Heavy for 4fs timestep
354
444
  if self.hmr_factor:
355
445
  parmed.tools.HMassRepartition(ligand_structure, self.hmr_factor).execute()
@@ -359,16 +449,16 @@ class Parameterize:
359
449
  atom.residue.name = mol_resi_name
360
450
 
361
451
  # Correct charges if needed
362
- ligand_structure = charge_sanitizer(rdkit_mol = rdkit_mol, ligand_structure = ligand_structure)
452
+ ligand_structure = charge_sanitizer(rdkit_mol=rdkit_mol, ligand_structure=ligand_structure)
363
453
 
364
454
  # Write the output topologies
365
455
  if self.safe_naming_prefix:
366
456
  safe_naming(ligand_structure, prefix=self.safe_naming_prefix, inplace=True)
367
457
  topology_writer(
368
- ligand_structure = ligand_structure,
369
- ext_types = self.ext_types,
370
- out_dir = self.out_dir,
371
- overwrite = self.overwrite,
458
+ ligand_structure=ligand_structure,
459
+ ext_types=self.ext_types,
460
+ out_dir=self.out_dir,
461
+ overwrite=self.overwrite,
372
462
  )
373
463
 
374
464
 
@@ -1,35 +1,39 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: toff
3
- Version: 0.0.2
4
- Summary: toff is a python package to get topologies from the OpenFF initiative
5
- Home-page: https://github.com/ale94mleon/toff
6
- Author: Alejandro Martínez León
7
- Author-email: ale94mleon@gmail.com
8
- License: Apache License 2.0
3
+ Version: 0.2.0
4
+ Summary: toff is a python package to get topologies from the OpenFF initiative.
5
+ Author-email: Alejandro Martínez-León <ale94mleon@gmail.com>
6
+ Project-URL: Hompage, https://github.com/ale94mleon/toff
9
7
  Project-URL: Discussions, https://github.com/ale94mleon/toff/discussions
10
8
  Project-URL: Documentation, https://toff.readthedocs.io/en/latest/
11
9
  Project-URL: Issues, https://github.com/ale94mleon/toff/issues
12
- Keywords: science,chemistry,molecular-dynamic,biology,drug-design
13
- Platform: linux
10
+ Keywords: science,chemistry,biology,drug-design,molecular-dynamic
14
11
  Classifier: Development Status :: 2 - Pre-Alpha
15
12
  Classifier: Operating System :: POSIX :: Linux
16
13
  Classifier: Operating System :: MacOS
17
14
  Classifier: Intended Audience :: Science/Research
18
15
  Classifier: License :: OSI Approved :: Apache Software License
19
16
  Classifier: Programming Language :: Python :: 3
20
- Classifier: Programming Language :: Python :: 3.8
21
17
  Classifier: Programming Language :: Python :: 3.9
22
18
  Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
23
21
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
24
22
  Classifier: Topic :: Scientific/Engineering :: Chemistry
25
23
  Classifier: Topic :: Scientific/Engineering :: Physics
26
- Requires-Python: <3.11,>=3.8
24
+ Requires-Python: >3.8
27
25
  Description-Content-Type: text/x-rst
28
- Provides-Extra: test
29
26
  License-File: LICENSE
27
+ Requires-Dist: pyyaml
28
+ Requires-Dist: parmed
29
+ Requires-Dist: rdkit
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest; extra == "dev"
32
+ Dynamic: license-file
30
33
 
31
34
  TOFF
32
35
  =======
36
+ |logo|
33
37
 
34
38
  .. list-table::
35
39
  :widths: 12 35
@@ -39,7 +43,7 @@ TOFF
39
43
  * - **Tutorials**
40
44
  - |binder|
41
45
  * - **CI/CD**
42
- - |tests| |codecov| |codacy| |CodeQL|
46
+ - |tests| |codecov| |codacy|
43
47
  * - **Build**
44
48
  - |pypi-version|
45
49
  * - **Source Code**
@@ -56,8 +60,10 @@ TOFF
56
60
  Description
57
61
  -----------
58
62
 
59
- **TOFF** (Topologies from OpenFF) is a python package to get topologies from the OpenFF initiative. It was strongly inspired in this `Aniket's script <https://github.com/aniketsh/OpenFF/blob/82a2b5803e36b72f3525e3b8631cf256fbd8e35a/openff_topology.py>`__.
63
+ **TOFF** (Topologies from OpenFF) is a Python package initially developed to get topologies from the OpenFF initiative. It was strongly inspired in this `Aniket's script <https://github.com/aniketsh/OpenFF/blob/82a2b5803e36b72f3525e3b8631cf256fbd8e35a/openff_topology.py>`__.
60
64
 
65
+ Since version **0.1.0** it is also possible to get `GAFF <https://ambermd.org/antechamber/gaff.html>`__ and
66
+ `Espaloma <https://docs.espaloma.org/en/latest/>`__.
61
67
 
62
68
  You can try it out prior to any installation on `Binder <https://mybinder.org/v2/gh/ale94mleon/TOFF/HEAD?labpath=%2Fdocs%2Fnotebooks%2F>`__.
63
69
 
@@ -81,12 +87,15 @@ Citing **TOFF**
81
87
 
82
88
  Please refer to the `citation page <https://TOFF.readthedocs.io/en/latest/source/citations.html>`__ on the documentation.
83
89
 
84
- Foundings
85
- ---------
90
+ Funding
91
+ -------
86
92
 
87
- This project received foundings from `Marie Skłodowska-Curie Actions <https://cordis.europa.eu/project/id/860592>`__. It was developed in the
93
+ This project received funding from `Marie Skłodowska-Curie Actions <https://cordis.europa.eu/project/id/860592>`__. It was developed in the
88
94
  `Computational Biophysics Group <https://biophys.uni-saarland.de/>`__ of `Saarland University <https://www.uni-saarland.de/en/home.html>`__.
89
95
 
96
+ .. |logo| image:: https://github.com/ale94mleon/toff/blob/main/docs/source/_static/logo.png?raw=true
97
+ :target: https://github.com/ale94mleon/toff/
98
+ :alt: logo
90
99
 
91
100
  .. |docs| image:: https://readthedocs.org/projects/toff/badge/?version=latest
92
101
  :target: https://toff.readthedocs.io/en/latest/?badge=latest
@@ -100,18 +109,14 @@ This project received foundings from `Marie Skłodowska-Curie Actions <https://c
100
109
  :target: https://github.com/ale94mleon/TOFF/actions/workflows/tests.yml
101
110
  :alt: tests
102
111
 
103
- .. |codecov| image:: https://codecov.io/gh/ale94mleon/TOFF/branch/main/graph/badge.svg?token=1lAwiIgp3z
104
- :target: https://codecov.io/gh/ale94mleon/TOFF
112
+ .. |codecov| image:: https://app.codacy.com/project/badge/Coverage/53c53c810b3c4767ab76f5d622ec6aef
113
+ :target: hhttps://app.codacy.com/gh/ale94mleon/TOFF/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage
105
114
  :alt: codecov
106
115
 
107
116
  .. |codacy| image:: https://app.codacy.com/project/badge/Grade/53c53c810b3c4767ab76f5d622ec6aef
108
- :target: https://www.codacy.com/gh/ale94mleon/TOFF/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=ale94mleon/TOFF&amp;utm_campaign=Badge_Grade
117
+ :target: https://app.codacy.com/gh/ale94mleon/TOFF/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade
109
118
  :alt: codacy
110
119
 
111
- .. |CodeQL| image:: https://github.com/ale94mleon/TOFF/actions/workflows/codeql-analysis.yml/badge.svg
112
- :target: https://github.com/ale94mleon/TOFF/actions/workflows/codeql-analysis.yml
113
- :alt: CodeQL
114
-
115
120
  .. |pypi-version| image:: https://img.shields.io/pypi/v/TOFF.svg
116
121
  :target: https://pypi.python.org/pypi/TOFF/
117
122
  :alt: pypi-version
@@ -126,6 +131,7 @@ This project received foundings from `Marie Skłodowska-Curie Actions <https://c
126
131
 
127
132
  .. |pyversions| image:: https://img.shields.io/pypi/pyversions/toff.svg
128
133
  :target: https://pypi.python.org/pypi/toff/
134
+
129
135
  .. |rdkit| image:: https://img.shields.io/static/v1?label=Powered%20by&message=RDKit&color=3838ff&style=flat&logo=data:image/x-icon;base64,AAABAAEAEBAQAAAAAABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAMAABILAAASCwAAAAAAAAAAAADc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/FBT/FBT/FBT/FBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/PBT/PBT/PBT/PBT/PBT/PBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/PBT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/PBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/PBT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/PBT/FBTc3Nzc3Nzc3Nz/FBT/PBT/ZGT/ZGT/ZGT/jIz/jIz/jIz/jIz/ZGT/ZGT/ZGT/PBT/FBTc3Nzc3Nz/FBT/PBT/ZGT/ZGT/jIz/jIz/jIz/jIz/jIz/jIz/ZGT/ZGT/PBT/FBTc3Nzc3Nz/FBT/PBT/ZGT/ZGT/jIz/jIz/tLT/tLT/jIz/jIz/ZGT/ZGT/PBT/FBTc3Nzc3Nz/FBT/PBT/ZGT/ZGT/jIz/jIz/tLT/tLT/jIz/jIz/ZGT/ZGT/PBT/FBTc3Nzc3Nz/FBT/PBT/ZGT/ZGT/jIz/jIz/jIz/jIz/jIz/jIz/ZGT/ZGT/PBT/FBTc3Nzc3Nz/FBT/PBT/ZGT/ZGT/ZGT/jIz/jIz/jIz/jIz/ZGT/ZGT/ZGT/PBT/FBTc3Nzc3Nzc3Nz/FBT/PBT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/PBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/PBT/ZGT/ZGT/ZGT/ZGT/ZGT/ZGT/PBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/PBT/PBT/PBT/PBT/PBT/PBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nz/FBT/FBT/FBT/FBT/FBT/FBTc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nz/////+B////AP///gB///wAP//4AB//+AAf//gAH//4AB//+AAf//gAH//8AD///gB///8A////gf////////
130
136
  :target: https://www.rdkit.org/docs/index.html
131
137
  :alt: rdkit
@@ -0,0 +1,14 @@
1
+ LICENSE
2
+ README.rst
3
+ pyproject.toml
4
+ src/toff/__init__.py
5
+ src/toff/_version.py
6
+ src/toff/cli.py
7
+ src/toff/utils.py
8
+ src/toff.egg-info/PKG-INFO
9
+ src/toff.egg-info/SOURCES.txt
10
+ src/toff.egg-info/dependency_links.txt
11
+ src/toff.egg-info/entry_points.txt
12
+ src/toff.egg-info/requires.txt
13
+ src/toff.egg-info/top_level.txt
14
+ tests/test_small.py
@@ -1,5 +1,6 @@
1
1
  pyyaml
2
2
  parmed
3
+ rdkit
3
4
 
4
- [test]
5
+ [dev]
5
6
  pytest
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ import os
4
+ import subprocess # nosec
5
+ import tempfile
6
+
7
+ import pytest
8
+ import yaml
9
+ from rdkit import Chem
10
+
11
+ from toff import Parameterize
12
+
13
+ tmp_dir = tempfile.TemporaryDirectory(dir=".", prefix="toff-test-")
14
+
15
+ valid_inputs = {
16
+ 'rdkit': Chem.MolFromSmiles('CC'),
17
+ 'smi': os.path.join(tmp_dir.name, 'mol.smi'),
18
+ 'inchi': os.path.join(tmp_dir.name, 'mol.inchi'),
19
+ 'mol': os.path.join(tmp_dir.name, 'mol.mol'),
20
+ # 'mol2': os.path.join(tmp_dir.name,'mol.mol2'),
21
+ # 'pdb': os.path.join(tmp_dir.name,'mol.pdb'),
22
+ }
23
+
24
+ # Saving the molecules in different formats
25
+ with open(valid_inputs['smi'], 'w') as f: f.write(Chem.MolToSmiles(valid_inputs['rdkit']))
26
+ with open(valid_inputs['inchi'], 'w') as f: f.write(Chem.MolToInchi(valid_inputs['rdkit']))
27
+ Chem.MolToMolFile(valid_inputs['rdkit'], valid_inputs['mol'])
28
+ # Chem.MolToPDBFile(valid_inputs['rdkit'], valid_inputs['pdb'])
29
+ print(os.listdir(tmp_dir.name))
30
+ # Saving minimalist configuration file
31
+ config_yml = os.path.join(tmp_dir.name, 'config.yml')
32
+ config_dict = {
33
+ 'input_mol': valid_inputs['mol'],
34
+ 'overwrite': True,
35
+ 'out_dir': tmp_dir.name,
36
+ 'hmr_factor': 3,
37
+ 'mol_resi_name': 'CMD'
38
+ }
39
+ with open(config_yml, 'w') as f:
40
+ yaml.dump(config_dict, f)
41
+
42
+
43
+ def test_Parameterize_openff():
44
+ parameterizer = Parameterize(overwrite=True, out_dir=tmp_dir.name, force_field_type='openff')
45
+ for key in valid_inputs:
46
+ print(key)
47
+ parameterizer(input_mol=valid_inputs[key], mol_resi_name=key[:3])
48
+
49
+
50
+ def test_Parameterize_gaff():
51
+ parameterizer = Parameterize(overwrite=True, out_dir=tmp_dir.name, force_field_type='gaff')
52
+ for key in valid_inputs:
53
+ print(key)
54
+ parameterizer(input_mol=valid_inputs[key], mol_resi_name=key[:3])
55
+
56
+
57
+ @pytest.mark.filterwarnings("ignore::Warning") # Adjust the warning type as needed
58
+ def test_Parameterize_espaloma():
59
+ try:
60
+ import espaloma
61
+ except Exception:
62
+ pytest.xfail("espaloma is not installed")
63
+ parameterizer = Parameterize(overwrite=True, out_dir=tmp_dir.name, force_field_type='espaloma')
64
+ for key in valid_inputs:
65
+ print(key)
66
+ parameterizer(input_mol=valid_inputs[key], mol_resi_name=key[:3])
67
+
68
+
69
+ def test_Parameterize_hmr():
70
+ parameterizer = Parameterize(overwrite=True, out_dir=tmp_dir.name, hmr_factor=2.5)
71
+ parameterizer(input_mol=valid_inputs["rdkit"], mol_resi_name='HMR')
72
+
73
+
74
+ def test_cmd_Parameterize():
75
+ process = subprocess.run(
76
+ ['parameterize', config_yml],
77
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
78
+ returncode = process.returncode
79
+ if returncode != 0:
80
+ raise RuntimeError(process.stderr)
81
+
82
+ if __name__ == '__main__':
83
+ pass
toff-0.0.2/setup.cfg DELETED
@@ -1,56 +0,0 @@
1
- [metadata]
2
- name = toff
3
- version = attr: toff.__version__
4
- author = Alejandro Martínez León
5
- author_email = ale94mleon@gmail.com
6
- description = toff is a python package to get topologies from the OpenFF initiative
7
- long_description = file: README.rst
8
- long_description_content_type = text/x-rst
9
- url = https://github.com/ale94mleon/toff
10
- project_urls =
11
- Discussions = https://github.com/ale94mleon/toff/discussions
12
- Documentation = https://toff.readthedocs.io/en/latest/
13
- Issues = https://github.com/ale94mleon/toff/issues
14
- license = Apache License 2.0
15
- license_files = LICENSE
16
- platforms = linux
17
- classifiers =
18
- Development Status :: 2 - Pre-Alpha
19
- Operating System :: POSIX :: Linux
20
- Operating System :: MacOS
21
- Intended Audience :: Science/Research
22
- License :: OSI Approved :: Apache Software License
23
- Programming Language :: Python :: 3
24
- Programming Language :: Python :: 3.8
25
- Programming Language :: Python :: 3.9
26
- Programming Language :: Python :: 3.10
27
- Topic :: Scientific/Engineering :: Bio-Informatics
28
- Topic :: Scientific/Engineering :: Chemistry
29
- Topic :: Scientific/Engineering :: Physics
30
- keywords =
31
- science
32
- chemistry
33
- molecular-dynamic
34
- biology
35
- drug-design
36
-
37
- [options]
38
- packages = find:
39
- python_requires = >= 3.8, < 3.11
40
- include_package_data = True
41
- install_requires =
42
- pyyaml
43
- parmed
44
-
45
- [options.extras_require]
46
- test =
47
- pytest
48
-
49
- [options.entry_points]
50
- console_scripts =
51
- parameterize = toff.cli:__parameterize_cmd
52
-
53
- [egg_info]
54
- tag_build =
55
- tag_date = 0
56
-
toff-0.0.2/setup.py DELETED
@@ -1,3 +0,0 @@
1
- from setuptools import setup
2
- if __name__ == '__main__':
3
- setup()
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
-
4
- # We will use semantic version (major, minor, patch)
5
- __main_version_tuple__ = (0, 0, 2)
6
- __pre_version_tuple__ = None # or None or an empty tuple, the first char is alpha, beta, rc, etc...
7
-
8
- if __pre_version_tuple__:
9
- __version_tuple__ = tuple(list(__main_version_tuple__) + list(__pre_version_tuple__))
10
- __version__ = '.'.join([str(i) for i in __main_version_tuple__]) + f'{__pre_version_tuple__[0][0]}' + '.'.join([str(i) for i in __pre_version_tuple__[1:]])
11
- else:
12
- __version_tuple__ = __main_version_tuple__
13
- __version__ = '.'.join([str(i) for i in __main_version_tuple__])
@@ -1,14 +0,0 @@
1
- LICENSE
2
- README.rst
3
- setup.cfg
4
- setup.py
5
- toff/__init__.py
6
- toff/_version.py
7
- toff/cli.py
8
- toff/utils.py
9
- toff.egg-info/PKG-INFO
10
- toff.egg-info/SOURCES.txt
11
- toff.egg-info/dependency_links.txt
12
- toff.egg-info/entry_points.txt
13
- toff.egg-info/requires.txt
14
- toff.egg-info/top_level.txt
File without changes