openff-toolkit 0.18.0__py3-none-any.whl
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.
- devtools/scripts/build_cookiecutter_json.py +22 -0
- docs/conf.py +296 -0
- docs/conftest.py +23 -0
- examples/conformer_energies/conformer_energies.py +143 -0
- examples/deprecated/SMIRNOFF_comparison/compare_molecule_energies.py +48 -0
- examples/deprecated/SMIRNOFF_comparison/compare_set_energies.py +58 -0
- examples/deprecated/liquid_box/create_mol2_pdb/create_mol2_pdb.py +193 -0
- examples/deprecated/liquid_box/openff_simulation.py +72 -0
- examples/deprecated/mixedFF_structure/generate_mixedFF_complex.py +56 -0
- examples/deprecated/testing/test_impropers/tleap_tools.py +120 -0
- examples/examples_helper.py +61 -0
- openff/toolkit/__init__.py +101 -0
- openff/toolkit/_tests/__init__.py +0 -0
- openff/toolkit/_tests/_stale_tests.py +146 -0
- openff/toolkit/_tests/conftest.py +108 -0
- openff/toolkit/_tests/create_molecules.py +494 -0
- openff/toolkit/_tests/mocking.py +145 -0
- openff/toolkit/_tests/molecule/__init__.py +1 -0
- openff/toolkit/_tests/molecule/test_state_enumeration.py +302 -0
- openff/toolkit/_tests/test_energies.py +136 -0
- openff/toolkit/_tests/test_examples.py +109 -0
- openff/toolkit/_tests/test_forcefield.py +3864 -0
- openff/toolkit/_tests/test_interchange.py +19 -0
- openff/toolkit/_tests/test_io.py +19 -0
- openff/toolkit/_tests/test_links.py +73 -0
- openff/toolkit/_tests/test_mm_molecule.py +404 -0
- openff/toolkit/_tests/test_molecule.py +4246 -0
- openff/toolkit/_tests/test_nagl.py +169 -0
- openff/toolkit/_tests/test_parameter_plugins.py +89 -0
- openff/toolkit/_tests/test_parameters.py +2898 -0
- openff/toolkit/_tests/test_toolkit_io.py +1088 -0
- openff/toolkit/_tests/test_toolkits.py +4418 -0
- openff/toolkit/_tests/test_topology.py +2485 -0
- openff/toolkit/_tests/test_utils.py +101 -0
- openff/toolkit/_tests/test_utils_callback.py +178 -0
- openff/toolkit/_tests/test_utils_collections.py +263 -0
- openff/toolkit/_tests/test_utils_serialization.py +168 -0
- openff/toolkit/_tests/utils.py +1747 -0
- openff/toolkit/data/README.md +8 -0
- openff/toolkit/data/molecules/AlkEthOH_test_filt1_ff.mol2 +2026 -0
- openff/toolkit/data/molecules/AlkEthOH_test_filt1_tripos.mol2 +2026 -0
- openff/toolkit/data/molecules/AlkEthOH_tripos.tar.gz +0 -0
- openff/toolkit/data/molecules/CID20742535_anion.sdf +50 -0
- openff/toolkit/data/molecules/CID20742535_neutral.sdf +51 -0
- openff/toolkit/data/molecules/FreeSolv.tar.gz +0 -0
- openff/toolkit/data/molecules/MiniDrugBank.sdf +33988 -0
- openff/toolkit/data/molecules/MiniDrugBank_tripos.mol2 +35462 -0
- openff/toolkit/data/molecules/PT2385.sdf +90 -0
- openff/toolkit/data/molecules/QL8.sdf +401 -0
- openff/toolkit/data/molecules/README.md +21 -0
- openff/toolkit/data/molecules/benzene.crd +8 -0
- openff/toolkit/data/molecules/benzene.mol2 +34 -0
- openff/toolkit/data/molecules/benzene.top +166 -0
- openff/toolkit/data/molecules/butane_multi.sdf +231 -0
- openff/toolkit/data/molecules/cyclohexane.mol2 +44 -0
- openff/toolkit/data/molecules/ethanol.mol2 +25 -0
- openff/toolkit/data/molecules/ethanol.sdf +23 -0
- openff/toolkit/data/molecules/ethanol_partial_charges.sdf +26 -0
- openff/toolkit/data/molecules/ethanol_reordered.mol2 +25 -0
- openff/toolkit/data/molecules/ethanol_reordered.sdf +23 -0
- openff/toolkit/data/molecules/ethene_rdkit.sdf +17 -0
- openff/toolkit/data/molecules/laromustine_ff.mol2 +71 -0
- openff/toolkit/data/molecules/laromustine_tripos.mol2 +71 -0
- openff/toolkit/data/molecules/methane_multiconformer.sdf +32 -0
- openff/toolkit/data/molecules/methane_multiconformer_properties.sdf +45 -0
- openff/toolkit/data/molecules/nh4.pdb +7 -0
- openff/toolkit/data/molecules/po4_phenylphosphate.pdb +46 -0
- openff/toolkit/data/molecules/ruxolitinib_conformers.sdf +910 -0
- openff/toolkit/data/molecules/toluene.mol2 +38 -0
- openff/toolkit/data/molecules/toluene.mol2.gz +0 -0
- openff/toolkit/data/molecules/toluene.pdb +30 -0
- openff/toolkit/data/molecules/toluene.sdf +36 -0
- openff/toolkit/data/molecules/toluene_charged.mol2 +38 -0
- openff/toolkit/data/molecules/z_3_hydroxy_propenal.sdf +23 -0
- openff/toolkit/data/proteins/5tbm_complex_solv.pdb +1928 -0
- openff/toolkit/data/proteins/5tbm_complex_solv_box.pdb +19563 -0
- openff/toolkit/data/proteins/CTerminal_ALA.pdb +20 -0
- openff/toolkit/data/proteins/CTerminal_ALA.sdf +43 -0
- openff/toolkit/data/proteins/CTerminal_ALA_ALA.pdb +30 -0
- openff/toolkit/data/proteins/CTerminal_ALA_ALA_misnamedH.pdb +30 -0
- openff/toolkit/data/proteins/CTerminal_ARG.pdb +34 -0
- openff/toolkit/data/proteins/CTerminal_TRP.pdb +34 -0
- openff/toolkit/data/proteins/MainChain_ALA.pdb +25 -0
- openff/toolkit/data/proteins/MainChain_ALA.sdf +52 -0
- openff/toolkit/data/proteins/MainChain_ALA_ALA.pdb +35 -0
- openff/toolkit/data/proteins/MainChain_ALA_ALA.sdf +69 -0
- openff/toolkit/data/proteins/MainChain_ALA_ALA_icodes.pdb +35 -0
- openff/toolkit/data/proteins/MainChain_ALA_ALA_no_hydrogens.pdb +17 -0
- openff/toolkit/data/proteins/MainChain_ARG.pdb +39 -0
- openff/toolkit/data/proteins/MainChain_ARG.sdf +81 -0
- openff/toolkit/data/proteins/MainChain_CYM.pdb +25 -0
- openff/toolkit/data/proteins/MainChain_CYS.pdb +26 -0
- openff/toolkit/data/proteins/MainChain_CYX.pdb +48 -0
- openff/toolkit/data/proteins/MainChain_CYX.sdf +96 -0
- openff/toolkit/data/proteins/MainChain_GLH.sdf +64 -0
- openff/toolkit/data/proteins/MainChain_GLU.sdf +63 -0
- openff/toolkit/data/proteins/MainChain_HID.pdb +32 -0
- openff/toolkit/data/proteins/MainChain_HIE.pdb +32 -0
- openff/toolkit/data/proteins/MainChain_HIE.sdf +67 -0
- openff/toolkit/data/proteins/MainChain_HIP.pdb +33 -0
- openff/toolkit/data/proteins/MainChain_HIP.sdf +70 -0
- openff/toolkit/data/proteins/MainChain_PRO.pdb +29 -0
- openff/toolkit/data/proteins/MainChain_TRP.pdb +39 -0
- openff/toolkit/data/proteins/NTerminal_ALA.pdb +21 -0
- openff/toolkit/data/proteins/NTerminal_ALA.sdf +45 -0
- openff/toolkit/data/proteins/NTerminal_ALA_ALA.pdb +31 -0
- openff/toolkit/data/proteins/NTerminal_ARG.pdb +35 -0
- openff/toolkit/data/proteins/NTerminal_TRP.pdb +35 -0
- openff/toolkit/data/proteins/T4-protein-unprocessed-4w51.pdb +1892 -0
- openff/toolkit/data/proteins/T4-protein.mol2 +5461 -0
- openff/toolkit/data/proteins/T4-protein.pdb +2637 -0
- openff/toolkit/data/proteins/T4-protein.sdf +5318 -0
- openff/toolkit/data/proteins/T4_protein_waters.pdb +2965 -0
- openff/toolkit/data/proteins/TwoMol_SER_CYS.pdb +50 -0
- openff/toolkit/data/proteins/aa_residues_substructures_explicit_bond_orders_with_caps.json +6435 -0
- openff/toolkit/data/proteins/aa_residues_substructures_explicit_bond_orders_with_caps_explicit_connectivity.json +6675 -0
- openff/toolkit/data/proteins/aa_residues_substructures_with_caps.json +6297 -0
- openff/toolkit/data/proteins/ace-ZZZ-gly-nme.pdb +78 -0
- openff/toolkit/data/proteins/ace-ZZZ-gly-nme.sdf +98 -0
- openff/toolkit/data/proteins/ace-a10-nme.sdf +229 -0
- openff/toolkit/data/proteins/ace-ala-nh2.pdb +21 -0
- openff/toolkit/data/proteins/fluoresceine_dyed_helix_capped.pdb +338 -0
- openff/toolkit/data/proteins/neutral_arginine.pdb +31 -0
- openff/toolkit/data/proteins/split_chain.pdb +74 -0
- openff/toolkit/data/proteins/split_chain_reordered.pdb +74 -0
- openff/toolkit/data/reference_energies/README.md +6 -0
- openff/toolkit/data/reference_energies/reference_0.8.0.json +1 -0
- openff/toolkit/data/reference_energies/reference_0.8.0.json.txt +180 -0
- openff/toolkit/data/reference_energies/reference_after_1007.json +1 -0
- openff/toolkit/data/reference_energies/reference_after_1007.json.txt +350 -0
- openff/toolkit/data/reference_energies/reference_after_802.json +1 -0
- openff/toolkit/data/reference_energies/reference_after_802.json.txt +291 -0
- openff/toolkit/data/systems/README.md +3 -0
- openff/toolkit/data/systems/amber/cyclohexane_ethanol_0.4_0.6.inpcrd +1511 -0
- openff/toolkit/data/systems/amber/cyclohexane_ethanol_0.4_0.6.prmtop +13367 -0
- openff/toolkit/data/systems/monomers/butanol.mol2 +38 -0
- openff/toolkit/data/systems/monomers/butanol.sdf +88 -0
- openff/toolkit/data/systems/monomers/cyclohexane.mol2 +45 -0
- openff/toolkit/data/systems/monomers/cyclohexane.sdf +105 -0
- openff/toolkit/data/systems/monomers/ethanol.mol2 +26 -0
- openff/toolkit/data/systems/monomers/ethanol.sdf +58 -0
- openff/toolkit/data/systems/monomers/methane.mol2 +18 -0
- openff/toolkit/data/systems/monomers/methane.sdf +38 -0
- openff/toolkit/data/systems/monomers/propane.mol2 +30 -0
- openff/toolkit/data/systems/monomers/propane.sdf +68 -0
- openff/toolkit/data/systems/monomers/tip3p_water.mol2 +14 -0
- openff/toolkit/data/systems/monomers/water.mol2 +14 -0
- openff/toolkit/data/systems/monomers/water.sdf +28 -0
- openff/toolkit/data/systems/packmol_boxes/cyclohexane_ethanol_0.4_0.6.pdb +6272 -0
- openff/toolkit/data/systems/packmol_boxes/cyclohexane_water.pdb +5524 -0
- openff/toolkit/data/systems/packmol_boxes/ethanol_water.pdb +5174 -0
- openff/toolkit/data/systems/packmol_boxes/propane_methane_butanol_0.2_0.3_0.5.pdb +7959 -0
- openff/toolkit/data/systems/test_systems/1_cyclohexane_1_ethanol.pdb +61 -0
- openff/toolkit/data/systems/test_systems/1_ethanol.pdb +24 -0
- openff/toolkit/data/systems/test_systems/1_ethanol_no_conect.pdb +15 -0
- openff/toolkit/data/systems/test_systems/1_ethanol_reordered.pdb +24 -0
- openff/toolkit/data/systems/test_systems/PE.pdb +67 -0
- openff/toolkit/data/systems/test_systems/README.md +3 -0
- openff/toolkit/data/systems/test_systems/T4_lysozyme_water_ions.pdb +29240 -0
- openff/toolkit/data/test_forcefields/Frosst_AlkEthOH.offxml +61 -0
- openff/toolkit/data/test_forcefields/Frosst_AlkEthOH_GBSA.offxml +78 -0
- openff/toolkit/data/test_forcefields/Frosst_AlkEthOH_MDL.offxml +62 -0
- openff/toolkit/data/test_forcefields/Frosst_AlkEthOH_parmAtFrosst.offxml +64 -0
- openff/toolkit/data/test_forcefields/GBSA_HCT-1.0.offxml +21 -0
- openff/toolkit/data/test_forcefields/GBSA_OBC1-1.0.offxml +18 -0
- openff/toolkit/data/test_forcefields/GBSA_OBC2-1.0.offxml +18 -0
- openff/toolkit/data/test_forcefields/README.md +23 -0
- openff/toolkit/data/test_forcefields/ammonia_minimal.offxml +27 -0
- openff/toolkit/data/test_forcefields/benzene_minimal.offxml +29 -0
- openff/toolkit/data/test_forcefields/chargeincrement-test.offxml +16 -0
- openff/toolkit/data/test_forcefields/frcmod.Frosst_AlkEthOH_withIDs +85 -0
- openff/toolkit/data/test_forcefields/ion_charges.offxml +18 -0
- openff/toolkit/data/test_forcefields/mangled.offxml +9 -0
- openff/toolkit/data/test_forcefields/old/README.md +9 -0
- openff/toolkit/data/test_forcefields/old/hbonds.offxml +11 -0
- openff/toolkit/data/test_forcefields/old/test_ff_0_0_2_spec_0_1.offxml +332 -0
- openff/toolkit/data/test_forcefields/old/test_ff_0_0_2_spec_0_2.offxml +338 -0
- openff/toolkit/data/test_forcefields/old/test_ff_0_0_2_spec_0_3.offxml +329 -0
- openff/toolkit/data/test_forcefields/old/test_ff_0_0_4_fixed_spec_0_1.offxml +342 -0
- openff/toolkit/data/test_forcefields/old/test_ff_0_0_4_fixed_spec_0_2.offxml +348 -0
- openff/toolkit/data/test_forcefields/old/test_ff_0_0_4_fixed_spec_0_3.offxml +337 -0
- openff/toolkit/data/test_forcefields/old/test_ff_0_0_4_spec_0_1.offxml +340 -0
- openff/toolkit/data/test_forcefields/old/test_ff_0_0_4_spec_0_2.offxml +346 -0
- openff/toolkit/data/test_forcefields/old/test_ff_0_0_4_spec_0_3.offxml +337 -0
- openff/toolkit/data/test_forcefields/smirff99Frosst_reference_0_1_spec.offxml +349 -0
- openff/toolkit/data/test_forcefields/smirnoff99Frosst_experimental.offxml +343 -0
- openff/toolkit/data/test_forcefields/smirnoff99Frosst_reference_0_1_spec.offxml +349 -0
- openff/toolkit/data/test_forcefields/smirnoff99Frosst_reference_0_2_spec.offxml +356 -0
- openff/toolkit/data/test_forcefields/test_forcefield.offxml +346 -0
- openff/toolkit/data/test_forcefields/tip3p.offxml +22 -0
- openff/toolkit/data/test_forcefields/unsupported_smirnoff_version.offxml +9 -0
- openff/toolkit/topology/__init__.py +43 -0
- openff/toolkit/topology/_mm_molecule.py +663 -0
- openff/toolkit/topology/molecule.py +6102 -0
- openff/toolkit/topology/topology.py +2555 -0
- openff/toolkit/typing/__init__.py +1 -0
- openff/toolkit/typing/engines/__init__.py +1 -0
- openff/toolkit/typing/engines/smirnoff/__init__.py +31 -0
- openff/toolkit/typing/engines/smirnoff/forcefield.py +1440 -0
- openff/toolkit/typing/engines/smirnoff/io.py +234 -0
- openff/toolkit/typing/engines/smirnoff/parameters.py +3839 -0
- openff/toolkit/typing/engines/smirnoff/plugins.py +91 -0
- openff/toolkit/utils/__init__.py +57 -0
- openff/toolkit/utils/_viz.py +104 -0
- openff/toolkit/utils/ambertools_wrapper.py +507 -0
- openff/toolkit/utils/base_wrapper.py +268 -0
- openff/toolkit/utils/builtin_wrapper.py +136 -0
- openff/toolkit/utils/callback.py +187 -0
- openff/toolkit/utils/collections.py +247 -0
- openff/toolkit/utils/constants.py +18 -0
- openff/toolkit/utils/exceptions.py +766 -0
- openff/toolkit/utils/nagl_wrapper.py +164 -0
- openff/toolkit/utils/openeye_wrapper.py +2750 -0
- openff/toolkit/utils/rdkit_wrapper.py +3302 -0
- openff/toolkit/utils/serialization.py +466 -0
- openff/toolkit/utils/toolkit_registry.py +509 -0
- openff/toolkit/utils/toolkits.py +217 -0
- openff/toolkit/utils/utils.py +805 -0
- openff_toolkit-0.18.0.dist-info/METADATA +109 -0
- openff_toolkit-0.18.0.dist-info/RECORD +231 -0
- openff_toolkit-0.18.0.dist-info/WHEEL +5 -0
- openff_toolkit-0.18.0.dist-info/licenses/LICENSE +21 -0
- openff_toolkit-0.18.0.dist-info/top_level.txt +5 -0
- utilities/deprecated/convert_frosst/convert_frcmod_0.1.py +251 -0
- utilities/deprecated/convert_frosst/convert_frcmod_0.2.py +249 -0
- utilities/deprecated/convert_frosst/convert_frcmod_0.3.py +249 -0
- utilities/make_substructure_dict/_cif_to_substructure_dict.py +955 -0
- utilities/make_substructure_dict/_make_chemical_substructures.py +46 -0
- utilities/make_substructure_dict/_make_metadata_assignment_substructures.py +35 -0
- utilities/test_plugins/custom_plugins/handler_plugins.py +48 -0
- utilities/test_plugins/setup.py +19 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import sys
|
|
3
|
+
|
|
4
|
+
release_tag = sys.argv[1]
|
|
5
|
+
python_version = sys.argv[2]
|
|
6
|
+
ci_os = sys.argv[3]
|
|
7
|
+
|
|
8
|
+
platform_mapping = {
|
|
9
|
+
"ubuntu-latest": "linux-64",
|
|
10
|
+
"macOS-latest": "osx-64",
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
data = {
|
|
14
|
+
"name": "openff-toolkit",
|
|
15
|
+
"channel": "conda-forge",
|
|
16
|
+
"python": [python_version],
|
|
17
|
+
"platform": [platform_mapping[ci_os]],
|
|
18
|
+
"release": release_tag,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
with open("new_cookiecutter.json", "w") as fp:
|
|
22
|
+
json.dump(data, fp)
|
docs/conf.py
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
#
|
|
3
|
+
# openff-toolkit documentation build configuration file, created by
|
|
4
|
+
# sphinx-quickstart on Sun Dec 3 23:12:54 2017.
|
|
5
|
+
#
|
|
6
|
+
# This file is execfile()d with the current directory set to its
|
|
7
|
+
# containing dir.
|
|
8
|
+
#
|
|
9
|
+
# Note that not all possible configuration values are present in this
|
|
10
|
+
# autogenerated file.
|
|
11
|
+
#
|
|
12
|
+
# All configuration values have a default; values that are commented out
|
|
13
|
+
# serve to show the default.
|
|
14
|
+
|
|
15
|
+
# If extensions (or modules to document with autodoc) are in another directory,
|
|
16
|
+
# add these directories to sys.path here. If the directory is relative to the
|
|
17
|
+
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
|
18
|
+
#
|
|
19
|
+
import os
|
|
20
|
+
import sys
|
|
21
|
+
from importlib.util import find_spec as find_import_spec
|
|
22
|
+
|
|
23
|
+
import openff.toolkit
|
|
24
|
+
|
|
25
|
+
sys.path.insert(0, os.path.abspath("."))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# -- General configuration ------------------------------------------------
|
|
29
|
+
|
|
30
|
+
# If your documentation needs a minimal Sphinx version, state it here.
|
|
31
|
+
#
|
|
32
|
+
# needs_sphinx = "4.4.0"
|
|
33
|
+
|
|
34
|
+
# Add any Sphinx extension module names here, as strings. They can be
|
|
35
|
+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
|
36
|
+
# ones.
|
|
37
|
+
extensions = [
|
|
38
|
+
"sphinx.ext.autodoc",
|
|
39
|
+
"sphinx.ext.napoleon",
|
|
40
|
+
"sphinx.ext.autosummary",
|
|
41
|
+
"sphinx.ext.doctest",
|
|
42
|
+
"sphinx.ext.todo",
|
|
43
|
+
"sphinx.ext.mathjax",
|
|
44
|
+
"sphinx.ext.viewcode",
|
|
45
|
+
"sphinx.ext.intersphinx",
|
|
46
|
+
"openff_sphinx_theme",
|
|
47
|
+
"myst_nb",
|
|
48
|
+
# "myst_parser",
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
# Autodoc settings
|
|
52
|
+
autosummary_generate = True
|
|
53
|
+
|
|
54
|
+
autodoc_default_options = {
|
|
55
|
+
"members": True,
|
|
56
|
+
"inherited-members": True,
|
|
57
|
+
"member-order": "bysource",
|
|
58
|
+
}
|
|
59
|
+
autodoc_preserve_defaults = True
|
|
60
|
+
autodoc_typehints_format = "short"
|
|
61
|
+
# Workaround for autodoc_typehints_format not working for attributes
|
|
62
|
+
# see https://github.com/sphinx-doc/sphinx/issues/10290#issuecomment-1079740009
|
|
63
|
+
python_use_unqualified_type_names = True
|
|
64
|
+
|
|
65
|
+
napoleon_numpy_docstring = True
|
|
66
|
+
napoleon_google_docstring = False
|
|
67
|
+
napoleon_attr_annotations = True
|
|
68
|
+
napoleon_custom_sections = [("attributes", "params_style")]
|
|
69
|
+
napoleon_use_rtype = False
|
|
70
|
+
napoleon_use_param = True
|
|
71
|
+
|
|
72
|
+
_python_doc_base = "https://docs.python.org/3.7"
|
|
73
|
+
intersphinx_mapping = {
|
|
74
|
+
"python": ("https://docs.python.org/3.7", None),
|
|
75
|
+
"numpy": ("https://numpy.org/doc/stable", None),
|
|
76
|
+
"scipy": ("https://docs.scipy.org/doc/scipy", None),
|
|
77
|
+
"scikit.learn": ("https://scikit-learn.org/stable", None),
|
|
78
|
+
"openmm": ("http://docs.openmm.org/latest/api-python/", None),
|
|
79
|
+
"rdkit": ("https://www.rdkit.org/docs", None),
|
|
80
|
+
"openeye": ("https://docs.eyesopen.com/toolkits/python/", None),
|
|
81
|
+
"mdtraj": ("https://www.mdtraj.org/1.9.5/", None),
|
|
82
|
+
"openff.interchange": (
|
|
83
|
+
"https://docs.openforcefield.org/projects/interchange/en/stable/",
|
|
84
|
+
None,
|
|
85
|
+
),
|
|
86
|
+
"openff.fragmenter": (
|
|
87
|
+
"https://docs.openforcefield.org/projects/fragmenter/en/stable/",
|
|
88
|
+
None,
|
|
89
|
+
),
|
|
90
|
+
"openff.units": (
|
|
91
|
+
"https://docs.openforcefield.org/projects/units/en/stable/",
|
|
92
|
+
None,
|
|
93
|
+
),
|
|
94
|
+
"openff.nagl": (
|
|
95
|
+
"https://docs.openforcefield.org/projects/nagl/en/stable/",
|
|
96
|
+
None,
|
|
97
|
+
),
|
|
98
|
+
"openff.docs": (
|
|
99
|
+
"https://docs.openforcefield.org/en/latest/",
|
|
100
|
+
None,
|
|
101
|
+
),
|
|
102
|
+
}
|
|
103
|
+
myst_url_schemes = [
|
|
104
|
+
"http",
|
|
105
|
+
"https",
|
|
106
|
+
]
|
|
107
|
+
|
|
108
|
+
# Add any paths that contain templates here, relative to this directory.
|
|
109
|
+
templates_path = ["_templates"]
|
|
110
|
+
|
|
111
|
+
# Extensions for the myst parser
|
|
112
|
+
myst_enable_extensions = [
|
|
113
|
+
"dollarmath",
|
|
114
|
+
"colon_fence",
|
|
115
|
+
"smartquotes",
|
|
116
|
+
"replacements",
|
|
117
|
+
"deflist",
|
|
118
|
+
]
|
|
119
|
+
myst_heading_anchors = 4
|
|
120
|
+
|
|
121
|
+
# Myst NB settings
|
|
122
|
+
# Never execute notebooks - this should be done by CI
|
|
123
|
+
# Output is stored in the notebook itself
|
|
124
|
+
# Remember `Widgets -> Save Notebook Widget State` in the notebook.
|
|
125
|
+
nb_execution_mode = "off"
|
|
126
|
+
|
|
127
|
+
# sphinx-notfound-page
|
|
128
|
+
# https://github.com/readthedocs/sphinx-notfound-page
|
|
129
|
+
# Renders a 404 page with absolute links
|
|
130
|
+
if find_import_spec("notfound"):
|
|
131
|
+
extensions.append("notfound.extension")
|
|
132
|
+
|
|
133
|
+
notfound_urls_prefix = "/projects/toolkit/en/stable/"
|
|
134
|
+
notfound_context = {
|
|
135
|
+
"title": "404: File Not Found",
|
|
136
|
+
"body": f"""
|
|
137
|
+
<h1>404: File Not Found</h1>
|
|
138
|
+
<p>
|
|
139
|
+
Sorry, we couldn't find that page. This often happens as a result of
|
|
140
|
+
following an outdated link. Please check the
|
|
141
|
+
<a href="{notfound_urls_prefix}">latest stable version</a>
|
|
142
|
+
of the docs, unless you're sure you want an earlier version, and
|
|
143
|
+
try using the search box or the navigation menu on the left.
|
|
144
|
+
</p>
|
|
145
|
+
<p>
|
|
146
|
+
</p>
|
|
147
|
+
""",
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
# The suffix(es) of source filenames.
|
|
151
|
+
# You can specify multiple suffix as a list of string:
|
|
152
|
+
source_suffix = [".rst", ".md", ".ipynb"]
|
|
153
|
+
|
|
154
|
+
# The master toctree document.
|
|
155
|
+
master_doc = "index"
|
|
156
|
+
|
|
157
|
+
# General information about the project.
|
|
158
|
+
project = "OpenFF Toolkit"
|
|
159
|
+
copyright = "2016-2021 Open Force Field Initiative"
|
|
160
|
+
author = "Open Force Field Initiative"
|
|
161
|
+
|
|
162
|
+
# The version info for the project you're documenting, acts as replacement for
|
|
163
|
+
# |version| and |release|, also used in various other places throughout the
|
|
164
|
+
# built documents.
|
|
165
|
+
#
|
|
166
|
+
# The short X.Y version.
|
|
167
|
+
version = openff.toolkit.__version__
|
|
168
|
+
# The full version, including alpha/beta/rc tags.
|
|
169
|
+
release = openff.toolkit.__version__
|
|
170
|
+
|
|
171
|
+
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
172
|
+
# for a list of supported languages.
|
|
173
|
+
#
|
|
174
|
+
# This is also used if you do content translation via gettext catalogs.
|
|
175
|
+
# Usually you set "language" from the command line for these cases.
|
|
176
|
+
language = "en"
|
|
177
|
+
|
|
178
|
+
# List of patterns, relative to source directory, that match files and
|
|
179
|
+
# directories to ignore when looking for source files.
|
|
180
|
+
# This patterns also effect to html_static_path and html_extra_path
|
|
181
|
+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
|
182
|
+
|
|
183
|
+
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
|
184
|
+
todo_include_todos = False
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
# -- Options for HTML output ----------------------------------------------
|
|
188
|
+
|
|
189
|
+
# The theme to use for HTML and HTML Help pages. See the documentation for
|
|
190
|
+
# a list of builtin themes.
|
|
191
|
+
html_theme = "openff_sphinx_theme"
|
|
192
|
+
|
|
193
|
+
# (Optional) Logo and favicon
|
|
194
|
+
html_logo = "_static/images/logos/openff_toolkit_v1_white.png"
|
|
195
|
+
html_favicon = "_static/images/favicon.svg"
|
|
196
|
+
|
|
197
|
+
# Theme options are theme-specific and customize the look and feel of a
|
|
198
|
+
# theme further.
|
|
199
|
+
html_theme_options = {
|
|
200
|
+
# Repository integration
|
|
201
|
+
# Set the repo url for the link to appear
|
|
202
|
+
"repo_url": "https://github.com/openforcefield/openff-toolkit",
|
|
203
|
+
# The name of the repo. If must be set if repo_url is set
|
|
204
|
+
"repo_name": "openff-toolkit",
|
|
205
|
+
# Must be one of github, gitlab or bitbucket
|
|
206
|
+
"repo_type": "github",
|
|
207
|
+
# Colour for sidebar captions and other accents. One of
|
|
208
|
+
# openff-toolkit-blue, openff-dataset-yellow, openff-evaluator-orange,
|
|
209
|
+
# red, pink, purple, deep-purple, indigo, blue, light-blue, cyan,
|
|
210
|
+
# teal, green, light-green, lime, yellow, amber, orange, deep-orange
|
|
211
|
+
"color_accent": "openff-toolkit-blue",
|
|
212
|
+
# Content Minification for deployment, prettification for debugging
|
|
213
|
+
"html_minify": False,
|
|
214
|
+
"html_prettify": False,
|
|
215
|
+
"css_minify": True,
|
|
216
|
+
"master_doc": False,
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
# Add any paths that contain custom static files (such as style sheets) here,
|
|
220
|
+
# relative to this directory. They are copied after the builtin static files,
|
|
221
|
+
# so a file named "default.css" will overwrite the builtin "default.css".
|
|
222
|
+
html_static_path = ["_static"]
|
|
223
|
+
|
|
224
|
+
# Custom sidebar templates, must be a dictionary that maps document names
|
|
225
|
+
# to template names.
|
|
226
|
+
html_sidebars = {
|
|
227
|
+
"**": ["globaltoc.html", "searchbox.html", "localtoc.html"],
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
# -- Options for HTMLHelp output ------------------------------------------
|
|
232
|
+
|
|
233
|
+
# Output file base name for HTML help builder.
|
|
234
|
+
htmlhelp_basename = "openforcefielddoc"
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
# -- Options for LaTeX output ---------------------------------------------
|
|
238
|
+
|
|
239
|
+
latex_elements = {
|
|
240
|
+
# The paper size ('letterpaper' or 'a4paper').
|
|
241
|
+
#
|
|
242
|
+
"papersize": "letterpaper",
|
|
243
|
+
# The font size ('10pt', '11pt' or '12pt').
|
|
244
|
+
#
|
|
245
|
+
"pointsize": "10pt",
|
|
246
|
+
# Additional stuff for the LaTeX preamble.
|
|
247
|
+
"preamble": r"""
|
|
248
|
+
\usepackage{charter}
|
|
249
|
+
\usepackage[defaultsans]{lato}
|
|
250
|
+
\usepackage{inconsolata}
|
|
251
|
+
""",
|
|
252
|
+
# Latex figure (float) alignment
|
|
253
|
+
#
|
|
254
|
+
# 'figure_align': 'htbp',
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
# Grouping the document tree into LaTeX files. List of tuples
|
|
258
|
+
# (source start file, target name, title,
|
|
259
|
+
# author, documentclass [howto, manual, or own class]).
|
|
260
|
+
latex_documents = [
|
|
261
|
+
(
|
|
262
|
+
master_doc,
|
|
263
|
+
"openforcefield.tex",
|
|
264
|
+
"OpenFF Toolkit Documentation",
|
|
265
|
+
"Open Force Field Consortium",
|
|
266
|
+
"manual",
|
|
267
|
+
),
|
|
268
|
+
]
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
# -- Options for manual page output ---------------------------------------
|
|
272
|
+
|
|
273
|
+
# One entry per manual page. List of tuples
|
|
274
|
+
# (source start file, name, description, authors, manual section).
|
|
275
|
+
man_pages = [(master_doc, "openff-toolkit", "OpenFF Toolkit Documentation", [author], 1)]
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
# -- Options for Texinfo output -------------------------------------------
|
|
279
|
+
|
|
280
|
+
# Grouping the document tree into Texinfo files. List of tuples
|
|
281
|
+
# (source start file, target name, title, author,
|
|
282
|
+
# dir menu entry, description, category)
|
|
283
|
+
texinfo_documents = [
|
|
284
|
+
(
|
|
285
|
+
master_doc,
|
|
286
|
+
"openff-toolkit",
|
|
287
|
+
"OpenFF Toolkit Documentation",
|
|
288
|
+
author,
|
|
289
|
+
"openff-toolkit",
|
|
290
|
+
(
|
|
291
|
+
"A modern, extensible library for molecular mechanics force field science from the Open Force "
|
|
292
|
+
"Field Consortium.",
|
|
293
|
+
),
|
|
294
|
+
"Miscellaneous",
|
|
295
|
+
),
|
|
296
|
+
]
|
docs/conftest.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This is a configuration file for PyTest.
|
|
3
|
+
|
|
4
|
+
This file is designed to be used with nbval: https://nbval.readthedocs.io/
|
|
5
|
+
|
|
6
|
+
The nbval-sanitize.cfg file is also for use with nbval.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def pytest_collectstart(collector):
|
|
11
|
+
"""
|
|
12
|
+
Ignore certain outputs when validating documentation notebooks
|
|
13
|
+
|
|
14
|
+
See https://nbval.readthedocs.io/en/latest/#Skipping-certain-output-types
|
|
15
|
+
"""
|
|
16
|
+
if collector.fspath and collector.fspath.ext == ".ipynb":
|
|
17
|
+
collector.skip_compare += (
|
|
18
|
+
# SVGs are often produced by Molecule.visualize()
|
|
19
|
+
# The precise SVG output varies with environment and RDkit version,
|
|
20
|
+
# and failures of visualize() produce exceptions or text output, so
|
|
21
|
+
# we don't lose much by ignoring the actual content.
|
|
22
|
+
"image/svg+xml",
|
|
23
|
+
)
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
|
|
3
|
+
from openff.interchange.drivers.openmm import get_openmm_energies
|
|
4
|
+
from rdkit.Chem import rdMolAlign
|
|
5
|
+
|
|
6
|
+
from openff.toolkit import ForceField, Molecule
|
|
7
|
+
from openff.toolkit.utils import get_data_file_path
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def compute_conformer_energies_from_file(filename):
|
|
11
|
+
# First, load conformers from an SDF file.
|
|
12
|
+
loaded_molecules = Molecule.from_file(
|
|
13
|
+
get_data_file_path("molecules/ruxolitinib_conformers.sdf"),
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
# Normalize to list
|
|
17
|
+
try:
|
|
18
|
+
loaded_molecules = [*loaded_molecules]
|
|
19
|
+
except TypeError:
|
|
20
|
+
loaded_molecules = [loaded_molecules]
|
|
21
|
+
|
|
22
|
+
# from_file loads each entry in the SDF into its own molecule,
|
|
23
|
+
# so collapse conformers into the same molecule
|
|
24
|
+
molecule = loaded_molecules.pop(0)
|
|
25
|
+
for next_molecule in loaded_molecules:
|
|
26
|
+
if next_molecule == molecule:
|
|
27
|
+
for conformer in next_molecule.conformers:
|
|
28
|
+
molecule.add_conformer(conformer)
|
|
29
|
+
else:
|
|
30
|
+
# We're assuming the SDF just has multiple conformers of the
|
|
31
|
+
# same molecule, so raise an error if that's not the case
|
|
32
|
+
raise ValueError("Multiple chemical species loaded")
|
|
33
|
+
|
|
34
|
+
# Make sure the molecule has a name
|
|
35
|
+
if not molecule.name:
|
|
36
|
+
molecule.name = molecule.to_hill_formula()
|
|
37
|
+
|
|
38
|
+
print(
|
|
39
|
+
f"Loaded {molecule.n_conformers} conformers"
|
|
40
|
+
+ f" of {molecule.to_smiles(explicit_hydrogens=False)!r}"
|
|
41
|
+
+ f" ({molecule.name})"
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
# Load the openff-2.2.1 force field appropriate for vacuum calculations (without constraints)
|
|
45
|
+
forcefield = ForceField("openff_unconstrained-2.2.1.offxml")
|
|
46
|
+
# Create an Interchange object, which stores the result of parametrizing with this force field
|
|
47
|
+
print(f"Parametrizing {molecule.name} (may take a moment to calculate charges)...")
|
|
48
|
+
interchange = forcefield.create_interchange(molecule.to_topology())
|
|
49
|
+
print("Done.")
|
|
50
|
+
|
|
51
|
+
# We'll store energies in two lists
|
|
52
|
+
initial_energies = []
|
|
53
|
+
minimized_energies = []
|
|
54
|
+
|
|
55
|
+
# And minimized conformers in a second molecule
|
|
56
|
+
minimized_molecule = Molecule(molecule)
|
|
57
|
+
minimized_molecule.conformers.clear()
|
|
58
|
+
|
|
59
|
+
for conformer in molecule.conformers:
|
|
60
|
+
# Use this conformer to update the positions of the Interchange object
|
|
61
|
+
interchange.positions = conformer
|
|
62
|
+
|
|
63
|
+
# Get the (total) initial energy from this conformer and store it
|
|
64
|
+
initial_energies.append(get_openmm_energies(interchange).total_energy)
|
|
65
|
+
|
|
66
|
+
# Minimize using Interchange.minimize, which wraps OpenMM
|
|
67
|
+
interchange.minimize(engine="openmm")
|
|
68
|
+
|
|
69
|
+
# Record minimized energy and positions
|
|
70
|
+
minimized_energies.append(get_openmm_energies(interchange).total_energy)
|
|
71
|
+
minimized_molecule.add_conformer(interchange.positions.to("angstrom"))
|
|
72
|
+
|
|
73
|
+
n_confs = molecule.n_conformers
|
|
74
|
+
print(f"{molecule.name}: {n_confs} conformers")
|
|
75
|
+
|
|
76
|
+
# Create a copy of the molecule so we can work on it
|
|
77
|
+
working_mol = Molecule(molecule)
|
|
78
|
+
|
|
79
|
+
# Print text header
|
|
80
|
+
print("Conformer Initial PE Minimized PE RMSD")
|
|
81
|
+
output = [
|
|
82
|
+
[
|
|
83
|
+
"Conformer",
|
|
84
|
+
"Initial PE (kcal/mol)",
|
|
85
|
+
"Minimized PE (kcal/mol)",
|
|
86
|
+
"RMSD between initial and minimized conformer (Angstrom)",
|
|
87
|
+
]
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
for i, (init_energy, init_coords, min_energy, min_coords) in enumerate(
|
|
91
|
+
zip(
|
|
92
|
+
initial_energies,
|
|
93
|
+
molecule.conformers,
|
|
94
|
+
minimized_energies,
|
|
95
|
+
minimized_molecule.conformers,
|
|
96
|
+
)
|
|
97
|
+
):
|
|
98
|
+
# Clear the conformers from the working molecule
|
|
99
|
+
working_mol.conformers.clear()
|
|
100
|
+
# Save the minimized conformer to file
|
|
101
|
+
working_mol.add_conformer(min_coords)
|
|
102
|
+
working_mol.to_file(
|
|
103
|
+
f"{molecule.name}_conf{i + 1}_minimized.sdf",
|
|
104
|
+
file_format="sdf",
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
# Calculate the RMSD between the initial and minimized conformer
|
|
108
|
+
working_mol.add_conformer(init_coords)
|
|
109
|
+
rdmol = working_mol.to_rdkit()
|
|
110
|
+
rmslist = []
|
|
111
|
+
rdMolAlign.AlignMolConformers(rdmol, RMSlist=rmslist)
|
|
112
|
+
minimization_rms = rmslist[0]
|
|
113
|
+
|
|
114
|
+
# Record the results
|
|
115
|
+
output.append(
|
|
116
|
+
[
|
|
117
|
+
i + 1,
|
|
118
|
+
init_energy.m_as("kilocalories_per_mole"),
|
|
119
|
+
min_energy.m_as("kilocalories_per_mole"),
|
|
120
|
+
minimization_rms,
|
|
121
|
+
]
|
|
122
|
+
)
|
|
123
|
+
print(f"{{:5d}} / {n_confs:5d} : {{:8.3f}} kcal/mol {{:8.3f}} kcal/mol {{:8.3f}} Å".format(*output[-1]))
|
|
124
|
+
|
|
125
|
+
# Write the results out to CSV
|
|
126
|
+
with open(f"{molecule.name}.csv", "w") as of:
|
|
127
|
+
of.write(", ".join(output.pop(0)) + "\n")
|
|
128
|
+
for line in output:
|
|
129
|
+
of.write("{}, {:.3f}, {:.3f}, {:.3f}".format(*line) + "\n")
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
if __name__ == "__main__":
|
|
133
|
+
parser = argparse.ArgumentParser(
|
|
134
|
+
description=(
|
|
135
|
+
"Perform energy minimization on a molecule, potentially with many conformers. For each conformer, this "
|
|
136
|
+
"script will provide the initial energy, minimized energy, and RMSD between the initial and minimized "
|
|
137
|
+
"structure (both as STDOUT and a csv file). The minimized conformers will be written out to SDF."
|
|
138
|
+
),
|
|
139
|
+
)
|
|
140
|
+
parser.add_argument("-f", "--filename", help="Name of an input file containing conformers")
|
|
141
|
+
args = parser.parse_args()
|
|
142
|
+
|
|
143
|
+
compute_conformer_energies_from_file(args.filename)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Cross-check energies of molecules from AlkEthOH set using SMIRNOFF xml file
|
|
5
|
+
versus energies from AMBER .prmtop and .crd files (parm@frosst params).
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import os
|
|
9
|
+
|
|
10
|
+
# datapath = './AlkEthOH_tripos/AlkEthOH_chain_filt1'
|
|
11
|
+
# datapath = './AlkEthOH_tripos/AlkEthOH_rings_filt1'
|
|
12
|
+
datapath = './AlkEthOH_tripos/AlkEthOH_test_filt1'
|
|
13
|
+
|
|
14
|
+
molname = 'AlkEthOH_r22'
|
|
15
|
+
|
|
16
|
+
mol_filepath = os.path.join(datapath, molname + '_tripos.mol2')
|
|
17
|
+
prmtop_filepath = os.path.join(datapath, molname + '.top')
|
|
18
|
+
inpcrd_filepath = os.path.join(datapath, molname + '.crd')
|
|
19
|
+
|
|
20
|
+
# Check if we have this data file; if not we have to extract the archive.
|
|
21
|
+
if not os.path.isdir(datapath):
|
|
22
|
+
print("Extracting archived molecule files.")
|
|
23
|
+
# Extract the AlkEthOH dataset shipped with the toolkit in data/molecules/ in the working directory.
|
|
24
|
+
from openff.toolkit.tests.utils import get_data_file_path
|
|
25
|
+
tarfile_path = os.path.join(get_data_file_path('molecules'), 'AlkEthOH_tripos.tar.gz')
|
|
26
|
+
import tarfile
|
|
27
|
+
with tarfile.open(tarfile_path, 'r:gz') as tar:
|
|
28
|
+
tar.extractall()
|
|
29
|
+
|
|
30
|
+
# Load molecule
|
|
31
|
+
from openff.toolkit.topology import Molecule
|
|
32
|
+
molecule = Molecule.from_file(mol_filepath)
|
|
33
|
+
|
|
34
|
+
# Load force field
|
|
35
|
+
from openff.toolkit.typing.engines.smirnoff import ForceField
|
|
36
|
+
forcefield = ForceField('test_forcefields/Frosst_AlkEthOH_parmAtFrosst.offxml')
|
|
37
|
+
|
|
38
|
+
# Compare energies
|
|
39
|
+
from openff.toolkit.tests.utils import compare_amber_smirnoff
|
|
40
|
+
# We ignore the charges as they are not included in the force field.
|
|
41
|
+
# TODO: Reactivate this check when we'll be able to load charges from the file.
|
|
42
|
+
energies = compare_amber_smirnoff(prmtop_filepath, inpcrd_filepath,
|
|
43
|
+
forcefield, molecule,
|
|
44
|
+
ignore_charges=True)
|
|
45
|
+
|
|
46
|
+
# Pretty-print the result.
|
|
47
|
+
from pprint import pprint
|
|
48
|
+
pprint(energies)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Cross-check energies of molecules from AlkEthOH set using SMIRNOFF xml file
|
|
5
|
+
versus energies from AMBER .prmtop and .crd files (parm@frosst params).
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import os
|
|
9
|
+
import glob
|
|
10
|
+
|
|
11
|
+
# datapath = './AlkEthOH_tripos/AlkEthOH_chain_filt1'
|
|
12
|
+
# datapath = './AlkEthOH_tripos/AlkEthOH_rings_filt1'
|
|
13
|
+
datapath = './AlkEthOH_tripos/AlkEthOH_test_filt1'
|
|
14
|
+
|
|
15
|
+
# Check if we have this data file; if not we have to extract the archive.
|
|
16
|
+
if not os.path.isdir(datapath):
|
|
17
|
+
print("Extracting archived molecule files.")
|
|
18
|
+
# Extract the AlkEthOH dataset shipped with the toolkit in data/molecules/ in the working directory.
|
|
19
|
+
from openff.toolkit.tests.utils import get_data_file_path
|
|
20
|
+
tarfile_path = os.path.join(get_data_file_path('molecules'), 'AlkEthOH_tripos.tar.gz')
|
|
21
|
+
import tarfile
|
|
22
|
+
with tarfile.open(tarfile_path, 'r:gz') as tar:
|
|
23
|
+
tar.extractall()
|
|
24
|
+
|
|
25
|
+
#Obtain list of molecules
|
|
26
|
+
mol_filepaths = glob.glob(datapath+'/*tripos.mol2')
|
|
27
|
+
mol_filepaths = [fnm for fnm in mol_filepaths if not 'c1302' in fnm] # Skip water.
|
|
28
|
+
|
|
29
|
+
print('Found {} files to test'.format(len(mol_filepaths)))
|
|
30
|
+
|
|
31
|
+
# Load force field
|
|
32
|
+
from openff.toolkit.typing.engines.smirnoff import ForceField
|
|
33
|
+
forcefield = ForceField('test_forcefields/Frosst_AlkEthOH_parmAtFrosst.offxml')
|
|
34
|
+
|
|
35
|
+
from openff.toolkit.topology import Molecule
|
|
36
|
+
for mol_idx, mol_filepath in enumerate(mol_filepaths):
|
|
37
|
+
# Load molecule.
|
|
38
|
+
molecule = Molecule.from_file(mol_filepath)
|
|
39
|
+
|
|
40
|
+
molname = os.path.basename(mol_filepath).replace('_tripos.mol2','')
|
|
41
|
+
print("Comparing {} ({}/{})...".format(molname, mol_idx+1, len(mol_filepaths)))
|
|
42
|
+
|
|
43
|
+
prmtop_filepath = os.path.join(datapath, molname+'.top')
|
|
44
|
+
inpcrd_filepath = os.path.join(datapath, molname+'.crd')
|
|
45
|
+
|
|
46
|
+
# Compare energies
|
|
47
|
+
from openff.toolkit.tests.utils import compare_amber_smirnoff
|
|
48
|
+
from openff.toolkit.tests.utils import FailedParameterComparisonError, FailedEnergyComparisonError
|
|
49
|
+
try:
|
|
50
|
+
# We ignore the charges as they are not included in the force field.
|
|
51
|
+
# TODO: Reactivate this check when we'll be able to load charges from the file.
|
|
52
|
+
energies = compare_amber_smirnoff(prmtop_filepath, inpcrd_filepath,
|
|
53
|
+
forcefield, molecule,
|
|
54
|
+
ignore_charges=True)
|
|
55
|
+
except FailedParameterComparisonError as e:
|
|
56
|
+
print(e)
|
|
57
|
+
except FailedEnergyComparisonError as e:
|
|
58
|
+
print(e)
|