├── .github ├── pull_request_template.md └── workflows │ ├── publish_release.yml │ └── tests.yml ├── .gitignore ├── .readthedocs.yml ├── LICENSE ├── README.rst ├── docs ├── Makefile ├── environment.yml └── source │ ├── _static │ ├── openmm_opt_file.mol │ ├── opt_complex.mol │ ├── stko.png │ └── unopt_hgcomplex.mol │ ├── _templates │ ├── class.rst │ └── module.rst │ ├── cage_analysis.rst │ ├── cage_optimisation.rst │ ├── calculators.rst │ ├── conf.py │ ├── helpers.rst │ ├── hg_optimisation.rst │ ├── index.rst │ ├── modules.rst │ ├── molecular.rst │ ├── optimizers.rst │ └── video_tutorials.rst ├── examples ├── aligner_directory │ ├── aligned_0.mol │ ├── aligned_1.mol │ ├── aligned_2.mol │ ├── aligned_3.mol │ ├── aligned_4.mol │ ├── aligned_5.mol │ ├── init_0.mol │ ├── init_1.mol │ ├── init_2.mol │ ├── init_3.mol │ ├── init_4.mol │ ├── init_5.mol │ ├── unaligned_0.mol │ ├── unaligned_1.mol │ ├── unaligned_2.mol │ ├── unaligned_3.mol │ ├── unaligned_4.mol │ └── unaligned_5.mol ├── aligner_example.py ├── basic_example.py ├── cage_analysis_example.py ├── cage_openmm_example.py ├── cage_openmm_example_directory │ ├── opt_cage.mol │ └── unopt_cage.mol ├── cage_output │ ├── apdcage.mol │ ├── apdcage_0.mol │ ├── apdcage_1.mol │ ├── apdcage_10.mol │ ├── apdcage_11.mol │ ├── apdcage_2.mol │ ├── apdcage_3.mol │ ├── apdcage_4.mol │ ├── apdcage_5.mol │ ├── apdcage_6.mol │ ├── apdcage_7.mol │ ├── apdcage_8.mol │ └── apdcage_9.mol ├── calculators_example.py ├── gulp_test_example.py ├── intermediates_example.py ├── mdanalysis_example.py ├── molecule_splitter_example.py ├── obabel_example.py ├── openmm_example.py ├── openmm_example_directory │ ├── ff_opt_cage.mol │ ├── ffrest_opt_cage.mol │ ├── ffunrest_opt_cage.mol │ ├── md_opt_cage.mol │ └── unopt_cage.mol ├── openmm_hg_example.py ├── openmm_hg_example_directory │ ├── opt_complex.mol │ └── unopt_hgcomplex.mol ├── optwrite_example.py ├── optwrite_output │ ├── etkdg_out.mol │ ├── mmff_out.mol │ └── uff_out.mol ├── orca_example.py ├── orca_output_directory │ ├── orca_e1_dir │ │ ├── input_structure.xyz │ │ ├── orca_energy.output │ │ └── orca_input.inp │ ├── orca_e2_dir │ │ ├── input_structure.xyz │ │ ├── orca_energy.output │ │ └── orca_input.inp │ └── orca_e3_dir │ │ ├── input_structure.xyz │ │ └── orca_input.inp ├── out_intermediates │ ├── idx0_3x3FG+2x2FG.mol │ ├── idx1_1x3FG.mol │ ├── idx2_1x2FG.mol │ ├── idx3_2x3FG+3x2FG.mol │ ├── idx4_2x3FG+2x2FG.mol │ ├── idx5_1x3FG+1x2FG.mol │ ├── idx6_2x3FG+3x2FG.mol │ ├── idx7_2x3FG+1x2FG.mol │ ├── idx8_1x3FG+2x2FG.mol │ └── idx9_1x3FG+3x2FG.mol ├── output_directory │ ├── bb1.mol │ ├── bb2.mol │ ├── example_xtb_out │ │ ├── charges │ │ ├── det_control.in │ │ ├── energy.output │ │ ├── input_structure.xyz │ │ ├── wbo │ │ ├── xtbrestart │ │ └── xtbtopo.mol │ ├── obabel_axle_opt.mol │ ├── obabel_axle_unopt.mol │ ├── obabel_bb1_opt.mol │ ├── obabel_bb1_unopt.mol │ ├── obabel_bb2_opt.mol │ ├── obabel_bb2_unopt.mol │ ├── obabel_bb3_opt.mol │ ├── obabel_bb3_unopt.mol │ ├── obabel_cage2_opt.mol │ ├── obabel_cage2_unopt.mol │ ├── obabel_cage_opt.mol │ ├── obabel_cage_unopt.mol │ ├── obabel_cycle_opt.mol │ ├── obabel_cycle_unopt.mol │ ├── obabel_hg_complex_opt.mol │ ├── obabel_hg_complex_unopt.mol │ ├── obabel_m_iron_oct_delta_opt.mol │ ├── obabel_m_iron_oct_delta_unopt.mol │ ├── obabel_m_moc_opt.mol │ ├── obabel_m_moc_unopt.mol │ ├── obabel_polymer_opt.mol │ ├── obabel_polymer_unopt.mol │ ├── obabel_rotaxane_opt.mol │ ├── obabel_rotaxane_unopt.mol │ ├── poly_etkdg.mol │ ├── poly_mmff.mol │ ├── poly_uff.mol │ ├── polymer.mol │ ├── tg_cage.mol │ ├── tg_info.pdb │ ├── tors_test_bb1.mol │ └── tors_test_polymer.mol ├── shape_example.py ├── splitter_output_directory │ ├── original.mol │ ├── original2.mol │ ├── reconstructed.mol │ ├── splits2_0.mol │ ├── splits2_0.xyz │ ├── splits2_1.mol │ ├── splits2_1.xyz │ ├── splits2_2.mol │ ├── splits2_2.xyz │ ├── splits2_3.mol │ ├── splits2_3.xyz │ ├── splits2_4.mol │ ├── splits2_4.xyz │ ├── splits2_5.mol │ ├── splits2_5.xyz │ ├── splits2_6.mol │ ├── splits2_6.xyz │ ├── splits2_7.mol │ ├── splits2_7.xyz │ ├── splits2_8.mol │ ├── splits2_8.xyz │ ├── splits_0.mol │ ├── splits_0.xyz │ ├── splits_1.mol │ ├── splits_1.xyz │ ├── transform2_0.mol │ ├── transform2_1.mol │ ├── transform2_2.mol │ ├── transform2_3.mol │ ├── transform2_4.mol │ ├── transform2_5.mol │ ├── transform2_6.mol │ ├── transform2_7.mol │ ├── transform2_8.mol │ ├── transform_0.mol │ └── transform_1.mol ├── testable_example.py ├── topology_extraction_example.py ├── torsion_example.py └── zmatrix_example.py ├── justfile ├── mypy.ini ├── pyproject.toml ├── src └── stko │ ├── __init__.py │ ├── _internal │ ├── __init__.py │ ├── calculators │ │ ├── __init__.py │ │ ├── extractors │ │ │ ├── __init__.py │ │ │ ├── orca_extractor.py │ │ │ ├── utilities.py │ │ │ └── xtb_extractor.py │ │ ├── geometry_analysis │ │ │ ├── __init__.py │ │ │ └── geometry.py │ │ ├── open_babel_calculators.py │ │ ├── openmm_calculators.py │ │ ├── orca_calculators.py │ │ ├── planarity_calculators.py │ │ ├── rdkit_calculators.py │ │ ├── results │ │ │ ├── __init__.py │ │ │ ├── energy_results.py │ │ │ ├── orca_results.py │ │ │ ├── planarity_results.py │ │ │ ├── rmsd_results.py │ │ │ ├── shape_results.py │ │ │ ├── torsion_results.py │ │ │ └── xtb_results.py │ │ ├── rmsd_calculators.py │ │ ├── shape_calculators.py │ │ ├── torsion_calculators.py │ │ ├── utilities.py │ │ └── xtb_calculators.py │ ├── internal_types.py │ ├── molecular │ │ ├── __init__.py │ │ ├── atoms │ │ │ ├── __init__.py │ │ │ ├── dummy_atom.py │ │ │ └── positioned_atom.py │ │ ├── constructed │ │ │ ├── __init__.py │ │ │ └── constructed_analysis.py │ │ ├── conversion │ │ │ ├── __init__.py │ │ │ ├── md_analysis.py │ │ │ └── z_matrix.py │ │ ├── decompose │ │ │ ├── __init__.py │ │ │ └── decompose_moc.py │ │ ├── functional_groups │ │ │ ├── __init__.py │ │ │ └── three_site.py │ │ ├── intermediates │ │ │ ├── __init__.py │ │ │ └── unreacted.py │ │ ├── molecular_utilities.py │ │ ├── molecule_modifiers │ │ │ ├── __init__.py │ │ │ ├── molecule_splitter.py │ │ │ └── molecule_transformer.py │ │ ├── networkx │ │ │ ├── __init__.py │ │ │ └── network.py │ │ ├── periodic │ │ │ ├── __init__.py │ │ │ ├── unitcell.py │ │ │ └── utilities.py │ │ ├── subgroup_analysis │ │ │ ├── __init__.py │ │ │ ├── subgroup_analyser.py │ │ │ └── three_site_analysis.py │ │ ├── topology_extractor │ │ │ ├── __init__.py │ │ │ ├── topology_extractor.py │ │ │ └── topology_info.py │ │ └── torsion │ │ │ ├── __init__.py │ │ │ ├── torsion.py │ │ │ └── torsion_info.py │ ├── optimizers │ │ ├── __init__.py │ │ ├── aligner.py │ │ ├── collapser.py │ │ ├── gulp.py │ │ ├── macromodel.py │ │ ├── open_babel.py │ │ ├── openmm.py │ │ ├── optimizers.py │ │ ├── rdkit.py │ │ ├── utilities.py │ │ └── xtb.py │ └── utilities │ │ ├── __init__.py │ │ ├── exceptions.py │ │ └── utilities.py │ ├── functional_groups.py │ ├── molecular_utilities.py │ ├── molecule_analysis.py │ ├── py.typed │ └── topology_functions.py └── tests ├── __init__.py ├── calculators ├── __init__.py ├── geometry │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ ├── test_calculate_angles.py │ ├── test_calculate_bonds.py │ ├── test_calculate_torsions.py │ ├── test_get_avg_centroid_distance.py │ ├── test_get_max_diamter.py │ ├── test_get_metal_centroid_metal_angle.py │ ├── test_get_metal_distances.py │ ├── test_get_min_atom_atom.py │ ├── test_get_min_centroid_distance.py │ └── test_get_radius_gyration.py ├── openbabel │ ├── __init__.py │ ├── conftest.py │ └── test_obabel_calculators.py ├── openmm │ ├── __init__.py │ ├── conftest.py │ └── test_openmm_energy.py ├── planarity │ ├── __init__.py │ ├── conftest.py │ └── test_planarity_calculators.py ├── pore │ ├── __init__.py │ ├── case_data.py │ └── conftest.py ├── rmsd │ ├── __init__.py │ ├── conftest.py │ └── test_rmsd_calculators.py └── torsion │ ├── __init__.py │ └── test_torsion_calculators.py ├── molecular ├── __init__.py ├── atoms │ ├── __init__.py │ ├── dummy_atom │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ ├── test_clone.py │ │ ├── test_get_atomic_number.py │ │ ├── test_get_charge.py │ │ └── test_get_id.py │ ├── positioned_atom │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ ├── test_clone.py │ │ ├── test_get_atomic_number.py │ │ ├── test_get_charge.py │ │ ├── test_get_id.py │ │ ├── test_get_position.py │ │ ├── test_repr.py │ │ └── test_with_id.py │ └── utilities.py ├── constructed │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ ├── test_get_building_block_atom_ids.py │ └── test_get_building_block_centroids.py ├── decompose │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ └── test_decomposemoc.py ├── functional_group │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ └── test_threesite.py ├── mdanalysis │ ├── __init__.py │ ├── conftest.py │ └── test_universe.py ├── subgroup │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ └── test_subgroup_analysis.py ├── threesite │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ ├── test_get_adjecent_positions.py │ ├── test_get_binder_adjacent_torsion.py │ ├── test_get_binder_angles.py │ ├── test_get_binder_binder_angle.py │ ├── test_get_binder_centroid_angle.py │ └── test_get_binder_distance.py ├── utilities │ ├── __init__.py │ ├── conftest.py │ ├── test_merge_molecules.py │ └── test_seperate_molecules.py └── z_matrix │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ └── test_zmatrix.py └── optimizers ├── __init__.py ├── aligner ├── __init__.py ├── conftest.py └── test_aligner.py ├── gulp ├── __init__.py ├── conftest.py ├── fixtures │ ├── conformer.xyz │ ├── gulp_MD.trg │ └── gulp_MD_template.xyz ├── test_gulp.py └── test_uff_assign_ff.py ├── maeextractor ├── __init__.py ├── case_data.py ├── conftest.py ├── test-out.maegz └── test_maeextractor.py ├── openmm ├── __init__.py ├── conftest.py └── test_openmm.py ├── optimizer ├── __init__.py ├── conftest.py └── test_optimizers.py ├── rdkit ├── __init__.py ├── conftest.py └── test_rdkit_optimizers.py └── utilities.py /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | Related Issues: 2 | Requested Reviewers: @andrewtarzia 3 | *Note for Reviewers: If you accept the review request add a :+1: to this post* 4 | 5 | 13 | 14 | 18 | 19 | 24 | 25 | 34 | 35 | 39 | 40 | 44 | -------------------------------------------------------------------------------- /.github/workflows/publish_release.yml: -------------------------------------------------------------------------------- 1 | name: Publish release 2 | on: 3 | push: 4 | tags: 5 | - "v[0-9]+.[0-9]+.[0-9]+.[0-9]+" 6 | jobs: 7 | publish-release: 8 | runs-on: ubuntu-latest 9 | env: 10 | VERSION: ${{ github.ref_name }} 11 | steps: 12 | - uses: actions/checkout@v3 13 | - uses: actions/setup-python@v4 14 | with: 15 | python-version: "3.11" 16 | cache: "pip" 17 | - run: pip install -e '.[dev]' 18 | - run: python -m build 19 | - name: Publish 20 | run: twine upload 21 | -u ${{ secrets.PYPI_USERNAME }} 22 | -p ${{ secrets.PYPI_PASSWORD }} 23 | dist/* 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /dist 2 | /build 3 | src/stko.egg-info 4 | src/stko/_version.py 5 | /.coverage 6 | docs/source/_autosummary 7 | 8 | **/__pycache__/ 9 | 10 | **/.cache 11 | .mypy_cache 12 | *.ipynb_checkpoints 13 | **/.vscode 14 | 15 | # Some folders get created by tests. 16 | **/tests_output 17 | docs/build 18 | tests/failures.txt 19 | 20 | /examples/gulp_test_output/ 21 | /examples/gulp_test_output_MD/ 22 | /examples/.model.pt 23 | 24 | /examples/*/md_optimisation 25 | .model.pt 26 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | build: 4 | os: "ubuntu-lts-latest" 5 | tools: 6 | python: "mambaforge-latest" 7 | 8 | sphinx: 9 | configuration: "docs/source/conf.py" 10 | 11 | conda: 12 | environment: "docs/environment.yml" 13 | 14 | python: 15 | install: 16 | - method: pip 17 | path: . 18 | extra_requirements: 19 | - dev 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Computational Supramolecular Materials Discovery 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. 22 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = -W --keep-going 6 | SPHINXBUILD = python -msphinx 7 | SOURCEDIR = source 8 | BUILDDIR = build 9 | 10 | # Put it first so that "make" without argument is like "make help". 11 | help: 12 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 13 | 14 | .PHONY: help Makefile 15 | 16 | # Catch-all target: route all unknown targets to Sphinx using the new 17 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 18 | %: Makefile 19 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -------------------------------------------------------------------------------- /docs/environment.yml: -------------------------------------------------------------------------------- 1 | channels: 2 | - conda-forge 3 | - defaults 4 | dependencies: 5 | - openff-toolkit 6 | - openmm 7 | - openmmtools 8 | - dgl 9 | - python=3.11 10 | - pip 11 | - rdkit==2024.3.4 12 | - espaloma_charge 13 | - mdanalysis 14 | - openbabel 15 | 16 | -------------------------------------------------------------------------------- /docs/source/_static/stko.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/docs/source/_static/stko.png -------------------------------------------------------------------------------- /docs/source/_templates/class.rst: -------------------------------------------------------------------------------- 1 | {{ fullname | escape | underline}} 2 | 3 | .. currentmodule:: {{ module }} 4 | 5 | .. autoclass:: {{ objname }} 6 | :members: 7 | :inherited-members: 8 | :undoc-members: 9 | :show-inheritance: 10 | 11 | {% block attributes %} 12 | {% if attributes %} 13 | .. rubric:: {{ _('Attributes') }} 14 | 15 | .. autosummary:: 16 | {% for item in attributes %} 17 | ~{{ name }}.{{ item }} 18 | {%- endfor %} 19 | {% endif %} 20 | {% endblock %} 21 | 22 | {% block methods %} 23 | 24 | {% set public_methods = [] %} 25 | {% for item in methods %} 26 | {% if not item.startswith('_') %} 27 | {% set public_methods = public_methods.append(item) %} 28 | {% endif %} 29 | {% endfor %} 30 | 31 | {% if public_methods %} 32 | .. rubric:: {{ _('Methods') }} 33 | 34 | .. autosummary:: 35 | :nosignatures: 36 | {% for item in public_methods %} 37 | ~{{ name }}.{{ item }} 38 | {%- endfor %} 39 | {% endif %} 40 | {% endblock %} 41 | -------------------------------------------------------------------------------- /docs/source/_templates/module.rst: -------------------------------------------------------------------------------- 1 | {{ fullname | escape | underline}} 2 | 3 | .. automodule:: {{ fullname }} 4 | 5 | {% block modules %} 6 | {% if modules %} 7 | .. rubric:: Modules 8 | 9 | .. autosummary:: 10 | :toctree: 11 | :template: module.rst 12 | :recursive: 13 | {% for item in modules %} 14 | {{ item }} 15 | {%- endfor %} 16 | {% endif %} 17 | {% endblock %} 18 | 19 | {% block attributes %} 20 | {% if attributes %} 21 | .. rubric:: Module attributes 22 | 23 | .. autosummary:: 24 | :toctree: 25 | {% for item in attributes %} 26 | {{ item }} 27 | {%- endfor %} 28 | {% endif %} 29 | {% endblock %} 30 | 31 | {% block functions %} 32 | {% if functions %} 33 | .. rubric:: {{ _('Functions') }} 34 | 35 | .. autosummary:: 36 | :toctree: 37 | :nosignatures: 38 | {% for item in functions %} 39 | {{ item }} 40 | {%- endfor %} 41 | {% endif %} 42 | {% endblock %} 43 | 44 | {% block classes %} 45 | {% if classes %} 46 | .. rubric:: {{ _('Classes') }} 47 | 48 | .. autosummary:: 49 | :toctree: 50 | :template: class.rst 51 | :nosignatures: 52 | {% for item in classes %} 53 | {{ item }} 54 | {%- endfor %} 55 | {% endif %} 56 | {% endblock %} 57 | 58 | {% block exceptions %} 59 | {% if exceptions %} 60 | .. rubric:: {{ _('Exceptions') }} 61 | 62 | .. autosummary:: 63 | :toctree: 64 | {% for item in exceptions %} 65 | {{ item }} 66 | {%- endfor %} 67 | {% endif %} 68 | {% endblock %} 69 | 70 | 71 | -------------------------------------------------------------------------------- /docs/source/calculators.rst: -------------------------------------------------------------------------------- 1 | Calculators 2 | =========== 3 | 4 | .. toctree:: 5 | :maxdepth: 1 6 | 7 | MMFFEnergy <_autosummary/stko.MMFFEnergy> 8 | UFFEnergy <_autosummary/stko.UFFEnergy> 9 | OpenBabelEnergy <_autosummary/stko.OpenBabelEnergy> 10 | OpenMMEnergy <_autosummary/stko.OpenMMEnergy> 11 | XTBEnergy <_autosummary/stko.XTBEnergy> 12 | OrcaEnergy <_autosummary/stko.OrcaEnergy> 13 | RmsdCalculator <_autosummary/stko.RmsdCalculator> 14 | RmsdMappedCalculator <_autosummary/stko.RmsdMappedCalculator> 15 | KabschRmsdCalculator <_autosummary/stko.KabschRmsdCalculator> 16 | ShapeCalculator <_autosummary/stko.ShapeCalculator> 17 | TorsionCalculator <_autosummary/stko.TorsionCalculator> 18 | ConstructedMoleculeTorsionCalculator <_autosummary/stko.ConstructedMoleculeTorsionCalculator> 19 | MatchedTorsionCalculator <_autosummary/stko.MatchedTorsionCalculator> 20 | PlanarityCalculator <_autosummary/stko.PlanarityCalculator> 21 | GeometryAnalyser <_autosummary/stko.molecule_analysis.GeometryAnalyser> 22 | -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | # Configuration file for the Sphinx documentation builder. 2 | # 3 | # For the full list of built-in configuration values, see the documentation: 4 | # https://www.sphinx-doc.org/en/master/usage/configuration.html 5 | 6 | # -- Project information ----------------------------------------------------- 7 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information 8 | 9 | # -- Project information ---------------------------------------------- 10 | 11 | project = "stko" 12 | project_copyright = "2024, Andrew Tarzia, Lukas Turcani, Steven Bennett" 13 | author = "Andrew Tarzia, Lukas Turcani, Steven Bennett" 14 | 15 | # -- General configuration --------------------------------------------------- 16 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration 17 | 18 | extensions = [ 19 | "sphinx.ext.doctest", 20 | "sphinx.ext.napoleon", 21 | "sphinx.ext.autosummary", 22 | "sphinx.ext.intersphinx", 23 | "sphinx.ext.viewcode", 24 | "sphinx_copybutton", 25 | "moldoc", 26 | ] 27 | 28 | autosummary_imported_members = True 29 | 30 | autodoc_typehints = "description" 31 | autodoc_member_order = "groupwise" 32 | autoclass_content = "class" 33 | 34 | intersphinx_mapping = { 35 | "python": ("https://docs.python.org/3", None), 36 | "numpy": ("https://numpy.org/doc/stable", None), 37 | "pandas": ("https://pandas.pydata.org/docs", None), 38 | "openff": ( 39 | "https://docs.openforcefield.org/projects/toolkit/en/stable", 40 | None, 41 | ), 42 | "openmm": ("http://docs.openmm.org/latest/api-python", None), 43 | } 44 | 45 | templates_path = ["_templates"] 46 | exclude_patterns: list[str] = [] 47 | 48 | 49 | # -- Options for HTML output ------------------------------------------------- 50 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output 51 | 52 | html_theme = "sphinx_rtd_theme" 53 | html_static_path = ["_static"] 54 | -------------------------------------------------------------------------------- /docs/source/helpers.rst: -------------------------------------------------------------------------------- 1 | Helpers 2 | ======= 3 | 4 | .. toctree:: 5 | :maxdepth: 1 6 | 7 | MAEExtractor <_autosummary/stko.MAEExtractor> 8 | XTBExtractor <_autosummary/stko.XTBExtractor> 9 | -------------------------------------------------------------------------------- /docs/source/modules.rst: -------------------------------------------------------------------------------- 1 | Modules 2 | ======= 3 | 4 | .. autosummary:: 5 | :toctree: _autosummary 6 | :template: module.rst 7 | :recursive: 8 | 9 | stko 10 | -------------------------------------------------------------------------------- /docs/source/optimizers.rst: -------------------------------------------------------------------------------- 1 | Optimizers 2 | ========== 3 | 4 | .. toctree:: 5 | :maxdepth: 1 6 | 7 | Optimization Overview <_autosummary/stko.Optimizer> 8 | 9 | .. toctree:: 10 | :maxdepth: 1 11 | 12 | NullOptimizer <_autosummary/stko.NullOptimizer> 13 | OptimizerSequence <_autosummary/stko.OptimizerSequence> 14 | OptWriterSequence <_autosummary/stko.OptWriterSequence> 15 | TryCatchOptimizer <_autosummary/stko.TryCatchOptimizer> 16 | 17 | Aligner <_autosummary/stko.Aligner> 18 | Collapser <_autosummary/stko.Collapser> 19 | CollapserMC <_autosummary/stko.CollapserMC> 20 | ETKDG <_autosummary/stko.ETKDG> 21 | UFF <_autosummary/stko.UFF> 22 | MMFF <_autosummary/stko.MMFF> 23 | MetalOptimizer <_autosummary/stko.MetalOptimizer> 24 | OpenBabel <_autosummary/stko.OpenBabel> 25 | OpenMMForceField <_autosummary/stko.OpenMMForceField> 26 | GulpUFFOptimizer <_autosummary/stko.GulpUFFOptimizer> 27 | MacroModelForceField <_autosummary/stko.MacroModelForceField> 28 | XTB <_autosummary/stko.XTB> 29 | XTBFF <_autosummary/stko.XTBFF> 30 | XTBCREST <_autosummary/stko.XTBCREST> 31 | XTBFFCREST <_autosummary/stko.XTBFFCREST> 32 | 33 | GulpUFFMDOptimizer <_autosummary/stko.GulpUFFMDOptimizer> 34 | MacroModelMD <_autosummary/stko.MacroModelMD> 35 | OpenMMMD <_autosummary/stko.OpenMMMD> -------------------------------------------------------------------------------- /examples/aligner_directory/aligned_0.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 20 19 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 N -0.5735 2.8439 -0.8029 0 9 | M V30 2 C 0.7431 2.4435 -0.3147 0 10 | M V30 3 C 0.6483 1.1417 0.4838 0 11 | M V30 4 N 0.1313 0.0585 -0.3618 0 12 | M V30 5 C -0.0391 -1.1668 0.4272 0 13 | M V30 6 C -0.6625 -2.2663 -0.4416 0 14 | M V30 7 N -0.8708 -3.4951 0.3214 0 15 | M V30 8 H -0.4465 3.6942 -1.3981 0 16 | M V30 9 H -1.1507 3.1398 0.0179 0 17 | M V30 10 H 1.1651 3.2440 0.3332 0 18 | M V30 11 H 1.4302 2.2989 -1.1771 0 19 | M V30 12 H -0.0253 1.3070 1.3544 0 20 | M V30 13 H 1.6607 0.8809 0.8672 0 21 | M V30 14 H 0.8447 -0.1354 -1.1044 0 22 | M V30 15 H 0.9456 -1.5145 0.8146 0 23 | M V30 16 H -0.7150 -0.9705 1.2893 0 24 | M V30 17 H 0.0035 -2.4849 -1.3044 0 25 | M V30 18 H -1.6394 -1.9160 -0.8403 0 26 | M V30 19 H 0.0486 -3.8152 0.7042 0 27 | M V30 20 H -1.4984 -3.2876 1.1322 0 28 | M V30 END ATOM 29 | M V30 BEGIN BOND 30 | M V30 1 1 1 2 31 | M V30 2 1 2 3 32 | M V30 3 1 3 4 33 | M V30 4 1 4 5 34 | M V30 5 1 5 6 35 | M V30 6 1 6 7 36 | M V30 7 1 1 8 37 | M V30 8 1 1 9 38 | M V30 9 1 2 10 39 | M V30 10 1 2 11 40 | M V30 11 1 3 12 41 | M V30 12 1 3 13 42 | M V30 13 1 4 14 43 | M V30 14 1 5 15 44 | M V30 15 1 5 16 45 | M V30 16 1 6 17 46 | M V30 17 1 6 18 47 | M V30 18 1 7 19 48 | M V30 19 1 7 20 49 | M V30 END BOND 50 | M V30 END CTAB 51 | M END 52 | 53 | $$$$ 54 | -------------------------------------------------------------------------------- /examples/aligner_directory/aligned_1.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 24 25 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -0.1998 3.3147 0.3414 0 9 | M V30 2 N 0.5454 2.0601 0.3304 0 10 | M V30 3 C 1.8762 1.8991 0.5331 0 11 | M V30 4 N 2.2758 0.6029 0.4558 0 12 | M V30 5 C 1.1257 -0.0500 0.1916 0 13 | M V30 6 C 0.0893 0.8152 0.1139 0 14 | M V30 7 C -1.1927 0.3561 -0.1583 0 15 | M V30 8 O -2.1636 1.1602 -0.2086 0 16 | M V30 9 N -1.3698 -0.9927 -0.3695 0 17 | M V30 10 C -0.2961 -1.8622 -0.2622 0 18 | M V30 11 O -0.4735 -3.1019 -0.4320 0 19 | M V30 12 N 0.9665 -1.3917 0.0295 0 20 | M V30 13 C 2.1177 -2.3017 0.0993 0 21 | M V30 14 C -2.7169 -1.5221 -0.6410 0 22 | M V30 15 H -0.6779 3.4750 -0.6476 0 23 | M V30 16 H -0.9803 3.2799 1.1301 0 24 | M V30 17 H 0.4797 4.1681 0.5509 0 25 | M V30 18 H 2.5561 2.7165 0.7365 0 26 | M V30 19 H 2.9567 -1.8531 0.6728 0 27 | M V30 20 H 2.4682 -2.5369 -0.9276 0 28 | M V30 21 H 1.8385 -3.2447 0.6160 0 29 | M V30 22 H -3.3548 -0.7685 -1.1501 0 30 | M V30 23 H -3.1985 -1.8205 0.3138 0 31 | M V30 24 H -2.6717 -2.4017 -1.3181 0 32 | M V30 END ATOM 33 | M V30 BEGIN BOND 34 | M V30 1 1 1 2 35 | M V30 2 1 2 3 36 | M V30 3 2 3 4 37 | M V30 4 1 4 5 38 | M V30 5 2 5 6 39 | M V30 6 1 6 7 40 | M V30 7 2 7 8 41 | M V30 8 1 7 9 42 | M V30 9 1 9 10 43 | M V30 10 2 10 11 44 | M V30 11 1 10 12 45 | M V30 12 1 12 13 46 | M V30 13 1 9 14 47 | M V30 14 1 6 2 48 | M V30 15 1 12 5 49 | M V30 16 1 1 15 50 | M V30 17 1 1 16 51 | M V30 18 1 1 17 52 | M V30 19 1 3 18 53 | M V30 20 1 13 19 54 | M V30 21 1 13 20 55 | M V30 22 1 13 21 56 | M V30 23 1 14 22 57 | M V30 24 1 14 23 58 | M V30 25 1 14 24 59 | M V30 END BOND 60 | M V30 END CTAB 61 | M END 62 | 63 | $$$$ 64 | -------------------------------------------------------------------------------- /examples/aligner_directory/aligned_2.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 10 10 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -0.5020 -1.0239 0.1056 0 9 | M V30 2 C -1.0291 0.0988 0.7435 0 10 | M V30 3 N -0.4190 1.3051 0.6062 0 11 | M V30 4 C 0.7041 1.4359 -0.1480 0 12 | M V30 5 N 1.2320 0.3529 -0.7771 0 13 | M V30 6 C 0.6509 -0.8701 -0.6640 0 14 | M V30 7 H -0.9765 -1.9915 0.2053 0 15 | M V30 8 H -1.9224 0.0120 1.3475 0 16 | M V30 9 H 1.1781 2.4026 -0.2477 0 17 | M V30 10 H 1.0840 -1.7219 -1.1713 0 18 | M V30 END ATOM 19 | M V30 BEGIN BOND 20 | M V30 1 2 1 2 21 | M V30 2 1 2 3 22 | M V30 3 2 3 4 23 | M V30 4 1 4 5 24 | M V30 5 2 5 6 25 | M V30 6 1 6 1 26 | M V30 7 1 1 7 27 | M V30 8 1 2 8 28 | M V30 9 1 4 9 29 | M V30 10 1 6 10 30 | M V30 END BOND 31 | M V30 END CTAB 32 | M END 33 | 34 | $$$$ 35 | -------------------------------------------------------------------------------- /examples/aligner_directory/aligned_3.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 12 12 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 1.3462 -0.3789 -0.0405 0 9 | M V30 2 C 0.3460 -1.3555 0.0166 0 10 | M V30 3 C -1.0002 -0.9766 0.0571 0 11 | M V30 4 C -1.3462 0.3789 0.0405 0 12 | M V30 5 C -0.3460 1.3555 -0.0166 0 13 | M V30 6 C 1.0002 0.9766 -0.0571 0 14 | M V30 7 H 2.3876 -0.6720 -0.0718 0 15 | M V30 8 H 0.6137 -2.4041 0.0295 0 16 | M V30 9 H -1.7739 -1.7321 0.1012 0 17 | M V30 10 H -2.3876 0.6720 0.0718 0 18 | M V30 11 H -0.6137 2.4041 -0.0295 0 19 | M V30 12 H 1.7739 1.7321 -0.1012 0 20 | M V30 END ATOM 21 | M V30 BEGIN BOND 22 | M V30 1 2 1 2 23 | M V30 2 1 2 3 24 | M V30 3 2 3 4 25 | M V30 4 1 4 5 26 | M V30 5 2 5 6 27 | M V30 6 1 6 1 28 | M V30 7 1 1 7 29 | M V30 8 1 2 8 30 | M V30 9 1 3 9 31 | M V30 10 1 4 10 32 | M V30 11 1 5 11 33 | M V30 12 1 6 12 34 | M V30 END BOND 35 | M V30 END CTAB 36 | M END 37 | 38 | $$$$ 39 | -------------------------------------------------------------------------------- /examples/aligner_directory/aligned_4.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 18 18 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 0.2885 1.4424 0.1522 0 9 | M V30 2 C 1.3591 0.4657 -0.3507 0 10 | M V30 3 C 1.1192 -0.9456 0.2006 0 11 | M V30 4 C -0.2885 -1.4424 -0.1522 0 12 | M V30 5 C -1.3591 -0.4657 0.3507 0 13 | M V30 6 C -1.1192 0.9456 -0.2006 0 14 | M V30 7 H 0.4532 2.4384 -0.3124 0 15 | M V30 8 H 0.3779 1.5595 1.2547 0 16 | M V30 9 H 2.3610 0.8208 -0.0267 0 17 | M V30 10 H 1.3479 0.4392 -1.4626 0 18 | M V30 11 H 1.2481 -0.9419 1.3054 0 19 | M V30 12 H 1.8721 -1.6404 -0.2297 0 20 | M V30 13 H -0.3779 -1.5595 -1.2547 0 21 | M V30 14 H -0.4532 -2.4384 0.3124 0 22 | M V30 15 H -2.3610 -0.8208 0.0267 0 23 | M V30 16 H -1.3479 -0.4392 1.4626 0 24 | M V30 17 H -1.8721 1.6404 0.2297 0 25 | M V30 18 H -1.2481 0.9419 -1.3054 0 26 | M V30 END ATOM 27 | M V30 BEGIN BOND 28 | M V30 1 1 1 2 29 | M V30 2 1 2 3 30 | M V30 3 1 3 4 31 | M V30 4 1 4 5 32 | M V30 5 1 5 6 33 | M V30 6 1 6 1 34 | M V30 7 1 1 7 35 | M V30 8 1 1 8 36 | M V30 9 1 2 9 37 | M V30 10 1 2 10 38 | M V30 11 1 3 11 39 | M V30 12 1 3 12 40 | M V30 13 1 4 13 41 | M V30 14 1 4 14 42 | M V30 15 1 5 15 43 | M V30 16 1 5 16 44 | M V30 17 1 6 17 45 | M V30 18 1 6 18 46 | M V30 END BOND 47 | M V30 END CTAB 48 | M END 49 | 50 | $$$$ 51 | -------------------------------------------------------------------------------- /examples/aligner_directory/init_0.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 20 19 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 N -0.5022 2.7072 -1.0118 0 9 | M V30 2 C 0.8820 2.3474 -0.6384 0 10 | M V30 3 C 0.7529 1.1807 0.3612 0 11 | M V30 4 N 0.1369 0.0957 -0.3496 0 12 | M V30 5 C -0.2542 -1.0102 0.4388 0 13 | M V30 6 C -0.5435 -2.1840 -0.4700 0 14 | M V30 7 N -0.9603 -3.3283 0.3320 0 15 | M V30 8 H -0.6166 3.7299 -0.8680 0 16 | M V30 9 H -1.1986 2.2683 -0.3276 0 17 | M V30 10 H 1.4452 3.1852 -0.2033 0 18 | M V30 11 H 1.4070 2.0241 -1.5567 0 19 | M V30 12 H 0.1035 1.4782 1.2070 0 20 | M V30 13 H 1.7630 0.8733 0.7342 0 21 | M V30 14 H 0.4975 -0.0253 -1.2794 0 22 | M V30 15 H 0.4821 -1.2256 1.2467 0 23 | M V30 16 H -1.2502 -0.7116 0.9372 0 24 | M V30 17 H 0.4401 -2.4071 -0.9943 0 25 | M V30 18 H -1.2779 -1.8821 -1.2209 0 26 | M V30 19 H -0.1748 -4.0489 0.3774 0 27 | M V30 20 H -1.1318 -3.0670 1.3145 0 28 | M V30 END ATOM 29 | M V30 BEGIN BOND 30 | M V30 1 1 1 2 31 | M V30 2 1 2 3 32 | M V30 3 1 3 4 33 | M V30 4 1 4 5 34 | M V30 5 1 5 6 35 | M V30 6 1 6 7 36 | M V30 7 1 1 8 37 | M V30 8 1 1 9 38 | M V30 9 1 2 10 39 | M V30 10 1 2 11 40 | M V30 11 1 3 12 41 | M V30 12 1 3 13 42 | M V30 13 1 4 14 43 | M V30 14 1 5 15 44 | M V30 15 1 5 16 45 | M V30 16 1 6 17 46 | M V30 17 1 6 18 47 | M V30 18 1 7 19 48 | M V30 19 1 7 20 49 | M V30 END BOND 50 | M V30 END CTAB 51 | M END 52 | 53 | $$$$ 54 | -------------------------------------------------------------------------------- /examples/aligner_directory/init_1.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 24 25 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -0.2887 3.2678 0.0693 0 9 | M V30 2 N 0.5257 2.0722 0.1389 0 10 | M V30 3 C 1.8360 2.0703 0.3201 0 11 | M V30 4 N 2.2177 0.7815 0.3265 0 12 | M V30 5 C 1.1390 -0.0059 0.1488 0 13 | M V30 6 C 0.0497 0.8336 0.0283 0 14 | M V30 7 C -1.1874 0.2482 -0.1640 0 15 | M V30 8 O -2.1875 1.0023 -0.2752 0 16 | M V30 9 N -1.3458 -1.0852 -0.2341 0 17 | M V30 10 C -0.2485 -1.8464 -0.1097 0 18 | M V30 11 O -0.3719 -3.0831 -0.1714 0 19 | M V30 12 N 0.9809 -1.3417 0.0787 0 20 | M V30 13 C 2.1377 -2.2084 0.2074 0 21 | M V30 14 C -2.6634 -1.6577 -0.4371 0 22 | M V30 15 H -0.2146 3.7838 -0.9065 0 23 | M V30 16 H -1.3411 3.1011 0.3101 0 24 | M V30 17 H 0.0921 3.9979 0.8422 0 25 | M V30 18 H 2.4901 2.9358 0.4419 0 26 | M V30 19 H 2.9731 -1.6831 0.7269 0 27 | M V30 20 H 2.5216 -2.5614 -0.7509 0 28 | M V30 21 H 1.8867 -3.0967 0.8571 0 29 | M V30 22 H -3.3332 -0.9537 -0.9693 0 30 | M V30 23 H -3.0995 -1.9823 0.5514 0 31 | M V30 24 H -2.5687 -2.5888 -1.0294 0 32 | M V30 END ATOM 33 | M V30 BEGIN BOND 34 | M V30 1 1 1 2 35 | M V30 2 1 2 3 36 | M V30 3 2 3 4 37 | M V30 4 1 4 5 38 | M V30 5 2 5 6 39 | M V30 6 1 6 7 40 | M V30 7 2 7 8 41 | M V30 8 1 7 9 42 | M V30 9 1 9 10 43 | M V30 10 2 10 11 44 | M V30 11 1 10 12 45 | M V30 12 1 12 13 46 | M V30 13 1 9 14 47 | M V30 14 1 6 2 48 | M V30 15 1 12 5 49 | M V30 16 1 1 15 50 | M V30 17 1 1 16 51 | M V30 18 1 1 17 52 | M V30 19 1 3 18 53 | M V30 20 1 13 19 54 | M V30 21 1 13 20 55 | M V30 22 1 13 21 56 | M V30 23 1 14 22 57 | M V30 24 1 14 23 58 | M V30 25 1 14 24 59 | M V30 END BOND 60 | M V30 END CTAB 61 | M END 62 | 63 | $$$$ 64 | -------------------------------------------------------------------------------- /examples/aligner_directory/init_2.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 10 10 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -0.4892 -1.0392 0.1462 0 9 | M V30 2 C 0.5525 -0.8430 -0.7378 0 10 | M V30 3 N 1.0994 0.3775 -0.8845 0 11 | M V30 4 C 0.6960 1.4669 -0.2113 0 12 | M V30 5 N -0.3186 1.2845 0.6522 0 13 | M V30 6 C -0.9026 0.0821 0.8375 0 14 | M V30 7 H -0.9672 -1.9944 0.3061 0 15 | M V30 8 H 0.8950 -1.7138 -1.2941 0 16 | M V30 9 H 1.1615 2.4456 -0.3532 0 17 | M V30 10 H -1.7268 -0.0662 1.5389 0 18 | M V30 END ATOM 19 | M V30 BEGIN BOND 20 | M V30 1 2 1 2 21 | M V30 2 1 2 3 22 | M V30 3 2 3 4 23 | M V30 4 1 4 5 24 | M V30 5 2 5 6 25 | M V30 6 1 6 1 26 | M V30 7 1 1 7 27 | M V30 8 1 2 8 28 | M V30 9 1 4 9 29 | M V30 10 1 6 10 30 | M V30 END BOND 31 | M V30 END CTAB 32 | M END 33 | 34 | $$$$ 35 | -------------------------------------------------------------------------------- /examples/aligner_directory/init_3.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 12 12 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -1.2900 0.4457 -0.0182 0 9 | M V30 2 C -0.2857 1.3824 -0.0099 0 10 | M V30 3 C 1.0256 0.9229 0.0086 0 11 | M V30 4 C 1.2895 -0.4500 0.0182 0 12 | M V30 5 C 0.2682 -1.3782 0.0097 0 13 | M V30 6 C -1.0227 -0.8950 -0.0087 0 14 | M V30 7 H -2.3380 0.7609 -0.0328 0 15 | M V30 8 H -0.4726 2.4419 -0.0172 0 16 | M V30 9 H 1.8617 1.6067 0.0159 0 17 | M V30 10 H 2.3296 -0.7883 0.0328 0 18 | M V30 11 H 0.4792 -2.4519 0.0173 0 19 | M V30 12 H -1.8448 -1.5971 -0.0158 0 20 | M V30 END ATOM 21 | M V30 BEGIN BOND 22 | M V30 1 2 1 2 23 | M V30 2 1 2 3 24 | M V30 3 2 3 4 25 | M V30 4 1 4 5 26 | M V30 5 2 5 6 27 | M V30 6 1 6 1 28 | M V30 7 1 1 7 29 | M V30 8 1 2 8 30 | M V30 9 1 3 9 31 | M V30 10 1 4 10 32 | M V30 11 1 5 11 33 | M V30 12 1 6 12 34 | M V30 END BOND 35 | M V30 END CTAB 36 | M END 37 | 38 | $$$$ 39 | -------------------------------------------------------------------------------- /examples/aligner_directory/init_4.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 18 18 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 0.1922 1.4399 0.0749 0 9 | M V30 2 C 1.3223 0.4613 -0.1316 0 10 | M V30 3 C 1.0533 -0.8809 0.4766 0 11 | M V30 4 C -0.2159 -1.4317 -0.1427 0 12 | M V30 5 C -1.3377 -0.4795 0.2880 0 13 | M V30 6 C -1.0799 0.8201 -0.4718 0 14 | M V30 7 H 0.4272 2.3236 -0.5878 0 15 | M V30 8 H 0.0892 1.7762 1.1147 0 16 | M V30 9 H 2.2350 0.9274 0.2766 0 17 | M V30 10 H 1.4340 0.3407 -1.2376 0 18 | M V30 11 H 0.8857 -0.8104 1.5608 0 19 | M V30 12 H 1.9292 -1.5181 0.3136 0 20 | M V30 13 H -0.1920 -1.3799 -1.2601 0 21 | M V30 14 H -0.4571 -2.4474 0.2243 0 22 | M V30 15 H -2.3285 -0.8910 0.1012 0 23 | M V30 16 H -1.1745 -0.2628 1.3568 0 24 | M V30 17 H -1.9425 1.4904 -0.4289 0 25 | M V30 18 H -0.8401 0.5221 -1.5272 0 26 | M V30 END ATOM 27 | M V30 BEGIN BOND 28 | M V30 1 1 1 2 29 | M V30 2 1 2 3 30 | M V30 3 1 3 4 31 | M V30 4 1 4 5 32 | M V30 5 1 5 6 33 | M V30 6 1 6 1 34 | M V30 7 1 1 7 35 | M V30 8 1 1 8 36 | M V30 9 1 2 9 37 | M V30 10 1 2 10 38 | M V30 11 1 3 11 39 | M V30 12 1 3 12 40 | M V30 13 1 4 13 41 | M V30 14 1 4 14 42 | M V30 15 1 5 15 43 | M V30 16 1 5 16 44 | M V30 17 1 6 17 45 | M V30 18 1 6 18 46 | M V30 END BOND 47 | M V30 END CTAB 48 | M END 49 | 50 | $$$$ 51 | -------------------------------------------------------------------------------- /examples/aligner_directory/unaligned_0.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 20 19 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 N 2.5205 1.1082 -1.0118 0 9 | M V30 2 C 2.4869 -0.3216 -0.6384 0 10 | M V30 3 C 1.3217 -0.4629 0.3612 0 11 | M V30 4 N 0.1245 -0.1114 -0.3496 0 12 | M V30 5 C -1.0415 0.0164 0.4388 0 13 | M V30 6 C -2.2504 0.0295 -0.4700 0 14 | M V30 7 N -3.4597 0.1735 0.3320 0 15 | M V30 8 H 3.4899 1.4535 -0.8680 0 16 | M V30 9 H 1.9339 1.6857 -0.3276 0 17 | M V30 10 H 3.4314 -0.6783 -0.2033 0 18 | M V30 11 H 2.2923 -0.9067 -1.5567 0 19 | M V30 12 H 1.4627 0.2374 1.2070 0 20 | M V30 13 H 1.2535 -1.5165 0.7342 0 21 | M V30 14 H 0.0892 -0.4900 -1.2794 0 22 | M V30 15 H -1.0829 -0.7497 1.2467 0 23 | M V30 16 H -0.9787 1.0543 0.9372 0 24 | M V30 17 H -2.2426 -0.9790 -0.9943 0 25 | M V30 18 H -2.1245 0.8135 -1.2209 0 26 | M V30 19 H -3.9816 -0.7560 0.3774 0 27 | M V30 20 H -3.2446 0.4002 1.3145 0 28 | M V30 END ATOM 29 | M V30 BEGIN BOND 30 | M V30 1 1 1 2 31 | M V30 2 1 2 3 32 | M V30 3 1 3 4 33 | M V30 4 1 4 5 34 | M V30 5 1 5 6 35 | M V30 6 1 6 7 36 | M V30 7 1 1 8 37 | M V30 8 1 1 9 38 | M V30 9 1 2 10 39 | M V30 10 1 2 11 40 | M V30 11 1 3 12 41 | M V30 12 1 3 13 42 | M V30 13 1 4 14 43 | M V30 14 1 5 15 44 | M V30 15 1 5 16 45 | M V30 16 1 6 17 46 | M V30 17 1 6 18 47 | M V30 18 1 7 19 48 | M V30 19 1 7 20 49 | M V30 END BOND 50 | M V30 END CTAB 51 | M END 52 | 53 | $$$$ 54 | -------------------------------------------------------------------------------- /examples/aligner_directory/unaligned_1.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 24 25 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 3.1151 1.0285 0.0693 0 9 | M V30 2 N 2.1375 -0.0378 0.1389 0 10 | M V30 3 C 2.4354 -1.3137 0.3201 0 11 | M V30 4 N 1.2680 -1.9801 0.3265 0 12 | M V30 5 C 0.2548 -1.1102 0.1488 0 13 | M V30 6 C 0.8229 0.1423 0.0283 0 14 | M V30 7 C -0.0300 1.2127 -0.1640 0 15 | M V30 8 O 0.4753 2.3587 -0.2752 0 16 | M V30 9 N -1.3643 1.0619 -0.2341 0 17 | M V30 10 C -1.8543 -0.1804 -0.1097 0 18 | M V30 11 O -3.0864 -0.3432 -0.1714 0 19 | M V30 12 N -1.0817 -1.2619 0.0787 0 20 | M V30 13 C -1.6609 -2.5862 0.2074 0 21 | M V30 14 C -2.2230 2.2136 -0.4371 0 22 | M V30 15 H 3.6344 1.0744 -0.9065 0 23 | M V30 16 H 2.7121 2.0150 0.3101 0 24 | M V30 17 H 3.9129 0.8249 0.8422 0 25 | M V30 18 H 3.4276 -1.7524 0.4419 0 26 | M V30 19 H -0.9584 -3.2793 0.7269 0 27 | M V30 20 H -1.9167 -3.0407 -0.7509 0 28 | M V30 21 H -2.5830 -2.5451 0.8571 0 29 | M V30 22 H -1.6909 3.0267 -0.9693 0 30 | M V30 23 H -2.6388 2.5639 0.5514 0 31 | M V30 24 H -3.1078 1.9084 -1.0294 0 32 | M V30 END ATOM 33 | M V30 BEGIN BOND 34 | M V30 1 1 1 2 35 | M V30 2 1 2 3 36 | M V30 3 2 3 4 37 | M V30 4 1 4 5 38 | M V30 5 2 5 6 39 | M V30 6 1 6 7 40 | M V30 7 2 7 8 41 | M V30 8 1 7 9 42 | M V30 9 1 9 10 43 | M V30 10 2 10 11 44 | M V30 11 1 10 12 45 | M V30 12 1 12 13 46 | M V30 13 1 9 14 47 | M V30 14 1 6 2 48 | M V30 15 1 12 5 49 | M V30 16 1 1 15 50 | M V30 17 1 1 16 51 | M V30 18 1 1 17 52 | M V30 19 1 3 18 53 | M V30 20 1 13 19 54 | M V30 21 1 13 20 55 | M V30 22 1 13 21 56 | M V30 23 1 14 22 57 | M V30 24 1 14 23 58 | M V30 25 1 14 24 59 | M V30 END BOND 60 | M V30 END CTAB 61 | M END 62 | 63 | $$$$ 64 | -------------------------------------------------------------------------------- /examples/aligner_directory/unaligned_2.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 10 10 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -1.1235 0.2385 0.1462 0 9 | M V30 2 C -0.6942 -0.7307 -0.7378 0 10 | M V30 3 N 0.6190 -0.9839 -0.8845 0 11 | M V30 4 C 1.5872 -0.3420 -0.2113 0 12 | M V30 5 N 1.1776 0.6040 0.6522 0 13 | M V30 6 C -0.1266 0.8974 0.8375 0 14 | M V30 7 H -2.1628 0.4854 0.3061 0 15 | M V30 8 H -1.4636 -1.2633 -1.2941 0 16 | M V30 9 H 2.6464 -0.5713 -0.3532 0 17 | M V30 10 H -0.4595 1.6659 1.5389 0 18 | M V30 END ATOM 19 | M V30 BEGIN BOND 20 | M V30 1 2 1 2 21 | M V30 2 1 2 3 22 | M V30 3 2 3 4 23 | M V30 4 1 4 5 24 | M V30 5 2 5 6 25 | M V30 6 1 6 1 26 | M V30 7 1 1 7 27 | M V30 8 1 2 8 28 | M V30 9 1 4 9 29 | M V30 10 1 6 10 30 | M V30 END BOND 31 | M V30 END CTAB 32 | M END 33 | 34 | $$$$ 35 | -------------------------------------------------------------------------------- /examples/aligner_directory/unaligned_3.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 12 12 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 0.1388 1.3577 -0.0182 0 9 | M V30 2 C 1.2804 0.5943 -0.0099 0 10 | M V30 3 C 1.1331 -0.7873 0.0086 0 11 | M V30 4 C -0.1431 -1.3583 0.0182 0 12 | M V30 5 C -1.2803 -0.5763 0.0097 0 13 | M V30 6 C -1.1052 0.7908 -0.0087 0 14 | M V30 7 H 0.2059 2.4501 -0.0328 0 15 | M V30 8 H 2.2690 1.0187 -0.0172 0 16 | M V30 9 H 1.9900 -1.4448 0.0159 0 17 | M V30 10 H -0.2345 -2.4482 0.0328 0 18 | M V30 11 H -2.2773 -1.0274 0.0173 0 19 | M V30 12 H -1.9768 1.4306 -0.0158 0 20 | M V30 END ATOM 21 | M V30 BEGIN BOND 22 | M V30 1 2 1 2 23 | M V30 2 1 2 3 24 | M V30 3 2 3 4 25 | M V30 4 1 4 5 26 | M V30 5 2 5 6 27 | M V30 6 1 6 1 28 | M V30 7 1 1 7 29 | M V30 8 1 2 8 30 | M V30 9 1 3 9 31 | M V30 10 1 4 10 32 | M V30 11 1 5 11 33 | M V30 12 1 6 12 34 | M V30 END BOND 35 | M V30 END CTAB 36 | M END 37 | 38 | $$$$ 39 | -------------------------------------------------------------------------------- /examples/aligner_directory/unaligned_4.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 18 18 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 1.4457 0.1423 0.0749 0 9 | M V30 2 C 0.7515 -1.1817 -0.1316 0 10 | M V30 3 C -0.6166 -1.2269 0.4766 0 11 | M V30 4 C -1.4431 -0.1174 -0.1427 0 12 | M V30 5 C -0.7728 1.1925 0.2880 0 13 | M V30 6 C 0.5513 1.2389 -0.4718 0 14 | M V30 7 H 2.3597 0.1157 -0.5878 0 15 | M V30 8 H 1.7495 0.3195 1.1147 0 16 | M V30 9 H 1.4140 -1.9636 0.2766 0 17 | M V30 10 H 0.6597 -1.3181 -1.2376 0 18 | M V30 11 H -0.5863 -1.0476 1.5608 0 19 | M V30 12 H -1.0365 -2.2253 0.3136 0 20 | M V30 13 H -1.3872 -0.1288 -1.2601 0 21 | M V30 14 H -2.4870 -0.1148 0.2243 0 22 | M V30 15 H -1.4000 2.0629 0.1012 0 23 | M V30 16 H -0.5245 1.0832 1.3568 0 24 | M V30 17 H 1.0065 2.2319 -0.4289 0 25 | M V30 18 H 0.3161 0.9372 -1.5272 0 26 | M V30 END ATOM 27 | M V30 BEGIN BOND 28 | M V30 1 1 1 2 29 | M V30 2 1 2 3 30 | M V30 3 1 3 4 31 | M V30 4 1 4 5 32 | M V30 5 1 5 6 33 | M V30 6 1 6 1 34 | M V30 7 1 1 7 35 | M V30 8 1 1 8 36 | M V30 9 1 2 9 37 | M V30 10 1 2 10 38 | M V30 11 1 3 11 39 | M V30 12 1 3 12 40 | M V30 13 1 4 13 41 | M V30 14 1 4 14 42 | M V30 15 1 5 15 43 | M V30 16 1 5 16 44 | M V30 17 1 6 17 45 | M V30 18 1 6 18 46 | M V30 END BOND 47 | M V30 END CTAB 48 | M END 49 | 50 | $$$$ 51 | -------------------------------------------------------------------------------- /examples/basic_example.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | import stk 4 | 5 | import stko 6 | 7 | 8 | def main() -> None: 9 | """Run the example.""" 10 | bb1 = stk.BuildingBlock("NCCNCCN", [stk.PrimaryAminoFactory()]) 11 | bb2 = stk.BuildingBlock("O=CCCC=O", [stk.AldehydeFactory()]) 12 | polymer = stk.ConstructedMolecule( 13 | stk.polymer.Linear( 14 | building_blocks=(bb1, bb2), 15 | repeating_unit="AB", 16 | orientations=(0, 0), 17 | num_repeating_units=1, 18 | ) 19 | ) 20 | 21 | examples_output = Path("output_directory") 22 | examples_output.mkdir(parents=True, exist_ok=True) 23 | 24 | # Run optimisations. 25 | uff = stko.UFF() 26 | polymer = uff.optimize(polymer) 27 | polymer.write(examples_output / "poly_uff.mol") 28 | mmff = stko.MMFF() 29 | polymer = mmff.optimize(polymer) 30 | polymer.write(examples_output / "poly_mmff.mol") 31 | etkdg = stko.ETKDG() 32 | polymer = etkdg.optimize(polymer) 33 | polymer.write(examples_output / "poly_etkdg.mol") 34 | 35 | 36 | if __name__ == "__main__": 37 | main() 38 | -------------------------------------------------------------------------------- /examples/cage_output/apdcage_0.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 30 32 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 9.9449 2.8186 1.0197 0 9 | M V30 2 N 9.1674 1.8922 0.4130 0 10 | M V30 3 C 8.0328 2.3049 -0.1802 0 11 | M V30 4 C 7.6455 3.6313 -0.1866 0 12 | M V30 5 C 8.4342 4.5793 0.4302 0 13 | M V30 6 C 8.0225 5.9809 0.4220 0 14 | M V30 7 C 8.9515 6.9996 0.4207 0 15 | M V30 8 C 8.5783 8.3421 0.4126 0 16 | M V30 9 C 7.2427 8.6895 0.4055 0 17 | M V30 10 C 6.2894 7.6916 0.4066 0 18 | M V30 11 C 4.8897 8.0613 0.3984 0 19 | M V30 12 C 3.9521 7.2626 -0.2104 0 20 | M V30 13 C 2.6376 7.6701 -0.1836 0 21 | M V30 14 N 2.2472 8.8124 0.4130 0 22 | M V30 15 C 3.1504 9.6056 1.0133 0 23 | M V30 16 C 4.4561 9.2233 0.9997 0 24 | M V30 17 C 6.6883 6.3537 0.4149 0 25 | M V30 18 C 9.5970 4.1531 1.0376 0 26 | M V30 19 H 10.8549 2.4421 1.4881 0 27 | M V30 20 H 7.3651 1.5911 -0.6878 0 28 | M V30 21 H 6.7328 3.9742 -0.6611 0 29 | M V30 22 H 10.0072 6.7403 0.4262 0 30 | M V30 23 H 9.3252 9.1202 0.4118 0 31 | M V30 24 H 6.9262 9.7338 0.3991 0 32 | M V30 25 H 4.2119 6.3255 -0.7094 0 33 | M V30 26 H 1.8795 7.0441 -0.6641 0 34 | M V30 27 H 2.8161 10.5336 1.4950 0 35 | M V30 28 H 5.1616 9.8958 1.4988 0 36 | M V30 29 H 5.9522 5.5794 0.4157 0 37 | M V30 30 H 10.2510 4.8407 1.5325 0 38 | M V30 END ATOM 39 | M V30 BEGIN BOND 40 | M V30 1 2 1 2 41 | M V30 2 1 2 3 42 | M V30 3 2 3 4 43 | M V30 4 1 4 5 44 | M V30 5 1 5 6 45 | M V30 6 2 6 7 46 | M V30 7 1 7 8 47 | M V30 8 2 8 9 48 | M V30 9 1 9 10 49 | M V30 10 1 10 11 50 | M V30 11 2 11 12 51 | M V30 12 1 12 13 52 | M V30 13 2 13 14 53 | M V30 14 1 14 15 54 | M V30 15 2 15 16 55 | M V30 16 2 10 17 56 | M V30 17 2 5 18 57 | M V30 18 1 18 1 58 | M V30 19 1 17 6 59 | M V30 20 1 16 11 60 | M V30 21 1 1 19 61 | M V30 22 1 3 20 62 | M V30 23 1 4 21 63 | M V30 24 1 7 22 64 | M V30 25 1 8 23 65 | M V30 26 1 9 24 66 | M V30 27 1 12 25 67 | M V30 28 1 13 26 68 | M V30 29 1 15 27 69 | M V30 30 1 16 28 70 | M V30 31 1 17 29 71 | M V30 32 1 18 30 72 | M V30 END BOND 73 | M V30 END CTAB 74 | M END 75 | 76 | $$$$ 77 | -------------------------------------------------------------------------------- /examples/cage_output/apdcage_1.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 30 32 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 9.8467 -2.8185 -0.0805 0 9 | M V30 2 N 9.0691 -1.8922 0.5261 0 10 | M V30 3 C 7.9346 -2.3048 1.1193 0 11 | M V30 4 C 7.5473 -3.6313 1.1257 0 12 | M V30 5 C 8.3360 -4.5792 0.5090 0 13 | M V30 6 C 7.9243 -5.9809 0.5171 0 14 | M V30 7 C 8.8532 -6.9995 0.5184 0 15 | M V30 8 C 8.4801 -8.3421 0.5265 0 16 | M V30 9 C 7.1445 -8.6895 0.5336 0 17 | M V30 10 C 6.1912 -7.6915 0.5325 0 18 | M V30 11 C 4.7915 -8.0612 0.5407 0 19 | M V30 12 C 3.8539 -7.2626 1.1496 0 20 | M V30 13 C 2.5394 -7.6701 1.1228 0 21 | M V30 14 N 2.1490 -8.8124 0.5261 0 22 | M V30 15 C 3.0521 -9.6055 -0.0742 0 23 | M V30 16 C 4.3579 -9.2232 -0.0605 0 24 | M V30 17 C 6.5901 -6.3537 0.5243 0 25 | M V30 18 C 9.4988 -4.1531 -0.0985 0 26 | M V30 19 H 10.7567 -2.4421 -0.5489 0 27 | M V30 20 H 7.2669 -1.5910 1.6270 0 28 | M V30 21 H 6.6346 -3.9742 1.6003 0 29 | M V30 22 H 9.9090 -6.7402 0.5129 0 30 | M V30 23 H 9.2270 -9.1202 0.5273 0 31 | M V30 24 H 6.8280 -9.7337 0.5400 0 32 | M V30 25 H 4.1137 -6.3255 1.6486 0 33 | M V30 26 H 1.7813 -7.0441 1.6033 0 34 | M V30 27 H 2.7178 -10.5335 -0.5559 0 35 | M V30 28 H 5.0633 -9.8957 -0.5597 0 36 | M V30 29 H 5.8539 -5.5794 0.5235 0 37 | M V30 30 H 10.1527 -4.8406 -0.5934 0 38 | M V30 END ATOM 39 | M V30 BEGIN BOND 40 | M V30 1 2 1 2 41 | M V30 2 1 2 3 42 | M V30 3 2 3 4 43 | M V30 4 1 4 5 44 | M V30 5 1 5 6 45 | M V30 6 2 6 7 46 | M V30 7 1 7 8 47 | M V30 8 2 8 9 48 | M V30 9 1 9 10 49 | M V30 10 1 10 11 50 | M V30 11 2 11 12 51 | M V30 12 1 12 13 52 | M V30 13 2 13 14 53 | M V30 14 1 14 15 54 | M V30 15 2 15 16 55 | M V30 16 2 10 17 56 | M V30 17 2 5 18 57 | M V30 18 1 18 1 58 | M V30 19 1 17 6 59 | M V30 20 1 16 11 60 | M V30 21 1 1 19 61 | M V30 22 1 3 20 62 | M V30 23 1 4 21 63 | M V30 24 1 7 22 64 | M V30 25 1 8 23 65 | M V30 26 1 9 24 66 | M V30 27 1 12 25 67 | M V30 28 1 13 26 68 | M V30 29 1 15 27 69 | M V30 30 1 16 28 70 | M V30 31 1 17 29 71 | M V30 32 1 18 30 72 | M V30 END BOND 73 | M V30 END CTAB 74 | M END 75 | 76 | $$$$ 77 | -------------------------------------------------------------------------------- /examples/cage_output/apdcage_2.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 30 32 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 9.7847 -0.5290 3.5671 0 9 | M V30 2 N 9.0072 0.0776 2.6407 0 10 | M V30 3 C 7.8726 0.6709 3.0534 0 11 | M V30 4 C 7.4853 0.6773 4.3798 0 12 | M V30 5 C 8.2740 0.0605 5.3278 0 13 | M V30 6 C 7.8623 0.0687 6.7294 0 14 | M V30 7 C 8.7913 0.0700 7.7481 0 15 | M V30 8 C 8.4181 0.0781 9.0906 0 16 | M V30 9 C 7.0825 0.0852 9.4380 0 17 | M V30 10 C 6.1292 0.0841 8.4401 0 18 | M V30 11 C 4.7295 0.0923 8.8098 0 19 | M V30 12 C 3.7919 0.7011 8.0111 0 20 | M V30 13 C 2.4774 0.6743 8.4186 0 21 | M V30 14 N 2.0870 0.0776 9.5609 0 22 | M V30 15 C 2.9902 -0.5226 10.3541 0 23 | M V30 16 C 4.2959 -0.5090 9.9718 0 24 | M V30 17 C 6.5281 0.0758 7.1022 0 25 | M V30 18 C 9.4368 -0.5469 4.9016 0 26 | M V30 19 H 10.6947 -0.9974 3.1907 0 27 | M V30 20 H 7.2049 1.1785 2.3396 0 28 | M V30 21 H 6.5726 1.1518 4.7227 0 29 | M V30 22 H 9.8470 0.0645 7.4888 0 30 | M V30 23 H 9.1650 0.0789 9.8687 0 31 | M V30 24 H 6.7660 0.0916 10.4823 0 32 | M V30 25 H 4.0517 1.2001 7.0740 0 33 | M V30 26 H 1.7193 1.1548 7.7926 0 34 | M V30 27 H 2.6558 -1.0043 11.2821 0 35 | M V30 28 H 5.0014 -1.0081 10.6443 0 36 | M V30 29 H 5.7919 0.0750 6.3279 0 37 | M V30 30 H 10.0907 -1.0418 5.5892 0 38 | M V30 END ATOM 39 | M V30 BEGIN BOND 40 | M V30 1 2 1 2 41 | M V30 2 1 2 3 42 | M V30 3 2 3 4 43 | M V30 4 1 4 5 44 | M V30 5 1 5 6 45 | M V30 6 2 6 7 46 | M V30 7 1 7 8 47 | M V30 8 2 8 9 48 | M V30 9 1 9 10 49 | M V30 10 1 10 11 50 | M V30 11 2 11 12 51 | M V30 12 1 12 13 52 | M V30 13 2 13 14 53 | M V30 14 1 14 15 54 | M V30 15 2 15 16 55 | M V30 16 2 10 17 56 | M V30 17 2 5 18 57 | M V30 18 1 18 1 58 | M V30 19 1 17 6 59 | M V30 20 1 16 11 60 | M V30 21 1 1 19 61 | M V30 22 1 3 20 62 | M V30 23 1 4 21 63 | M V30 24 1 7 22 64 | M V30 25 1 8 23 65 | M V30 26 1 9 24 66 | M V30 27 1 12 25 67 | M V30 28 1 13 26 68 | M V30 29 1 15 27 69 | M V30 30 1 16 28 70 | M V30 31 1 17 29 71 | M V30 32 1 18 30 72 | M V30 END BOND 73 | M V30 END CTAB 74 | M END 75 | 76 | $$$$ 77 | -------------------------------------------------------------------------------- /examples/cage_output/apdcage_8.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 30 32 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 0.6569 10.0349 3.1107 0 9 | M V30 2 N 0.0503 9.2573 2.1844 0 10 | M V30 3 C -0.5430 8.1227 2.5970 0 11 | M V30 4 C -0.5494 7.7354 3.9235 0 12 | M V30 5 C 0.0674 8.5241 4.8714 0 13 | M V30 6 C 0.0592 8.1124 6.2731 0 14 | M V30 7 C 0.0579 9.0414 7.2918 0 15 | M V30 8 C 0.0498 8.6682 8.6343 0 16 | M V30 9 C 0.0428 7.3327 8.9817 0 17 | M V30 10 C 0.0439 6.3793 7.9837 0 18 | M V30 11 C 0.0356 4.9796 8.3534 0 19 | M V30 12 C -0.5732 4.0420 7.5548 0 20 | M V30 13 C -0.5464 2.7275 7.9623 0 21 | M V30 14 N 0.0503 2.3371 9.1046 0 22 | M V30 15 C 0.6506 3.2403 9.8977 0 23 | M V30 16 C 0.6369 4.5460 9.5154 0 24 | M V30 17 C 0.0521 6.7782 6.6459 0 25 | M V30 18 C 0.6748 9.6869 4.4453 0 26 | M V30 19 H 1.1253 10.9448 2.7343 0 27 | M V30 20 H -1.0506 7.4550 1.8832 0 28 | M V30 21 H -1.0239 6.8227 4.2664 0 29 | M V30 22 H 0.0634 10.0971 7.0325 0 30 | M V30 23 H 0.0490 9.4151 9.4124 0 31 | M V30 24 H 0.0363 7.0161 10.0259 0 32 | M V30 25 H -1.0722 4.3018 6.6177 0 33 | M V30 26 H -1.0269 1.9695 7.3363 0 34 | M V30 27 H 1.1322 2.9060 10.8258 0 35 | M V30 28 H 1.1361 5.2515 10.1880 0 36 | M V30 29 H 0.0529 6.0421 5.8716 0 37 | M V30 30 H 1.1697 10.3409 5.1328 0 38 | M V30 END ATOM 39 | M V30 BEGIN BOND 40 | M V30 1 2 1 2 41 | M V30 2 1 2 3 42 | M V30 3 2 3 4 43 | M V30 4 1 4 5 44 | M V30 5 1 5 6 45 | M V30 6 2 6 7 46 | M V30 7 1 7 8 47 | M V30 8 2 8 9 48 | M V30 9 1 9 10 49 | M V30 10 1 10 11 50 | M V30 11 2 11 12 51 | M V30 12 1 12 13 52 | M V30 13 2 13 14 53 | M V30 14 1 14 15 54 | M V30 15 2 15 16 55 | M V30 16 2 10 17 56 | M V30 17 2 5 18 57 | M V30 18 1 18 1 58 | M V30 19 1 17 6 59 | M V30 20 1 16 11 60 | M V30 21 1 1 19 61 | M V30 22 1 3 20 62 | M V30 23 1 4 21 63 | M V30 24 1 7 22 64 | M V30 25 1 8 23 65 | M V30 26 1 9 24 66 | M V30 27 1 12 25 67 | M V30 28 1 13 26 68 | M V30 29 1 15 27 69 | M V30 30 1 16 28 70 | M V30 31 1 17 29 71 | M V30 32 1 18 30 72 | M V30 END BOND 73 | M V30 END CTAB 74 | M END 75 | 76 | $$$$ 77 | -------------------------------------------------------------------------------- /examples/intermediates_example.py: -------------------------------------------------------------------------------- 1 | import logging 2 | from pathlib import Path 3 | 4 | import stk 5 | 6 | import stko 7 | 8 | logger = logging.getLogger(__name__) 9 | 10 | 11 | def main() -> None: 12 | """Run the example.""" 13 | # Two building blocks you want to react to form a topology graph. 14 | bb1 = stk.BuildingBlock( 15 | smiles="NCCN", functional_groups=(stk.PrimaryAminoFactory(),) 16 | ) 17 | bb2 = stk.BuildingBlock( 18 | smiles="O=CC(C=O)C=O", functional_groups=(stk.AldehydeFactory(),) 19 | ) 20 | 21 | examples_output = Path("out_intermediates") 22 | examples_output.mkdir(parents=True, exist_ok=True) 23 | 24 | # Produce a `TopologyGraph` without doing any reactions. 25 | cage_graphs = stko.topology_functions.UnreactedTopologyGraph( 26 | stk.cage.FourPlusSix((bb1, bb2)) 27 | ) 28 | logger.info( 29 | "there are %s possible reactions", 30 | len(cage_graphs.get_available_reactions()), 31 | ) 32 | 33 | # With up to N reactions performed. 34 | intermediate_pool = cage_graphs.get_named_intermediates(n=4) 35 | logger.info("there are %s structures with n=%s", len(intermediate_pool), 4) 36 | for named_intermediate in intermediate_pool.intermediates: 37 | named_intermediate.molecule.write( 38 | examples_output / f"{named_intermediate.intermediate_name}.mol" 39 | ) 40 | 41 | # Now iterate over all possible reactions with varying amounts of 42 | # completeness and get their smiles. 43 | all_possible_smiles = cage_graphs.get_reacted_smiles() 44 | logger.info("there are %s unique smiles", len(all_possible_smiles)) 45 | 46 | 47 | if __name__ == "__main__": 48 | logging.basicConfig( 49 | level=logging.INFO, 50 | format="%(asctime)s | %(levelname)s | %(message)s", 51 | ) 52 | main() 53 | -------------------------------------------------------------------------------- /examples/mdanalysis_example.py: -------------------------------------------------------------------------------- 1 | # ruff: noqa: T201 2 | import numpy as np 3 | import stk 4 | 5 | import stko 6 | 7 | 8 | def main() -> None: 9 | """Run the example.""" 10 | stk_molecule = stk.BuildingBlock("NCCNCCN").with_centroid( 11 | position=np.array((10, 10, 10)) 12 | ) 13 | rdkit_molecule = stk_molecule.to_rdkit_mol() 14 | mdanalysis_molecule = stko.MDAnalysis().get_universe( 15 | mol=stk_molecule, 16 | ) 17 | print("stk molecule:", stk_molecule) 18 | print("rdkit molecule:", rdkit_molecule) 19 | print("Universe:", mdanalysis_molecule) 20 | print("R_g:", mdanalysis_molecule.atoms.radius_of_gyration()) 21 | print("B_sphere:", mdanalysis_molecule.atoms.bsphere()) 22 | print("Universe COM:", mdanalysis_molecule.atoms.center_of_mass()) 23 | print("stk centroid:", stk_molecule.get_centroid()) 24 | 25 | 26 | if __name__ == "__main__": 27 | main() 28 | -------------------------------------------------------------------------------- /examples/optwrite_example.py: -------------------------------------------------------------------------------- 1 | # ruff: noqa: T201 2 | 3 | import logging 4 | from pathlib import Path 5 | 6 | import stk 7 | 8 | import stko 9 | 10 | logger = logging.getLogger(__name__) 11 | 12 | 13 | def main() -> None: 14 | """Run the example.""" 15 | bb1 = stk.BuildingBlock("NCCN", [stk.PrimaryAminoFactory()]) 16 | bb2 = stk.BuildingBlock("O=CCCC=O", [stk.AldehydeFactory()]) 17 | polymer = stk.ConstructedMolecule( 18 | topology_graph=stk.polymer.Linear( 19 | building_blocks=(bb1, bb2), 20 | repeating_unit="AB", 21 | num_repeating_units=3, 22 | optimizer=stk.Collapser(scale_steps=False), 23 | ), 24 | ) 25 | 26 | output_directory = Path("optwrite_output") 27 | output_directory.mkdir(exist_ok=True, parents=True) 28 | 29 | optimiser = stko.OptWriterSequence( 30 | optimizers={ 31 | "etkdg": stko.ETKDG(), 32 | "uff": stko.UFF(), 33 | "mmff": stko.MMFF(), 34 | }, 35 | writer=stk.MolWriter(), 36 | output_directory=output_directory, 37 | ) 38 | 39 | polymer = optimiser.optimize(polymer) 40 | 41 | # Delete some, rerun. 42 | output_directory.joinpath("mmff_out.mol").unlink() 43 | polymer = optimiser.optimize(polymer) 44 | 45 | 46 | if __name__ == "__main__": 47 | logging.basicConfig( 48 | level=logging.INFO, 49 | format="%(asctime)s | %(levelname)s | %(message)s", 50 | ) 51 | main() 52 | -------------------------------------------------------------------------------- /examples/orca_example.py: -------------------------------------------------------------------------------- 1 | # ruff: noqa: T201 2 | import sys 3 | from pathlib import Path 4 | 5 | import stk 6 | 7 | import stko 8 | 9 | 10 | def main() -> None: 11 | """Run the example.""" 12 | if len(sys.argv) > 1: 13 | orca_path = sys.argv[1] 14 | else: 15 | print("usage: orca_example.py orca_path") 16 | sys.exit() 17 | 18 | bb1 = stk.BuildingBlock("NCCN", [stk.PrimaryAminoFactory()]) 19 | bb2 = stk.BuildingBlock("O=CC=O", [stk.AldehydeFactory()]) 20 | polymer = stk.ConstructedMolecule( 21 | stk.polymer.Linear( 22 | building_blocks=(bb1, bb2), 23 | repeating_unit="AB", 24 | orientations=(0, 0), 25 | num_repeating_units=1, 26 | ) 27 | ) 28 | 29 | examples_output = Path("orca_output_directory") 30 | examples_output.mkdir(parents=True, exist_ok=True) 31 | 32 | # Run optimisations. 33 | etkdg = stko.ETKDG() 34 | polymer = etkdg.optimize(polymer) 35 | 36 | orca_ey_1 = stko.OrcaEnergy( 37 | orca_path=orca_path, 38 | topline="! SP B97-3c", 39 | basename="example1", 40 | output_dir=f"{examples_output}/orca_e1_dir", 41 | ) 42 | print(orca_ey_1.get_energy(polymer)) 43 | 44 | uff = stko.UFF() 45 | polymer = uff.optimize(polymer) 46 | orca_ey_2 = stko.OrcaEnergy( 47 | orca_path=orca_path, 48 | topline="! SP B97-3c", 49 | basename="example2", 50 | output_dir=f"{examples_output}/orca_e2_dir", 51 | ) 52 | print(orca_ey_2.get_energy(polymer)) 53 | 54 | orca_ey_3 = stko.OrcaEnergy( 55 | orca_path=orca_path, 56 | topline="! SP B97-3c", 57 | basename="example3", 58 | output_dir=f"{examples_output}/orca_e3_dir", 59 | write_input_only=True, 60 | ) 61 | orca_ey_3.get_results(polymer) 62 | 63 | 64 | if __name__ == "__main__": 65 | main() 66 | -------------------------------------------------------------------------------- /examples/orca_output_directory/orca_e1_dir/input_structure.xyz: -------------------------------------------------------------------------------- 1 | 15 2 | 3 | N -2.451684 -0.876389 -0.447788 4 | C -1.707277 0.160334 0.216401 5 | C -0.241550 -0.103512 0.083042 6 | N 0.580466 0.886129 0.719433 7 | H -3.117529 -0.493827 -1.138419 8 | H -1.850258 -1.562091 -0.952104 9 | H -1.997699 0.108234 1.303445 10 | H -2.009708 1.163636 -0.136712 11 | H -0.022704 -0.236296 -0.998809 12 | H -0.025835 -1.081859 0.560151 13 | O 2.201775 -0.910122 -0.765694 14 | C 2.700757 0.061737 -0.108268 15 | C 1.843052 0.967140 0.644702 16 | H 3.757862 0.152190 -0.154451 17 | H 2.340331 1.764695 1.175072 18 | -------------------------------------------------------------------------------- /examples/orca_output_directory/orca_e1_dir/orca_input.inp: -------------------------------------------------------------------------------- 1 | ! SP B97-3c 2 | 3 | %base "example1" 4 | %pal 5 | nprocs 1 6 | end 7 | 8 | %scf 9 | MaxIter 2000 10 | end 11 | 12 | * xyzfile 0 1 /home/atarzia/software/stk_optimizers/examples/orca_output_directory/orca_e1_dir/input_structure.xyz 13 | -------------------------------------------------------------------------------- /examples/orca_output_directory/orca_e2_dir/input_structure.xyz: -------------------------------------------------------------------------------- 1 | 15 2 | 3 | N -2.606242 -0.901236 -0.286531 4 | C -1.714773 -0.035728 0.482743 5 | C -0.278542 -0.105745 -0.041977 6 | N 0.573297 0.772673 0.754993 7 | H -2.578099 -0.608691 -1.290497 8 | H -2.253371 -1.884479 -0.231418 9 | H -1.737235 -0.347523 1.549712 10 | H -2.083154 1.011503 0.421540 11 | H -0.261602 0.221912 -1.104310 12 | H 0.088213 -1.152415 0.036570 13 | O 2.222186 -0.488480 -1.269798 14 | C 2.689204 0.326160 -0.431657 15 | C 1.851928 0.970300 0.601008 16 | H 3.743625 0.565197 -0.467007 17 | H 2.344566 1.656553 1.276630 18 | -------------------------------------------------------------------------------- /examples/orca_output_directory/orca_e2_dir/orca_input.inp: -------------------------------------------------------------------------------- 1 | ! SP B97-3c 2 | 3 | %base "example2" 4 | %pal 5 | nprocs 1 6 | end 7 | 8 | %scf 9 | MaxIter 2000 10 | end 11 | 12 | * xyzfile 0 1 /home/atarzia/software/stk_optimizers/examples/orca_output_directory/orca_e2_dir/input_structure.xyz 13 | -------------------------------------------------------------------------------- /examples/orca_output_directory/orca_e3_dir/input_structure.xyz: -------------------------------------------------------------------------------- 1 | 15 2 | 3 | N -2.606242 -0.901236 -0.286531 4 | C -1.714773 -0.035728 0.482743 5 | C -0.278542 -0.105745 -0.041977 6 | N 0.573297 0.772673 0.754993 7 | H -2.578099 -0.608691 -1.290497 8 | H -2.253371 -1.884479 -0.231418 9 | H -1.737235 -0.347523 1.549712 10 | H -2.083154 1.011503 0.421540 11 | H -0.261602 0.221912 -1.104310 12 | H 0.088213 -1.152415 0.036570 13 | O 2.222186 -0.488480 -1.269798 14 | C 2.689204 0.326160 -0.431657 15 | C 1.851928 0.970300 0.601008 16 | H 3.743625 0.565197 -0.467007 17 | H 2.344566 1.656553 1.276630 18 | -------------------------------------------------------------------------------- /examples/orca_output_directory/orca_e3_dir/orca_input.inp: -------------------------------------------------------------------------------- 1 | ! SP B97-3c 2 | 3 | %base "example3" 4 | %pal 5 | nprocs 1 6 | end 7 | 8 | %scf 9 | MaxIter 2000 10 | end 11 | 12 | * xyzfile 0 1 /home/atarzia/software/stk_optimizers/examples/orca_output_directory/orca_e3_dir/input_structure.xyz 13 | -------------------------------------------------------------------------------- /examples/out_intermediates/idx1_1x3FG.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 11 10 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 O -0.0380 8.7847 -0.6552 0 9 | M V30 2 C -0.0000 7.7193 -1.2430 0 10 | M V30 3 C -0.0156 7.6830 -2.7289 0 11 | M V30 4 C 1.2317 7.0162 -3.2314 0 12 | M V30 5 O 2.0186 7.6059 -3.9611 0 13 | M V30 6 C -1.2317 7.0211 -3.2177 0 14 | M V30 7 O -2.0463 6.5990 -2.4160 0 15 | M V30 8 H 0.0447 6.8181 -0.6555 0 16 | M V30 9 H -0.0170 8.7221 -3.1221 0 17 | M V30 10 H 1.4257 5.9815 -2.9293 0 18 | M V30 11 H -1.4573 6.8803 -4.2675 0 19 | M V30 END ATOM 20 | M V30 BEGIN BOND 21 | M V30 1 2 1 2 22 | M V30 2 1 2 3 23 | M V30 3 1 3 4 24 | M V30 4 2 4 5 25 | M V30 5 1 3 6 26 | M V30 6 2 6 7 27 | M V30 7 1 2 8 28 | M V30 8 1 3 9 29 | M V30 9 1 4 10 30 | M V30 10 1 6 11 31 | M V30 END BOND 32 | M V30 END CTAB 33 | M END 34 | 35 | $$$$ 36 | -------------------------------------------------------------------------------- /examples/out_intermediates/idx2_1x2FG.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 12 11 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 N -0.0077 3.7216 4.4191 0 9 | M V30 2 C 0.3608 5.1103 4.4424 0 10 | M V30 3 C -0.3230 5.8783 3.3150 0 11 | M V30 4 N -0.0077 5.4110 2.0300 0 12 | M V30 5 H -1.0144 3.6048 4.6657 0 13 | M V30 6 H 0.1808 3.2703 3.4869 0 14 | M V30 7 H 1.4626 5.2174 4.3663 0 15 | M V30 8 H -0.0316 5.5358 5.3911 0 16 | M V30 9 H -1.4260 5.7170 3.4873 0 17 | M V30 10 H -0.1013 6.9522 3.4211 0 18 | M V30 11 H -0.6584 4.8111 1.5438 0 19 | M V30 12 H 0.8893 5.6239 1.6259 0 20 | M V30 END ATOM 21 | M V30 BEGIN BOND 22 | M V30 1 1 1 2 23 | M V30 2 1 2 3 24 | M V30 3 1 3 4 25 | M V30 4 1 1 5 26 | M V30 5 1 1 6 27 | M V30 6 1 2 7 28 | M V30 7 1 2 8 29 | M V30 8 1 3 9 30 | M V30 9 1 3 10 31 | M V30 10 1 4 11 32 | M V30 11 1 4 12 33 | M V30 END BOND 34 | M V30 END CTAB 35 | M END 36 | 37 | $$$$ 38 | -------------------------------------------------------------------------------- /examples/out_intermediates/idx5_1x3FG+1x2FG.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 20 19 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -0.0000 7.7193 -1.2430 0 9 | M V30 2 C -0.0156 7.6830 -2.7289 0 10 | M V30 3 C 1.2317 7.0162 -3.2314 0 11 | M V30 4 O 2.0186 7.6059 -3.9611 0 12 | M V30 5 C -1.2317 7.0211 -3.2177 0 13 | M V30 6 O -2.0463 6.5990 -2.4160 0 14 | M V30 7 H 0.0447 6.8181 -0.6555 0 15 | M V30 8 H -0.0170 8.7221 -3.1221 0 16 | M V30 9 H 1.4257 5.9815 -2.9293 0 17 | M V30 10 H -1.4573 6.8803 -4.2675 0 18 | M V30 11 N -0.0077 3.7216 4.4191 0 19 | M V30 12 C 0.3608 5.1103 4.4424 0 20 | M V30 13 C -0.3230 5.8783 3.3150 0 21 | M V30 14 N -0.0077 5.4110 2.0300 0 22 | M V30 15 H -1.0144 3.6048 4.6657 0 23 | M V30 16 H 0.1808 3.2703 3.4869 0 24 | M V30 17 H 1.4626 5.2174 4.3663 0 25 | M V30 18 H -0.0316 5.5358 5.3911 0 26 | M V30 19 H -1.4260 5.7170 3.4873 0 27 | M V30 20 H -0.1013 6.9522 3.4211 0 28 | M V30 END ATOM 29 | M V30 BEGIN BOND 30 | M V30 1 1 1 2 31 | M V30 2 1 2 3 32 | M V30 3 2 3 4 33 | M V30 4 1 2 5 34 | M V30 5 2 5 6 35 | M V30 6 1 1 7 36 | M V30 7 1 2 8 37 | M V30 8 1 3 9 38 | M V30 9 1 5 10 39 | M V30 10 1 11 12 40 | M V30 11 1 12 13 41 | M V30 12 1 13 14 42 | M V30 13 1 11 15 43 | M V30 14 1 11 16 44 | M V30 15 1 12 17 45 | M V30 16 1 12 18 46 | M V30 17 1 13 19 47 | M V30 18 1 13 20 48 | M V30 19 2 1 14 49 | M V30 END BOND 50 | M V30 END CTAB 51 | M END 52 | 53 | $$$$ 54 | -------------------------------------------------------------------------------- /examples/out_intermediates/idx7_2x3FG+1x2FG.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 28 27 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -1.2134 -0.7006 7.6921 0 9 | M V30 2 C 0.0024 0.0195 8.1532 0 10 | M V30 3 C 1.2289 -0.7128 7.6921 0 11 | M V30 4 O 2.0479 -1.1485 8.4913 0 12 | M V30 5 C -0.0155 1.4134 7.6921 0 13 | M V30 6 O -0.9554 1.8112 7.0270 0 14 | M V30 7 H -1.4106 -0.8660 6.6467 0 15 | M V30 8 H 0.0228 0.0328 9.2640 0 16 | M V30 9 H 1.3779 -0.8508 6.6158 0 17 | M V30 10 H 0.7696 2.1271 7.9093 0 18 | M V30 11 C -6.6851 -3.8596 -1.2430 0 19 | M V30 12 C -6.6459 -3.8550 -2.7289 0 20 | M V30 13 C -6.6921 -2.4414 -3.2314 0 21 | M V30 14 O -7.5962 -2.0548 -3.9611 0 22 | M V30 15 C -5.4646 -4.5773 -3.2177 0 23 | M V30 16 O -4.6918 -5.0716 -2.4160 0 24 | M V30 17 H -5.9270 -3.3704 -0.6555 0 25 | M V30 18 H -7.5451 -4.3758 -3.1221 0 26 | M V30 19 H -5.8930 -1.7560 -2.9293 0 27 | M V30 20 H -5.2299 -4.7022 -4.2675 0 28 | M V30 21 N -3.2178 -1.8578 4.4191 0 29 | M V30 22 C -4.6051 -2.2313 4.4421 0 30 | M V30 23 C -4.9290 -3.2079 3.3152 0 31 | M V30 24 N -4.6808 -2.7024 2.0300 0 32 | M V30 25 H -5.2477 -1.3300 4.3651 0 33 | M V30 26 H -4.7784 -2.7831 5.3911 0 34 | M V30 27 H -4.2388 -4.0831 3.4884 0 35 | M V30 28 H -5.9702 -3.5517 3.4212 0 36 | M V30 END ATOM 37 | M V30 BEGIN BOND 38 | M V30 1 1 1 2 39 | M V30 2 1 2 3 40 | M V30 3 2 3 4 41 | M V30 4 1 2 5 42 | M V30 5 2 5 6 43 | M V30 6 1 1 7 44 | M V30 7 1 2 8 45 | M V30 8 1 3 9 46 | M V30 9 1 5 10 47 | M V30 10 1 11 12 48 | M V30 11 1 12 13 49 | M V30 12 2 13 14 50 | M V30 13 1 12 15 51 | M V30 14 2 15 16 52 | M V30 15 1 11 17 53 | M V30 16 1 12 18 54 | M V30 17 1 13 19 55 | M V30 18 1 15 20 56 | M V30 19 1 21 22 57 | M V30 20 1 22 23 58 | M V30 21 1 23 24 59 | M V30 22 1 22 25 60 | M V30 23 1 22 26 61 | M V30 24 1 23 27 62 | M V30 25 1 23 28 63 | M V30 26 2 1 21 64 | M V30 27 2 11 24 65 | M V30 END BOND 66 | M V30 END CTAB 67 | M END 68 | 69 | $$$$ 70 | -------------------------------------------------------------------------------- /examples/out_intermediates/idx8_1x3FG+2x2FG.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 29 28 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 6.6851 -3.8596 -1.2430 0 9 | M V30 2 C 6.6615 -3.8280 -2.7289 0 10 | M V30 3 C 5.4604 -4.5748 -3.2314 0 11 | M V30 4 C 6.6963 -2.4438 -3.2177 0 12 | M V30 5 O 6.7381 -1.5274 -2.4160 0 13 | M V30 6 H 5.8824 -3.4478 -0.6555 0 14 | M V30 7 H 7.5621 -4.3463 -3.1221 0 15 | M V30 8 H 4.4673 -4.2255 -2.9293 0 16 | M V30 9 H 6.6872 -2.1781 -4.2675 0 17 | M V30 10 N 3.2255 -1.8639 4.4191 0 18 | M V30 11 C 4.2425 -2.8787 4.4421 0 19 | M V30 12 C 5.2503 -2.6710 3.3153 0 20 | M V30 13 N 4.6885 -2.7085 2.0300 0 21 | M V30 14 H 3.6287 -0.9344 4.6667 0 22 | M V30 15 H 2.7409 -1.8001 3.4867 0 23 | M V30 16 H 3.7830 -3.8858 4.3649 0 24 | M V30 17 H 4.8069 -2.7532 5.3911 0 25 | M V30 18 H 5.6634 -1.6358 3.4886 0 26 | M V30 19 H 6.0684 -3.4011 3.4212 0 27 | M V30 20 N -1.4651 -4.5761 -3.2246 0 28 | M V30 21 C -0.6824 -5.3003 -4.1877 0 29 | M V30 22 C 0.6815 -5.6755 -3.6155 0 30 | M V30 23 N 1.4609 -4.5761 -3.2246 0 31 | M V30 24 H -1.7340 -5.1954 -2.4296 0 32 | M V30 25 H -0.9645 -3.7268 -2.8552 0 33 | M V30 26 H -0.5584 -4.6999 -5.1126 0 34 | M V30 27 H -1.2113 -6.2578 -4.3839 0 35 | M V30 28 H 0.4477 -6.2857 -2.6961 0 36 | M V30 29 H 1.2149 -6.3136 -4.3380 0 37 | M V30 END ATOM 38 | M V30 BEGIN BOND 39 | M V30 1 1 1 2 40 | M V30 2 1 2 3 41 | M V30 3 1 2 4 42 | M V30 4 2 4 5 43 | M V30 5 1 1 6 44 | M V30 6 1 2 7 45 | M V30 7 1 3 8 46 | M V30 8 1 4 9 47 | M V30 9 1 10 11 48 | M V30 10 1 11 12 49 | M V30 11 1 12 13 50 | M V30 12 1 10 14 51 | M V30 13 1 10 15 52 | M V30 14 1 11 16 53 | M V30 15 1 11 17 54 | M V30 16 1 12 18 55 | M V30 17 1 12 19 56 | M V30 18 1 20 21 57 | M V30 19 1 21 22 58 | M V30 20 1 22 23 59 | M V30 21 1 20 24 60 | M V30 22 1 20 25 61 | M V30 23 1 21 26 62 | M V30 24 1 21 27 63 | M V30 25 1 22 28 64 | M V30 26 1 22 29 65 | M V30 27 2 1 13 66 | M V30 28 2 3 23 67 | M V30 END BOND 68 | M V30 END CTAB 69 | M END 70 | 71 | $$$$ 72 | -------------------------------------------------------------------------------- /examples/output_directory/bb1.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 20 19 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 N 2.5205 1.1082 -1.0118 0 9 | M V30 2 C 2.4869 -0.3216 -0.6384 0 10 | M V30 3 C 1.3217 -0.4629 0.3612 0 11 | M V30 4 N 0.1245 -0.1114 -0.3496 0 12 | M V30 5 C -1.0415 0.0164 0.4388 0 13 | M V30 6 C -2.2504 0.0295 -0.4700 0 14 | M V30 7 N -3.4597 0.1735 0.3320 0 15 | M V30 8 H 3.4899 1.4535 -0.8680 0 16 | M V30 9 H 1.9339 1.6857 -0.3276 0 17 | M V30 10 H 3.4314 -0.6783 -0.2033 0 18 | M V30 11 H 2.2923 -0.9067 -1.5567 0 19 | M V30 12 H 1.4627 0.2374 1.2070 0 20 | M V30 13 H 1.2535 -1.5165 0.7342 0 21 | M V30 14 H 0.0892 -0.4900 -1.2794 0 22 | M V30 15 H -1.0829 -0.7497 1.2467 0 23 | M V30 16 H -0.9787 1.0543 0.9372 0 24 | M V30 17 H -2.2426 -0.9790 -0.9943 0 25 | M V30 18 H -2.1245 0.8135 -1.2209 0 26 | M V30 19 H -3.9816 -0.7560 0.3774 0 27 | M V30 20 H -3.2446 0.4002 1.3145 0 28 | M V30 END ATOM 29 | M V30 BEGIN BOND 30 | M V30 1 1 1 2 31 | M V30 2 1 2 3 32 | M V30 3 1 3 4 33 | M V30 4 1 4 5 34 | M V30 5 1 5 6 35 | M V30 6 1 6 7 36 | M V30 7 1 1 8 37 | M V30 8 1 1 9 38 | M V30 9 1 2 10 39 | M V30 10 1 2 11 40 | M V30 11 1 3 12 41 | M V30 12 1 3 13 42 | M V30 13 1 4 14 43 | M V30 14 1 5 15 44 | M V30 15 1 5 16 45 | M V30 16 1 6 17 46 | M V30 17 1 6 18 47 | M V30 18 1 7 19 48 | M V30 19 1 7 20 49 | M V30 END BOND 50 | M V30 END CTAB 51 | M END 52 | 53 | $$$$ 54 | -------------------------------------------------------------------------------- /examples/output_directory/bb2.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 12 11 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 O 0.7048 1.4547 -1.1531 0 9 | M V30 2 C 1.3494 0.7711 -0.3876 0 10 | M V30 3 C 0.8060 -0.4333 0.2498 0 11 | M V30 4 C -0.6195 -0.7256 -0.1423 0 12 | M V30 5 C -1.5164 0.3771 0.2261 0 13 | M V30 6 O -1.0916 1.3572 0.7710 0 14 | M V30 7 H 2.3625 1.0706 -0.1741 0 15 | M V30 8 H 1.4444 -1.3209 0.0340 0 16 | M V30 9 H 0.7844 -0.2442 1.3640 0 17 | M V30 10 H -0.9159 -1.6496 0.4295 0 18 | M V30 11 H -0.7326 -0.9526 -1.2161 0 19 | M V30 12 H -2.5755 0.2954 -0.0013 0 20 | M V30 END ATOM 21 | M V30 BEGIN BOND 22 | M V30 1 2 1 2 23 | M V30 2 1 2 3 24 | M V30 3 1 3 4 25 | M V30 4 1 4 5 26 | M V30 5 2 5 6 27 | M V30 6 1 2 7 28 | M V30 7 1 3 8 29 | M V30 8 1 3 9 30 | M V30 9 1 4 10 31 | M V30 10 1 4 11 32 | M V30 11 1 5 12 33 | M V30 END BOND 34 | M V30 END CTAB 35 | M END 36 | 37 | $$$$ 38 | -------------------------------------------------------------------------------- /examples/output_directory/example_xtb_out/charges: -------------------------------------------------------------------------------- 1 | -0.41225526 2 | 0.02147333 3 | 0.03379662 4 | -0.32185978 5 | 0.03688277 6 | 0.02672962 7 | -0.43558202 8 | 0.08147761 9 | 0.05454374 10 | -0.03240166 11 | -0.00971743 12 | -0.00882953 13 | -0.06768557 14 | 0.09513600 15 | -0.04115418 16 | -0.04174153 17 | -0.04101999 18 | -0.01006972 19 | 0.00745474 20 | 0.06481202 21 | -------------------------------------------------------------------------------- /examples/output_directory/example_xtb_out/det_control.in: -------------------------------------------------------------------------------- 1 | $gbsa 2 | gbsagrid=normal 3 | $write 4 | gbsa=true 5 | -------------------------------------------------------------------------------- /examples/output_directory/example_xtb_out/input_structure.xyz: -------------------------------------------------------------------------------- 1 | 20 2 | 3 | N 2.520549 1.108182 -1.011831 4 | C 2.486943 -0.321621 -0.638421 5 | C 1.321665 -0.462881 0.361237 6 | N 0.124482 -0.111363 -0.349647 7 | C -1.041534 0.016351 0.438838 8 | C -2.250408 0.029465 -0.470010 9 | N -3.459678 0.173507 0.332009 10 | H 3.489925 1.453457 -0.867965 11 | H 1.933934 1.685698 -0.327558 12 | H 3.431359 -0.678297 -0.203303 13 | H 2.292266 -0.906654 -1.556694 14 | H 1.462694 0.237433 1.206990 15 | H 1.253458 -1.516481 0.734184 16 | H 0.089184 -0.490047 -1.279363 17 | H -1.082853 -0.749718 1.246662 18 | H -0.978740 1.054256 0.937165 19 | H -2.242574 -0.979012 -0.994281 20 | H -2.124511 0.813524 -1.220891 21 | H -3.981564 -0.756046 0.377410 22 | H -3.244597 0.400246 1.314462 23 | -------------------------------------------------------------------------------- /examples/output_directory/example_xtb_out/wbo: -------------------------------------------------------------------------------- 1 | 1 2 0.94326672677037415 2 | 2 3 1.0019999007059088 3 | 3 4 0.97285251094647640 4 | 4 5 0.92948886521060192 5 | 5 6 1.0270639856830639 6 | 6 7 0.89915903851445345 7 | 1 8 0.92511282740852974 8 | 1 9 0.87064605468774703 9 | 2 10 0.96048363033669182 10 | 2 11 0.97220891691017131 11 | 3 12 0.96790083804167826 12 | 3 13 0.93298700591110972 13 | 4 14 0.91880955117821150 14 | 5 15 0.95878378077624826 15 | 5 16 0.95389627682744382 16 | 6 17 0.96229642080094902 17 | 6 18 0.96453146372691301 18 | 7 19 0.85724209481061353 19 | 7 20 0.91580615583716862 20 | -------------------------------------------------------------------------------- /examples/output_directory/example_xtb_out/xtbrestart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/examples/output_directory/example_xtb_out/xtbrestart -------------------------------------------------------------------------------- /examples/output_directory/example_xtb_out/xtbtopo.mol: -------------------------------------------------------------------------------- 1 | xtb: 6.6.1 (8d0f1dd) 2 | 07092416353D 3 | 4 | 20 19 0 0 0 999 V2000 5 | 2.5205 1.1082 -1.0118 N 0 0 0 0 0 0 0 0 0 0 0 0 6 | 2.4869 -0.3216 -0.6384 C 0 0 0 0 0 0 0 0 0 0 0 0 7 | 1.3217 -0.4629 0.3612 C 0 0 0 0 0 0 0 0 0 0 0 0 8 | 0.1245 -0.1114 -0.3496 N 0 0 0 0 0 0 0 0 0 0 0 0 9 | -1.0415 0.0164 0.4388 C 0 0 0 0 0 0 0 0 0 0 0 0 10 | -2.2504 0.0295 -0.4700 C 0 0 0 0 0 0 0 0 0 0 0 0 11 | -3.4597 0.1735 0.3320 N 0 0 0 0 0 0 0 0 0 0 0 0 12 | 3.4899 1.4535 -0.8680 H 0 0 0 0 0 0 0 0 0 0 0 0 13 | 1.9339 1.6857 -0.3276 H 0 0 0 0 0 0 0 0 0 0 0 0 14 | 3.4314 -0.6783 -0.2033 H 0 0 0 0 0 0 0 0 0 0 0 0 15 | 2.2923 -0.9067 -1.5567 H 0 0 0 0 0 0 0 0 0 0 0 0 16 | 1.4627 0.2374 1.2070 H 0 0 0 0 0 0 0 0 0 0 0 0 17 | 1.2535 -1.5165 0.7342 H 0 0 0 0 0 0 0 0 0 0 0 0 18 | 0.0892 -0.4900 -1.2794 H 0 0 0 0 0 0 0 0 0 0 0 0 19 | -1.0829 -0.7497 1.2467 H 0 0 0 0 0 0 0 0 0 0 0 0 20 | -0.9787 1.0543 0.9372 H 0 0 0 0 0 0 0 0 0 0 0 0 21 | -2.2426 -0.9790 -0.9943 H 0 0 0 0 0 0 0 0 0 0 0 0 22 | -2.1245 0.8135 -1.2209 H 0 0 0 0 0 0 0 0 0 0 0 0 23 | -3.9816 -0.7560 0.3774 H 0 0 0 0 0 0 0 0 0 0 0 0 24 | -3.2446 0.4002 1.3145 H 0 0 0 0 0 0 0 0 0 0 0 0 25 | 1 2 1 0 0 0 0 26 | 2 3 1 0 0 0 0 27 | 3 4 1 0 0 0 0 28 | 4 5 1 0 0 0 0 29 | 5 6 1 0 0 0 0 30 | 6 7 1 0 0 0 0 31 | 1 8 1 0 0 0 0 32 | 1 9 1 0 0 0 0 33 | 2 10 1 0 0 0 0 34 | 2 11 1 0 0 0 0 35 | 3 12 1 0 0 0 0 36 | 3 13 1 0 0 0 0 37 | 4 14 1 0 0 0 0 38 | 5 15 1 0 0 0 0 39 | 5 16 1 0 0 0 0 40 | 6 17 1 0 0 0 0 41 | 6 18 1 0 0 0 0 42 | 7 19 1 0 0 0 0 43 | 7 20 1 0 0 0 0 44 | M END 45 | -------------------------------------------------------------------------------- /examples/output_directory/obabel_bb1_opt.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 12 11 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 N -1.3442 -0.8280 0.2968 0 9 | M V30 2 C -0.6445 0.4268 0.5650 0 10 | M V30 3 C 0.4780 0.7069 -0.4512 0 11 | M V30 4 N 1.5432 -0.2929 -0.3987 0 12 | M V30 5 H -1.7191 -0.8242 -0.6794 0 13 | M V30 6 H -0.7012 -1.6414 0.4242 0 14 | M V30 7 H -0.2290 0.4076 1.5958 0 15 | M V30 8 H -1.3810 1.2571 0.5113 0 16 | M V30 9 H 0.0608 0.7516 -1.4806 0 17 | M V30 10 H 0.9190 1.7002 -0.2196 0 18 | M V30 11 H 1.1918 -1.2210 -0.7251 0 19 | M V30 12 H 1.9061 -0.3764 0.5789 0 20 | M V30 END ATOM 21 | M V30 BEGIN BOND 22 | M V30 1 1 1 2 23 | M V30 2 1 2 3 24 | M V30 3 1 3 4 25 | M V30 4 1 1 5 26 | M V30 5 1 1 6 27 | M V30 6 1 2 7 28 | M V30 7 1 2 8 29 | M V30 8 1 3 9 30 | M V30 9 1 3 10 31 | M V30 10 1 4 11 32 | M V30 11 1 4 12 33 | M V30 END BOND 34 | M V30 END CTAB 35 | M END 36 | 37 | $$$$ 38 | -------------------------------------------------------------------------------- /examples/output_directory/obabel_bb1_unopt.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 12 11 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 N -1.3789 -0.7953 0.3238 0 9 | M V30 2 C -0.6980 0.4411 0.5929 0 10 | M V30 3 C 0.4802 0.6365 -0.3568 0 11 | M V30 4 N 1.4531 -0.3716 -0.2778 0 12 | M V30 5 H -1.8591 -0.7562 -0.6012 0 13 | M V30 6 H -0.7320 -1.6254 0.3496 0 14 | M V30 7 H -0.3501 0.4675 1.6463 0 15 | M V30 8 H -1.4140 1.2621 0.3731 0 16 | M V30 9 H 0.0242 0.6054 -1.3880 0 17 | M V30 10 H 0.9168 1.6345 -0.1926 0 18 | M V30 11 H 1.4680 -1.1058 -0.9708 0 19 | M V30 12 H 2.0898 -0.3929 0.5016 0 20 | M V30 END ATOM 21 | M V30 BEGIN BOND 22 | M V30 1 1 1 2 23 | M V30 2 1 2 3 24 | M V30 3 1 3 4 25 | M V30 4 1 1 5 26 | M V30 5 1 1 6 27 | M V30 6 1 2 7 28 | M V30 7 1 2 8 29 | M V30 8 1 3 9 30 | M V30 9 1 3 10 31 | M V30 10 1 4 11 32 | M V30 11 1 4 12 33 | M V30 END BOND 34 | M V30 END CTAB 35 | M END 36 | 37 | $$$$ 38 | -------------------------------------------------------------------------------- /examples/output_directory/obabel_bb2_opt.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 11 10 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 O -0.7546 1.2777 -1.9482 0 9 | M V30 2 C -0.3908 1.1199 -0.7936 0 10 | M V30 3 C -0.0545 -0.2547 -0.2810 0 11 | M V30 4 C 1.3772 -0.2734 0.1659 0 12 | M V30 5 O 2.1819 -1.0219 -0.3657 0 13 | M V30 6 C -0.9387 -0.6597 0.8705 0 14 | M V30 7 O -1.8101 0.0795 1.3037 0 15 | M V30 8 H -0.3104 1.9815 -0.1373 0 16 | M V30 9 H -0.1985 -0.9952 -1.0996 0 17 | M V30 10 H 1.7060 0.3810 0.9679 0 18 | M V30 11 H -0.8013 -1.6359 1.3249 0 19 | M V30 END ATOM 20 | M V30 BEGIN BOND 21 | M V30 1 2 1 2 22 | M V30 2 1 2 3 23 | M V30 3 1 3 4 24 | M V30 4 2 4 5 25 | M V30 5 1 3 6 26 | M V30 6 2 6 7 27 | M V30 7 1 2 8 28 | M V30 8 1 3 9 29 | M V30 9 1 4 10 30 | M V30 10 1 6 11 31 | M V30 END BOND 32 | M V30 END CTAB 33 | M END 34 | 35 | $$$$ 36 | -------------------------------------------------------------------------------- /examples/output_directory/obabel_bb2_unopt.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 11 10 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 O -0.8063 1.2540 -1.8876 0 9 | M V30 2 C -0.4016 1.1017 -0.7496 0 10 | M V30 3 C -0.0421 -0.2542 -0.2580 0 11 | M V30 4 C 1.4020 -0.2773 0.1508 0 12 | M V30 5 O 2.2028 -1.0336 -0.3840 0 13 | M V30 6 C -0.9330 -0.6613 0.8358 0 14 | M V30 7 O -1.8128 0.0967 1.2041 0 15 | M V30 8 H -0.3151 1.9723 -0.1221 0 16 | M V30 9 H -0.1645 -0.9887 -1.0826 0 17 | M V30 10 H 1.7282 0.4029 0.9450 0 18 | M V30 11 H -0.8577 -1.6124 1.3483 0 19 | M V30 END ATOM 20 | M V30 BEGIN BOND 21 | M V30 1 2 1 2 22 | M V30 2 1 2 3 23 | M V30 3 1 3 4 24 | M V30 4 2 4 5 25 | M V30 5 1 3 6 26 | M V30 6 2 6 7 27 | M V30 7 1 2 8 28 | M V30 8 1 3 9 29 | M V30 9 1 4 10 30 | M V30 10 1 6 11 31 | M V30 END BOND 32 | M V30 END CTAB 33 | M END 34 | 35 | $$$$ 36 | -------------------------------------------------------------------------------- /examples/output_directory/obabel_bb3_opt.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 22 23 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -2.8494 -1.2936 -0.0172 0 9 | M V30 2 C -1.4530 -1.2517 -0.0651 0 10 | M V30 3 C -0.7540 -0.0234 0.0279 0 11 | M V30 4 C 0.7547 0.0275 -0.0282 0 12 | M V30 5 C 1.4420 1.2440 -0.2603 0 13 | M V30 6 C 2.8382 1.2856 -0.3159 0 14 | M V30 7 C 3.5844 0.1231 -0.1338 0 15 | M V30 8 Br 5.4922 0.1872 -0.2047 0 16 | M V30 9 C 2.9338 -1.0865 0.1007 0 17 | M V30 10 C 1.5374 -1.1391 0.1493 0 18 | M V30 11 C -1.5251 1.1551 0.1759 0 19 | M V30 12 C -2.9212 1.1027 0.2315 0 20 | M V30 13 C -3.5837 -0.1190 0.1329 0 21 | M V30 14 Br -5.4916 -0.1832 0.2041 0 22 | M V30 15 H -3.3603 -2.2445 -0.0982 0 23 | M V30 16 H -0.9451 -2.1932 -0.1951 0 24 | M V30 17 H 0.9236 2.1750 -0.4215 0 25 | M V30 18 H 3.3395 2.2268 -0.5023 0 26 | M V30 19 H 3.5096 -1.9916 0.2470 0 27 | M V30 20 H 1.0967 -2.1025 0.3460 0 28 | M V30 21 H -1.0738 2.1291 0.2698 0 29 | M V30 22 H -3.4874 2.0176 0.3526 0 30 | M V30 END ATOM 31 | M V30 BEGIN BOND 32 | M V30 1 2 1 2 33 | M V30 2 1 2 3 34 | M V30 3 1 3 4 35 | M V30 4 2 4 5 36 | M V30 5 1 5 6 37 | M V30 6 2 6 7 38 | M V30 7 1 7 8 39 | M V30 8 1 7 9 40 | M V30 9 2 9 10 41 | M V30 10 2 3 11 42 | M V30 11 1 11 12 43 | M V30 12 2 12 13 44 | M V30 13 1 13 14 45 | M V30 14 1 13 1 46 | M V30 15 1 10 4 47 | M V30 16 1 1 15 48 | M V30 17 1 2 16 49 | M V30 18 1 5 17 50 | M V30 19 1 6 18 51 | M V30 20 1 9 19 52 | M V30 21 1 10 20 53 | M V30 22 1 11 21 54 | M V30 23 1 12 22 55 | M V30 END BOND 56 | M V30 END CTAB 57 | M END 58 | 59 | $$$$ 60 | -------------------------------------------------------------------------------- /examples/output_directory/obabel_bb3_unopt.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 22 23 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -2.8066 -1.2664 -0.1751 0 9 | M V30 2 C -1.4258 -1.2044 -0.2244 0 10 | M V30 3 C -0.7322 -0.0384 0.0228 0 11 | M V30 4 C 0.7230 0.0204 -0.0304 0 12 | M V30 5 C 1.3985 1.1723 -0.4128 0 13 | M V30 6 C 2.7749 1.2475 -0.4692 0 14 | M V30 7 C 3.5371 0.1404 -0.1350 0 15 | M V30 8 Br 5.4390 0.1573 -0.1851 0 16 | M V30 9 C 2.8709 -1.0145 0.2481 0 17 | M V30 10 C 1.4951 -1.0716 0.2987 0 18 | M V30 11 C -1.4569 1.0989 0.3290 0 19 | M V30 12 C -2.8547 1.0644 0.3856 0 20 | M V30 13 C -3.5092 -0.1203 0.1322 0 21 | M V30 14 Br -5.4292 -0.1979 0.2034 0 22 | M V30 15 H -3.3505 -2.1856 -0.3700 0 23 | M V30 16 H -0.8380 -2.0859 -0.4627 0 24 | M V30 17 H 0.8118 2.0432 -0.6759 0 25 | M V30 18 H 3.3184 2.1359 -0.7648 0 26 | M V30 19 H 3.4296 -1.9198 0.5229 0 27 | M V30 20 H 1.0221 -1.9859 0.6007 0 28 | M V30 21 H -1.0027 2.0544 0.5370 0 29 | M V30 22 H -3.4146 1.9561 0.6252 0 30 | M V30 END ATOM 31 | M V30 BEGIN BOND 32 | M V30 1 2 1 2 33 | M V30 2 1 2 3 34 | M V30 3 1 3 4 35 | M V30 4 2 4 5 36 | M V30 5 1 5 6 37 | M V30 6 2 6 7 38 | M V30 7 1 7 8 39 | M V30 8 1 7 9 40 | M V30 9 2 9 10 41 | M V30 10 2 3 11 42 | M V30 11 1 11 12 43 | M V30 12 2 12 13 44 | M V30 13 1 13 14 45 | M V30 14 1 13 1 46 | M V30 15 1 10 4 47 | M V30 16 1 1 15 48 | M V30 17 1 2 16 49 | M V30 18 1 5 17 50 | M V30 19 1 6 18 51 | M V30 20 1 9 19 52 | M V30 21 1 10 20 53 | M V30 22 1 11 21 54 | M V30 23 1 12 22 55 | M V30 END BOND 56 | M V30 END CTAB 57 | M END 58 | 59 | $$$$ 60 | -------------------------------------------------------------------------------- /examples/output_directory/obabel_polymer_opt.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 18 17 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 N -0.5534 0.0733 0.0429 0 9 | M V30 2 C 0.4018 1.0608 0.5462 0 10 | M V30 3 C 1.5945 1.2339 -0.4012 0 11 | M V30 4 N 2.3051 -0.0237 -0.5541 0 12 | M V30 5 H -0.8824 0.3552 -0.9093 0 13 | M V30 6 H -0.1008 -0.8675 -0.0163 0 14 | M V30 7 H 0.7587 0.7497 1.5524 0 15 | M V30 8 H -0.1184 2.0367 0.6517 0 16 | M V30 9 H 1.2233 1.5586 -1.3961 0 17 | M V30 10 H 2.2448 2.0401 -0.0042 0 18 | M V30 11 C 3.5663 -0.2215 -0.3495 0 19 | M V30 12 C 4.5264 0.8677 0.0643 0 20 | M V30 13 C 5.9262 0.3423 0.1753 0 21 | M V30 14 O 6.1983 -0.5367 0.9777 0 22 | M V30 15 H 3.9502 -1.2254 -0.5064 0 23 | M V30 16 H 4.2218 1.2899 1.0456 0 24 | M V30 17 H 4.5129 1.6717 -0.7024 0 25 | M V30 18 H 6.7086 0.7502 -0.4573 0 26 | M V30 END ATOM 27 | M V30 BEGIN BOND 28 | M V30 1 1 1 2 29 | M V30 2 1 2 3 30 | M V30 3 1 3 4 31 | M V30 4 1 1 5 32 | M V30 5 1 1 6 33 | M V30 6 1 2 7 34 | M V30 7 1 2 8 35 | M V30 8 1 3 9 36 | M V30 9 1 3 10 37 | M V30 10 1 11 12 38 | M V30 11 1 12 13 39 | M V30 12 2 13 14 40 | M V30 13 1 11 15 41 | M V30 14 1 12 16 42 | M V30 15 1 12 17 43 | M V30 16 1 13 18 44 | M V30 17 2 4 11 45 | M V30 END BOND 46 | M V30 END CTAB 47 | M END 48 | 49 | $$$$ 50 | -------------------------------------------------------------------------------- /examples/output_directory/obabel_polymer_unopt.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 18 17 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 N -1.4630 -0.0000 -0.0000 0 9 | M V30 2 C -0.6803 1.1287 0.4221 0 10 | M V30 3 C 0.6837 1.1370 -0.2621 0 11 | M V30 4 N 1.4630 -0.0000 0.0000 0 12 | M V30 5 H -1.7319 0.0942 -1.0033 0 13 | M V30 6 H -0.9624 -0.9146 0.1457 0 14 | M V30 7 H -0.5563 1.1204 1.5247 0 15 | M V30 8 H -1.2092 2.0413 0.0722 0 16 | M V30 9 H 0.4498 1.1566 -1.3654 0 17 | M V30 10 H 1.2170 2.0637 0.0034 0 18 | M V30 11 C 4.7626 -0.0000 0.0000 0 19 | M V30 12 C 5.9507 0.8542 0.1933 0 20 | M V30 13 C 7.1417 -0.0000 -0.0000 0 21 | M V30 14 O 7.2259 -1.0603 0.5717 0 22 | M V30 15 H 4.2809 -0.0018 -0.9574 0 23 | M V30 16 H 5.9730 1.3180 1.2163 0 24 | M V30 17 H 5.9733 1.6948 -0.5321 0 25 | M V30 18 H 7.9336 0.3415 -0.6604 0 26 | M V30 END ATOM 27 | M V30 BEGIN BOND 28 | M V30 1 1 1 2 29 | M V30 2 1 2 3 30 | M V30 3 1 3 4 31 | M V30 4 1 1 5 32 | M V30 5 1 1 6 33 | M V30 6 1 2 7 34 | M V30 7 1 2 8 35 | M V30 8 1 3 9 36 | M V30 9 1 3 10 37 | M V30 10 1 11 12 38 | M V30 11 1 12 13 39 | M V30 12 2 13 14 40 | M V30 13 1 11 15 41 | M V30 14 1 12 16 42 | M V30 15 1 12 17 43 | M V30 16 1 13 18 44 | M V30 17 2 4 11 45 | M V30 END BOND 46 | M V30 END CTAB 47 | M END 48 | 49 | $$$$ 50 | -------------------------------------------------------------------------------- /examples/output_directory/poly_etkdg.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 29 28 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 N 4.8543 0.6842 0.6785 0 9 | M V30 2 C 3.9861 -0.4091 0.9129 0 10 | M V30 3 C 2.5131 0.0184 0.9644 0 11 | M V30 4 N 2.1489 0.5933 -0.2621 0 12 | M V30 5 C 0.7515 0.7721 -0.5563 0 13 | M V30 6 C 0.2258 -0.6183 -0.8269 0 14 | M V30 7 N -1.1326 -0.6718 -1.1620 0 15 | M V30 8 H 5.4205 0.6815 -0.1737 0 16 | M V30 9 H 4.6609 1.5742 1.1052 0 17 | M V30 10 H 4.2129 -0.8777 1.9000 0 18 | M V30 11 H 4.1231 -1.1727 0.1094 0 19 | M V30 12 H 1.9022 -0.8685 1.1920 0 20 | M V30 13 H 2.3728 0.7858 1.7711 0 21 | M V30 14 H 2.7610 1.3460 -0.6215 0 22 | M V30 15 H 0.6583 1.4384 -1.4196 0 23 | M V30 16 H 0.1783 1.2299 0.2980 0 24 | M V30 17 H 0.8621 -1.0068 -1.6749 0 25 | M V30 18 H 0.4367 -1.3160 0.0165 0 26 | M V30 19 C -2.0607 -0.9474 -0.3836 0 27 | M V30 20 C -3.4652 -0.9888 -0.8218 0 28 | M V30 21 C -4.2152 0.2974 -0.6574 0 29 | M V30 22 C -4.2388 0.7565 0.7616 0 30 | M V30 23 O -3.6303 0.1341 1.6496 0 31 | M V30 24 H -1.8289 -1.1514 0.6715 0 32 | M V30 25 H -4.0590 -1.7796 -0.2926 0 33 | M V30 26 H -3.5336 -1.3078 -1.9137 0 34 | M V30 27 H -3.8474 1.1036 -1.3276 0 35 | M V30 28 H -5.2799 0.0722 -0.9890 0 36 | M V30 29 H -4.7770 1.6281 1.0520 0 37 | M V30 END ATOM 38 | M V30 BEGIN BOND 39 | M V30 1 1 1 2 40 | M V30 2 1 2 3 41 | M V30 3 1 3 4 42 | M V30 4 1 4 5 43 | M V30 5 1 5 6 44 | M V30 6 1 6 7 45 | M V30 7 1 1 8 46 | M V30 8 1 1 9 47 | M V30 9 1 2 10 48 | M V30 10 1 2 11 49 | M V30 11 1 3 12 50 | M V30 12 1 3 13 51 | M V30 13 1 4 14 52 | M V30 14 1 5 15 53 | M V30 15 1 5 16 54 | M V30 16 1 6 17 55 | M V30 17 1 6 18 56 | M V30 18 1 19 20 57 | M V30 19 1 20 21 58 | M V30 20 1 21 22 59 | M V30 21 2 22 23 60 | M V30 22 1 19 24 61 | M V30 23 1 20 25 62 | M V30 24 1 20 26 63 | M V30 25 1 21 27 64 | M V30 26 1 21 28 65 | M V30 27 1 22 29 66 | M V30 28 2 7 19 67 | M V30 END BOND 68 | M V30 END CTAB 69 | M END 70 | 71 | $$$$ 72 | -------------------------------------------------------------------------------- /examples/output_directory/poly_mmff.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 29 28 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 N -1.5965 -1.9565 -0.0562 0 9 | M V30 2 C -1.8600 -0.7020 -0.7738 0 10 | M V30 3 C -0.6055 -0.1485 -1.4799 0 11 | M V30 4 N 0.5738 -0.1983 -0.5996 0 12 | M V30 5 C 1.7504 0.3513 -1.2859 0 13 | M V30 6 C 2.9903 0.2948 -0.3809 0 14 | M V30 7 N 4.1496 0.8103 -1.1264 0 15 | M V30 8 H -2.4544 -2.2513 0.4086 0 16 | M V30 9 H -0.9416 -1.7380 0.6969 0 17 | M V30 10 H -2.2286 0.0378 -0.0536 0 18 | M V30 11 H -2.6510 -0.8657 -1.5132 0 19 | M V30 12 H -0.8064 0.8822 -1.7944 0 20 | M V30 13 H -0.4149 -0.7466 -2.3798 0 21 | M V30 14 H 0.7460 -1.1852 -0.3960 0 22 | M V30 15 H 1.9498 -0.2110 -2.2068 0 23 | M V30 16 H 1.5660 1.3946 -1.5703 0 24 | M V30 17 H 3.1788 -0.7426 -0.0768 0 25 | M V30 18 H 2.8133 0.8960 0.5203 0 26 | M V30 19 C 5.2065 0.9067 -0.3953 0 27 | M V30 20 C 6.4978 1.3985 -0.9922 0 28 | M V30 21 C 7.3563 0.2208 -1.4279 0 29 | M V30 22 C 8.0140 -0.4832 -0.2671 0 30 | M V30 23 O 7.8011 -0.2186 0.9117 0 31 | M V30 24 H 5.2289 0.6029 0.6675 0 32 | M V30 25 H 6.2628 2.0182 -1.8648 0 33 | M V30 26 H 7.0060 2.0259 -0.2529 0 34 | M V30 27 H 8.1622 0.5792 -2.0776 0 35 | M V30 28 H 6.7719 -0.5206 -1.9830 0 36 | M V30 29 H 8.7110 -1.2929 -0.5442 0 37 | M V30 END ATOM 38 | M V30 BEGIN BOND 39 | M V30 1 1 1 2 40 | M V30 2 1 2 3 41 | M V30 3 1 3 4 42 | M V30 4 1 4 5 43 | M V30 5 1 5 6 44 | M V30 6 1 6 7 45 | M V30 7 1 1 8 46 | M V30 8 1 1 9 47 | M V30 9 1 2 10 48 | M V30 10 1 2 11 49 | M V30 11 1 3 12 50 | M V30 12 1 3 13 51 | M V30 13 1 4 14 52 | M V30 14 1 5 15 53 | M V30 15 1 5 16 54 | M V30 16 1 6 17 55 | M V30 17 1 6 18 56 | M V30 18 1 19 20 57 | M V30 19 1 20 21 58 | M V30 20 1 21 22 59 | M V30 21 2 22 23 60 | M V30 22 1 19 24 61 | M V30 23 1 20 25 62 | M V30 24 1 20 26 63 | M V30 25 1 21 27 64 | M V30 26 1 21 28 65 | M V30 27 1 22 29 66 | M V30 28 2 7 19 67 | M V30 END BOND 68 | M V30 END CTAB 69 | M END 70 | 71 | $$$$ 72 | -------------------------------------------------------------------------------- /examples/output_directory/poly_uff.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 29 28 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 N -1.7987 -0.7653 0.8647 0 9 | M V30 2 C -1.9058 -0.5215 -0.5709 0 10 | M V30 3 C -0.6961 0.2685 -1.0747 0 11 | M V30 4 N 0.5423 -0.4828 -0.8349 0 12 | M V30 5 C 1.7068 0.3123 -1.2407 0 13 | M V30 6 C 2.9940 -0.4368 -0.9044 0 14 | M V30 7 N 4.1353 0.3649 -1.2804 0 15 | M V30 8 H -2.6075 -1.3653 1.1462 0 16 | M V30 9 H -1.9194 0.1475 1.3614 0 17 | M V30 10 H -2.8361 0.0492 -0.7888 0 18 | M V30 11 H -1.9627 -1.4932 -1.1089 0 19 | M V30 12 H -0.6638 1.2460 -0.5435 0 20 | M V30 13 H -0.8229 0.4641 -2.1636 0 21 | M V30 14 H 0.5161 -1.3418 -1.4345 0 22 | M V30 15 H 1.6737 0.5144 -2.3357 0 23 | M V30 16 H 1.7125 1.2834 -0.6962 0 24 | M V30 17 H 3.0183 -1.4020 -1.4572 0 25 | M V30 18 H 3.0260 -0.6435 0.1884 0 26 | M V30 19 C 5.3422 -0.0414 -1.0983 0 27 | M V30 20 C 6.4913 0.8354 -1.5085 0 28 | M V30 21 C 7.8494 0.1900 -1.2057 0 29 | M V30 22 C 8.0861 0.0481 0.2700 0 30 | M V30 23 O 8.1867 1.0367 0.9791 0 31 | M V30 24 H 5.5308 -1.0150 -0.6496 0 32 | M V30 25 H 6.4219 1.0212 -2.6019 0 33 | M V30 26 H 6.4141 1.8156 -0.9895 0 34 | M V30 27 H 8.6570 0.8188 -1.6386 0 35 | M V30 28 H 7.9047 -0.8104 -1.6875 0 36 | M V30 29 H 8.1814 -0.9390 0.7103 0 37 | M V30 END ATOM 38 | M V30 BEGIN BOND 39 | M V30 1 1 1 2 40 | M V30 2 1 2 3 41 | M V30 3 1 3 4 42 | M V30 4 1 4 5 43 | M V30 5 1 5 6 44 | M V30 6 1 6 7 45 | M V30 7 1 1 8 46 | M V30 8 1 1 9 47 | M V30 9 1 2 10 48 | M V30 10 1 2 11 49 | M V30 11 1 3 12 50 | M V30 12 1 3 13 51 | M V30 13 1 4 14 52 | M V30 14 1 5 15 53 | M V30 15 1 5 16 54 | M V30 16 1 6 17 55 | M V30 17 1 6 18 56 | M V30 18 1 19 20 57 | M V30 19 1 20 21 58 | M V30 20 1 21 22 59 | M V30 21 2 22 23 60 | M V30 22 1 19 24 61 | M V30 23 1 20 25 62 | M V30 24 1 20 26 63 | M V30 25 1 21 27 64 | M V30 26 1 21 28 65 | M V30 27 1 22 29 66 | M V30 28 2 7 19 67 | M V30 END BOND 68 | M V30 END CTAB 69 | M END 70 | 71 | $$$$ 72 | -------------------------------------------------------------------------------- /examples/output_directory/polymer.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 29 28 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 N -3.1001 -0.0000 0.0000 0 9 | M V30 2 C -2.7712 -0.1752 -1.4304 0 10 | M V30 3 C -1.4093 0.5189 -1.6318 0 11 | M V30 4 N -0.4617 -0.1898 -0.8183 0 12 | M V30 5 C 0.8146 0.4064 -0.7034 0 13 | M V30 6 C 1.7816 -0.6081 -0.1349 0 14 | M V30 7 N 3.1001 0.0000 -0.0000 0 15 | M V30 8 H -4.0560 0.4027 0.0612 0 16 | M V30 9 H -2.4731 0.7493 0.4373 0 17 | M V30 10 H -3.5340 0.2396 -2.1045 0 18 | M V30 11 H -2.6943 -1.2605 -1.6294 0 19 | M V30 12 H -1.4676 1.5708 -1.2915 0 20 | M V30 13 H -1.1039 0.4733 -2.7081 0 21 | M V30 14 H -0.5721 -1.1875 -0.8581 0 22 | M V30 15 H 1.1450 0.8687 -1.6617 0 23 | M V30 16 H 0.7056 1.2479 0.0773 0 24 | M V30 17 H 1.8125 -1.4522 -0.8954 0 25 | M V30 18 H 1.3793 -0.9987 0.8032 0 26 | M V30 19 C 7.1424 0.0000 -0.0000 0 27 | M V30 20 C 7.9618 -0.0138 -1.2168 0 28 | M V30 21 C 9.3008 -0.6792 -1.0280 0 29 | M V30 22 C 10.0995 0.0000 -0.0000 0 30 | M V30 23 O 9.6703 0.9611 0.5744 0 31 | M V30 24 H 6.1649 0.4535 -0.0263 0 32 | M V30 25 H 7.4166 -0.4994 -2.0588 0 33 | M V30 26 H 8.1888 1.0611 -1.4823 0 34 | M V30 27 H 9.8298 -0.5996 -2.0192 0 35 | M V30 28 H 9.2178 -1.7520 -0.7845 0 36 | M V30 29 H 11.0896 -0.3795 0.2364 0 37 | M V30 END ATOM 38 | M V30 BEGIN BOND 39 | M V30 1 1 1 2 40 | M V30 2 1 2 3 41 | M V30 3 1 3 4 42 | M V30 4 1 4 5 43 | M V30 5 1 5 6 44 | M V30 6 1 6 7 45 | M V30 7 1 1 8 46 | M V30 8 1 1 9 47 | M V30 9 1 2 10 48 | M V30 10 1 2 11 49 | M V30 11 1 3 12 50 | M V30 12 1 3 13 51 | M V30 13 1 4 14 52 | M V30 14 1 5 15 53 | M V30 15 1 5 16 54 | M V30 16 1 6 17 55 | M V30 17 1 6 18 56 | M V30 18 1 19 20 57 | M V30 19 1 20 21 58 | M V30 20 1 21 22 59 | M V30 21 2 22 23 60 | M V30 22 1 19 24 61 | M V30 23 1 20 25 62 | M V30 24 1 20 26 63 | M V30 25 1 21 27 64 | M V30 26 1 21 28 65 | M V30 27 1 22 29 66 | M V30 28 2 7 19 67 | M V30 END BOND 68 | M V30 END CTAB 69 | M END 70 | 71 | $$$$ 72 | -------------------------------------------------------------------------------- /examples/output_directory/tg_info.pdb: -------------------------------------------------------------------------------- 1 | HETATM 1 P1 UNL 1 0.095 0.058 7.708 1.00 0.00 P 0 2 | HETATM 2 P2 UNL 1 -6.260 -3.617 -2.674 1.00 0.00 P 0 3 | HETATM 3 P3 UNL 1 6.263 -3.613 -2.674 1.00 0.00 P 0 4 | HETATM 4 P4 UNL 1 -0.002 7.230 -2.674 1.00 0.00 P 0 5 | HETATM 5 P5 UNL 1 -4.708 -2.718 3.859 1.00 0.00 P 0 6 | HETATM 6 P6 UNL 1 4.716 -2.725 3.859 1.00 0.00 P 0 7 | HETATM 7 P7 UNL 1 -0.009 5.443 3.859 1.00 0.00 P 0 8 | HETATM 8 P8 UNL 1 -0.014 -5.461 -3.848 1.00 0.00 P 0 9 | HETATM 9 P9 UNL 1 -4.734 2.722 -3.848 1.00 0.00 P 0 10 | HETATM 10 P10 UNL 1 4.736 2.718 -3.848 1.00 0.00 P 0 11 | CONECT 1 5 12 | CONECT 2 5 13 | CONECT 1 6 14 | CONECT 3 6 15 | CONECT 1 7 16 | CONECT 4 7 17 | CONECT 2 8 18 | CONECT 3 8 19 | CONECT 2 9 20 | CONECT 4 9 21 | CONECT 3 10 22 | CONECT 4 10 23 | END 24 | -------------------------------------------------------------------------------- /examples/output_directory/tors_test_bb1.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 20 19 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 N 2.5205 1.1082 -1.0118 0 9 | M V30 2 C 2.4869 -0.3216 -0.6384 0 10 | M V30 3 C 1.3217 -0.4629 0.3612 0 11 | M V30 4 N 0.1245 -0.1114 -0.3496 0 12 | M V30 5 C -1.0415 0.0164 0.4388 0 13 | M V30 6 C -2.2504 0.0295 -0.4700 0 14 | M V30 7 N -3.4597 0.1735 0.3320 0 15 | M V30 8 H 3.4899 1.4535 -0.8680 0 16 | M V30 9 H 1.9339 1.6857 -0.3276 0 17 | M V30 10 H 3.4314 -0.6783 -0.2033 0 18 | M V30 11 H 2.2923 -0.9067 -1.5567 0 19 | M V30 12 H 1.4627 0.2374 1.2070 0 20 | M V30 13 H 1.2535 -1.5165 0.7342 0 21 | M V30 14 H 0.0892 -0.4900 -1.2794 0 22 | M V30 15 H -1.0829 -0.7497 1.2467 0 23 | M V30 16 H -0.9787 1.0543 0.9372 0 24 | M V30 17 H -2.2426 -0.9790 -0.9943 0 25 | M V30 18 H -2.1245 0.8135 -1.2209 0 26 | M V30 19 H -3.9816 -0.7560 0.3774 0 27 | M V30 20 H -3.2446 0.4002 1.3145 0 28 | M V30 END ATOM 29 | M V30 BEGIN BOND 30 | M V30 1 1 1 2 31 | M V30 2 1 2 3 32 | M V30 3 1 3 4 33 | M V30 4 1 4 5 34 | M V30 5 1 5 6 35 | M V30 6 1 6 7 36 | M V30 7 1 1 8 37 | M V30 8 1 1 9 38 | M V30 9 1 2 10 39 | M V30 10 1 2 11 40 | M V30 11 1 3 12 41 | M V30 12 1 3 13 42 | M V30 13 1 4 14 43 | M V30 14 1 5 15 44 | M V30 15 1 5 16 45 | M V30 16 1 6 17 46 | M V30 17 1 6 18 47 | M V30 18 1 7 19 48 | M V30 19 1 7 20 49 | M V30 END BOND 50 | M V30 END CTAB 51 | M END 52 | 53 | $$$$ 54 | -------------------------------------------------------------------------------- /examples/output_directory/tors_test_polymer.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 29 28 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 N -3.1001 -0.0000 0.0000 0 9 | M V30 2 C -2.7712 -0.1752 -1.4304 0 10 | M V30 3 C -1.4093 0.5189 -1.6318 0 11 | M V30 4 N -0.4617 -0.1898 -0.8183 0 12 | M V30 5 C 0.8146 0.4064 -0.7034 0 13 | M V30 6 C 1.7816 -0.6081 -0.1349 0 14 | M V30 7 N 3.1001 0.0000 -0.0000 0 15 | M V30 8 H -4.0560 0.4027 0.0612 0 16 | M V30 9 H -2.4731 0.7493 0.4373 0 17 | M V30 10 H -3.5340 0.2396 -2.1045 0 18 | M V30 11 H -2.6943 -1.2605 -1.6294 0 19 | M V30 12 H -1.4676 1.5708 -1.2915 0 20 | M V30 13 H -1.1039 0.4733 -2.7081 0 21 | M V30 14 H -0.5721 -1.1875 -0.8581 0 22 | M V30 15 H 1.1450 0.8687 -1.6617 0 23 | M V30 16 H 0.7056 1.2479 0.0773 0 24 | M V30 17 H 1.8125 -1.4522 -0.8954 0 25 | M V30 18 H 1.3793 -0.9987 0.8032 0 26 | M V30 19 C 7.1424 0.0000 -0.0000 0 27 | M V30 20 C 7.9618 -0.0138 -1.2168 0 28 | M V30 21 C 9.3008 -0.6792 -1.0280 0 29 | M V30 22 C 10.0995 0.0000 -0.0000 0 30 | M V30 23 O 9.6703 0.9611 0.5744 0 31 | M V30 24 H 6.1649 0.4535 -0.0263 0 32 | M V30 25 H 7.4166 -0.4994 -2.0588 0 33 | M V30 26 H 8.1888 1.0611 -1.4823 0 34 | M V30 27 H 9.8298 -0.5996 -2.0192 0 35 | M V30 28 H 9.2178 -1.7520 -0.7845 0 36 | M V30 29 H 11.0896 -0.3795 0.2364 0 37 | M V30 END ATOM 38 | M V30 BEGIN BOND 39 | M V30 1 1 1 2 40 | M V30 2 1 2 3 41 | M V30 3 1 3 4 42 | M V30 4 1 4 5 43 | M V30 5 1 5 6 44 | M V30 6 1 6 7 45 | M V30 7 1 1 8 46 | M V30 8 1 1 9 47 | M V30 9 1 2 10 48 | M V30 10 1 2 11 49 | M V30 11 1 3 12 50 | M V30 12 1 3 13 51 | M V30 13 1 4 14 52 | M V30 14 1 5 15 53 | M V30 15 1 5 16 54 | M V30 16 1 6 17 55 | M V30 17 1 6 18 56 | M V30 18 1 19 20 57 | M V30 19 1 20 21 58 | M V30 20 1 21 22 59 | M V30 21 2 22 23 60 | M V30 22 1 19 24 61 | M V30 23 1 20 25 62 | M V30 24 1 20 26 63 | M V30 25 1 21 27 64 | M V30 26 1 21 28 65 | M V30 27 1 22 29 66 | M V30 28 2 7 19 67 | M V30 END BOND 68 | M V30 END CTAB 69 | M END 70 | 71 | $$$$ 72 | -------------------------------------------------------------------------------- /examples/shape_example.py: -------------------------------------------------------------------------------- 1 | # ruff: noqa: T201 2 | import stk 3 | 4 | import stko 5 | 6 | 7 | def main() -> None: 8 | """Run the example.""" 9 | bb1 = stk.BuildingBlock("NCCNCCN", [stk.PrimaryAminoFactory()]) 10 | bb2 = stk.BuildingBlock("O=CCCC=O", [stk.AldehydeFactory()]) 11 | polymer = stk.ConstructedMolecule( 12 | stk.polymer.Linear( 13 | building_blocks=(bb1, bb2), 14 | repeating_unit="AB", 15 | orientations=(0, 0), 16 | num_repeating_units=1, 17 | ) 18 | ) 19 | 20 | # Zipping calculations together. 21 | mols = [ 22 | # Perfect linear short. 23 | stk.BuildingBlock("C#C"), 24 | # Kind of linear long. 25 | stk.BuildingBlock("C#CC#C"), 26 | stk.BuildingBlock("CCCC"), 27 | # Flat. 28 | stk.BuildingBlock("C1=CC=CC=C1"), 29 | # Less flat. 30 | stk.BuildingBlock("C1CCCCC1"), 31 | # Sphere - CH4. 32 | stk.BuildingBlock("C"), 33 | # Sphere - adamantane. 34 | stk.BuildingBlock("C1C3CC2CC(CC1C2)C3"), 35 | # Constructed Molecule. 36 | polymer, 37 | ] 38 | shape_calc = stko.ShapeCalculator() 39 | for mol in mols: 40 | print( 41 | mol, 42 | stko.ShapeResults( 43 | shape_calc.calculate(mol) 44 | ).get_spherocity_index(), 45 | stko.ShapeResults(shape_calc.calculate(mol)).get_eccentricity(), 46 | ) 47 | 48 | 49 | if __name__ == "__main__": 50 | main() 51 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/original.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 24 25 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 4.0824 -1.3099 0.4629 0 9 | M V30 2 C 4.6658 -0.4511 -0.4379 0 10 | M V30 3 C 3.8411 0.4481 -1.1137 0 11 | M V30 4 N 2.5144 0.5002 -0.9148 0 12 | M V30 5 C 1.9204 -0.3263 -0.0419 0 13 | M V30 6 C 2.7224 -1.2276 0.6402 0 14 | M V30 7 C 0.4780 -0.2936 0.1966 0 15 | M V30 8 N -0.2590 0.5410 -0.4359 0 16 | M V30 9 C -1.6654 0.5662 -0.1974 0 17 | M V30 10 C -2.2443 1.4471 0.6927 0 18 | M V30 11 C -3.6090 1.4746 0.9269 0 19 | M V30 12 C -4.4468 0.5953 0.2553 0 20 | M V30 13 C -3.8757 -0.3046 -0.6508 0 21 | M V30 14 C -2.5045 -0.3048 -0.8612 0 22 | M V30 15 Br -6.3207 0.6099 0.5558 0 23 | M V30 16 H 4.6997 -2.0112 0.9948 0 24 | M V30 17 H 5.7451 -0.4793 -0.6128 0 25 | M V30 18 H 4.3430 1.1168 -1.8240 0 26 | M V30 19 H 2.2130 -1.8924 1.3483 0 27 | M V30 20 H 0.0609 -0.9857 0.9125 0 28 | M V30 21 H -1.6083 2.1310 1.2174 0 29 | M V30 22 H -4.0685 2.1725 1.6322 0 30 | M V30 23 H -4.5508 -0.9796 -1.1614 0 31 | M V30 24 H -2.1332 -1.0367 -1.5839 0 32 | M V30 END ATOM 33 | M V30 BEGIN BOND 34 | M V30 1 2 1 2 35 | M V30 2 1 2 3 36 | M V30 3 2 3 4 37 | M V30 4 1 4 5 38 | M V30 5 2 5 6 39 | M V30 6 1 5 7 40 | M V30 7 2 7 8 41 | M V30 8 1 8 9 42 | M V30 9 2 9 10 43 | M V30 10 1 10 11 44 | M V30 11 2 11 12 45 | M V30 12 1 12 13 46 | M V30 13 2 13 14 47 | M V30 14 1 12 15 48 | M V30 15 1 6 1 49 | M V30 16 1 14 9 50 | M V30 17 1 1 16 51 | M V30 18 1 2 17 52 | M V30 19 1 3 18 53 | M V30 20 1 6 19 54 | M V30 21 1 7 20 55 | M V30 22 1 10 21 56 | M V30 23 1 11 22 57 | M V30 24 1 13 23 58 | M V30 25 1 14 24 59 | M V30 END BOND 60 | M V30 END CTAB 61 | M END 62 | 63 | $$$$ 64 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/reconstructed.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 24 25 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -4.7748 0.5299 0.0389 0 9 | M V30 2 C -4.9545 -0.8291 -0.0608 0 10 | M V30 3 C -3.8190 -1.6370 -0.1201 0 11 | M V30 4 N -2.5740 -1.1358 -0.0833 0 12 | M V30 5 C -2.3712 0.1860 0.0136 0 13 | M V30 6 C -3.4865 1.0064 0.0738 0 14 | M V30 7 C -1.0276 0.7619 0.0559 0 15 | M V30 8 N 0.0000 0.0000 0.0000 0 16 | M V30 9 H -5.6365 1.1711 0.0860 0 17 | M V30 10 H -5.9613 -1.2553 -0.0920 0 18 | M V30 11 H -4.0028 -2.7157 -0.1992 0 19 | M V30 12 H -3.2943 2.0832 0.1528 0 20 | M V30 13 H -0.9318 1.8344 0.1345 0 21 | M V30 14 C 7.2375 -0.0000 0.0000 0 22 | M V30 15 C 7.9608 0.7668 -0.8900 0 23 | M V30 16 C 9.3456 0.7783 -0.9034 0 24 | M V30 17 C 10.0556 -0.0000 0.0000 0 25 | M V30 18 C 9.3371 -0.7835 0.9094 0 26 | M V30 19 C 7.9501 -0.7711 0.8950 0 27 | M V30 20 Br 11.9535 -0.0043 0.0050 0 28 | M V30 21 H 7.4245 1.3720 -1.5925 0 29 | M V30 22 H 9.9197 1.3858 -1.6085 0 30 | M V30 23 H 9.9145 -1.3812 1.6032 0 31 | M V30 24 H 7.4599 -1.4092 1.6357 0 32 | M V30 END ATOM 33 | M V30 BEGIN BOND 34 | M V30 1 1 1 2 35 | M V30 2 1 2 3 36 | M V30 3 1 3 4 37 | M V30 4 1 4 5 38 | M V30 5 1 5 6 39 | M V30 6 1 5 7 40 | M V30 7 2 7 8 41 | M V30 8 1 6 1 42 | M V30 9 1 1 9 43 | M V30 10 1 2 10 44 | M V30 11 1 3 11 45 | M V30 12 1 6 12 46 | M V30 13 1 7 13 47 | M V30 14 1 14 15 48 | M V30 15 1 15 16 49 | M V30 16 1 16 17 50 | M V30 17 1 17 18 51 | M V30 18 1 18 19 52 | M V30 19 1 17 20 53 | M V30 20 1 19 14 54 | M V30 21 1 15 21 55 | M V30 22 1 16 22 56 | M V30 23 1 18 23 57 | M V30 24 1 19 24 58 | M V30 25 1 8 14 59 | M V30 END BOND 60 | M V30 END CTAB 61 | M END 62 | 63 | $$$$ 64 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits2_0.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 12 12 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -7.2688 -3.8503 -0.6182 0 9 | M V30 2 C -6.2891 -4.1670 -1.5487 0 10 | M V30 3 C -5.0694 -3.5345 -1.4319 0 11 | M V30 4 C -4.8035 -2.6142 -0.4347 0 12 | M V30 5 C -5.8293 -2.3330 0.4770 0 13 | M V30 6 C -7.0522 -2.9423 0.3908 0 14 | M V30 7 H -8.2201 -4.3434 -0.7090 0 15 | M V30 8 H -6.5178 -4.8880 -2.3187 0 16 | M V30 9 H -4.2858 -3.7654 -2.1483 0 17 | M V30 10 H -5.6401 -1.6118 1.2690 0 18 | M V30 11 H -7.8202 -2.7059 1.1055 0 19 | M V30 12 Br -3.5374 -1.9499 -0.3037 0 20 | M V30 END ATOM 21 | M V30 BEGIN BOND 22 | M V30 1 2 1 2 23 | M V30 2 1 2 3 24 | M V30 3 2 3 4 25 | M V30 4 1 4 5 26 | M V30 5 2 5 6 27 | M V30 6 1 6 1 28 | M V30 7 1 1 7 29 | M V30 8 1 2 8 30 | M V30 9 1 3 9 31 | M V30 10 1 5 10 32 | M V30 11 1 6 11 33 | M V30 12 1 4 12 34 | M V30 END BOND 35 | M V30 END CTAB 36 | M END 37 | 38 | $$$$ 39 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits2_0.xyz: -------------------------------------------------------------------------------- 1 | 12 2 | 3 | C 5.317606 -4.889049 3.689437 4 | C 4.050656 -4.494193 4.082356 5 | C 3.280315 -3.751623 3.272784 6 | C 3.765871 -3.377589 2.002755 7 | C 4.987648 -3.759818 1.599464 8 | C 5.746616 -4.515622 2.471484 9 | H 5.863102 -5.465330 4.431344 10 | H 3.666954 -4.777428 5.074523 11 | H 2.283888 -3.430895 3.539764 12 | H 5.382790 -3.474743 0.614929 13 | H 6.754329 -4.805408 2.151574 14 | Du 2.877042 -2.442922 1.268696 15 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits2_1.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 4 3 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -3.5374 -1.9499 -0.3037 0 9 | M V30 2 C -2.4720 -1.3801 -0.2076 0 10 | M V30 3 Br -4.8035 -2.6142 -0.4347 0 11 | M V30 4 Br -1.2074 -0.7108 -0.0983 0 12 | M V30 END ATOM 13 | M V30 BEGIN BOND 14 | M V30 1 3 1 2 15 | M V30 2 1 3 1 16 | M V30 3 1 2 4 17 | M V30 END BOND 18 | M V30 END CTAB 19 | M END 20 | 21 | $$$$ 22 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits2_1.xyz: -------------------------------------------------------------------------------- 1 | 4 2 | 3 | C 2.877042 -2.442922 1.268696 4 | C 2.109611 -1.662794 0.650131 5 | Du 3.765871 -3.377589 2.002755 6 | Du 1.284216 -0.799807 -0.041398 7 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits2_2.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 12 12 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -1.2074 -0.7108 -0.0983 0 9 | M V30 2 C -0.0116 -1.3231 -0.3927 0 10 | M V30 3 C 1.1833 -0.6524 -0.2771 0 11 | M V30 4 C 1.1689 0.6558 0.1420 0 12 | M V30 5 C 0.0002 1.3095 0.4474 0 13 | M V30 6 C -1.1847 0.6158 0.3237 0 14 | M V30 7 H -0.0119 -2.3529 -0.7216 0 15 | M V30 8 H -0.0040 2.3364 0.7758 0 16 | M V30 9 Br -2.4720 -1.3801 -0.2076 0 17 | M V30 10 Br -2.4407 1.2415 0.6273 0 18 | M V30 11 Br 2.4537 1.3367 0.2534 0 19 | M V30 12 Br 2.4454 -1.2832 -0.5829 0 20 | M V30 END ATOM 21 | M V30 BEGIN BOND 22 | M V30 1 2 1 2 23 | M V30 2 1 2 3 24 | M V30 3 2 3 4 25 | M V30 4 1 4 5 26 | M V30 5 2 5 6 27 | M V30 6 1 6 1 28 | M V30 7 1 2 7 29 | M V30 8 1 5 8 30 | M V30 9 1 9 1 31 | M V30 10 1 6 10 32 | M V30 11 1 4 11 33 | M V30 12 1 3 12 34 | M V30 END BOND 35 | M V30 END CTAB 36 | M END 37 | 38 | $$$$ 39 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits2_2.xyz: -------------------------------------------------------------------------------- 1 | 12 2 | 3 | C 1.284216 -0.799807 -0.041398 4 | C -0.095370 -1.120724 0.247612 5 | C -1.078796 -0.169268 -0.034072 6 | C -0.814583 1.068668 -0.554098 7 | C 0.516262 1.363249 -0.844494 8 | C 1.557921 0.373021 -0.569725 9 | H -0.355063 -2.064373 0.668118 10 | H 0.750841 2.312562 -1.256451 11 | Du 2.109611 -1.662794 0.650131 12 | Du 2.748231 0.672752 -1.060931 13 | Du -1.871267 1.963658 -0.548616 14 | Du -2.416773 -0.716829 0.133273 15 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits2_3.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 4 3 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -2.4407 1.2415 0.6273 0 9 | M V30 2 C -3.5091 1.7842 0.8675 0 10 | M V30 3 Br -1.1847 0.6158 0.3237 0 11 | M V30 4 Br -4.7742 2.4095 1.1325 0 12 | M V30 END ATOM 13 | M V30 BEGIN BOND 14 | M V30 1 3 1 2 15 | M V30 2 1 3 1 16 | M V30 3 1 2 4 17 | M V30 END BOND 18 | M V30 END CTAB 19 | M END 20 | 21 | $$$$ 22 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits2_3.xyz: -------------------------------------------------------------------------------- 1 | 4 2 | 3 | C 2.748231 0.672752 -1.060931 4 | C 3.982079 0.977168 -1.589580 5 | Du 1.557921 0.373021 -0.569725 6 | Du 5.218354 1.301794 -2.109892 7 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits2_4.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 12 12 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -4.7742 2.4095 1.1325 0 9 | M V30 2 C -5.1179 2.6877 2.4238 0 10 | M V30 3 C -6.3353 3.2872 2.6531 0 11 | M V30 4 C -7.1990 3.6073 1.6312 0 12 | M V30 5 C -6.8629 3.3316 0.3275 0 13 | M V30 6 C -5.6409 2.7297 0.0951 0 14 | M V30 7 H -4.4314 2.4324 3.2271 0 15 | M V30 8 H -6.6029 3.5048 3.6702 0 16 | M V30 9 H -8.1456 4.0750 1.8279 0 17 | M V30 10 H -7.5118 3.5661 -0.5082 0 18 | M V30 11 H -5.3923 2.5191 -0.9445 0 19 | M V30 12 Br -3.5091 1.7842 0.8675 0 20 | M V30 END ATOM 21 | M V30 BEGIN BOND 22 | M V30 1 2 1 2 23 | M V30 2 1 2 3 24 | M V30 3 2 3 4 25 | M V30 4 1 4 5 26 | M V30 5 2 5 6 27 | M V30 6 1 6 1 28 | M V30 7 1 2 7 29 | M V30 8 1 3 8 30 | M V30 9 1 4 9 31 | M V30 10 1 5 10 32 | M V30 11 1 6 11 33 | M V30 12 1 12 1 34 | M V30 END BOND 35 | M V30 END CTAB 36 | M END 37 | 38 | $$$$ 39 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits2_4.xyz: -------------------------------------------------------------------------------- 1 | 12 2 | 3 | C 5.218354 1.301794 -2.109892 4 | C 5.383277 2.498010 -2.773169 5 | C 6.573469 2.861264 -3.317564 6 | C 7.643138 2.029164 -3.202989 7 | C 7.528721 0.817756 -2.551149 8 | C 6.301777 0.479678 -2.009197 9 | H 4.507804 3.150954 -2.840747 10 | H 6.581938 3.834959 -3.823110 11 | H 8.584967 2.336920 -3.643990 12 | H 8.382376 0.192382 -2.493064 13 | H 6.231303 -0.486128 -1.483141 14 | Du 3.982079 0.977168 -1.589580 15 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits2_5.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 4 3 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 2.4537 1.3367 0.2534 0 9 | M V30 2 C 3.5084 1.9109 0.3611 0 10 | M V30 3 Br 1.1689 0.6558 0.1420 0 11 | M V30 4 Br 4.7711 2.5832 0.4805 0 12 | M V30 END ATOM 13 | M V30 BEGIN BOND 14 | M V30 1 3 1 2 15 | M V30 2 1 3 1 16 | M V30 3 1 2 4 17 | M V30 END BOND 18 | M V30 END CTAB 19 | M END 20 | 21 | $$$$ 22 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits2_5.xyz: -------------------------------------------------------------------------------- 1 | 4 2 | 3 | C -1.871267 1.963658 -0.548616 4 | C -2.815817 2.778991 -0.558990 5 | Du -0.814583 1.068668 -0.554098 6 | Du -3.931280 3.716638 -0.572830 7 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits2_6.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 12 12 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 4.7711 2.5832 0.4805 0 9 | M V30 2 C 5.3653 2.8744 1.6974 0 10 | M V30 3 C 6.5775 3.5202 1.7900 0 11 | M V30 4 C 7.2488 3.9037 0.6575 0 12 | M V30 5 C 6.6897 3.6315 -0.5672 0 13 | M V30 6 C 5.4763 2.9844 -0.6352 0 14 | M V30 7 H 4.8433 2.5756 2.6041 0 15 | M V30 8 H 7.0252 3.7387 2.7461 0 16 | M V30 9 H 8.2101 4.4161 0.7230 0 17 | M V30 10 H 7.1791 3.9134 -1.5015 0 18 | M V30 11 H 5.0024 2.7519 -1.5923 0 19 | M V30 12 Br 3.5084 1.9109 0.3611 0 20 | M V30 END ATOM 21 | M V30 BEGIN BOND 22 | M V30 1 2 1 2 23 | M V30 2 1 2 3 24 | M V30 3 2 3 4 25 | M V30 4 1 4 5 26 | M V30 5 2 5 6 27 | M V30 6 1 6 1 28 | M V30 7 1 2 7 29 | M V30 8 1 3 8 30 | M V30 9 1 4 9 31 | M V30 10 1 5 10 32 | M V30 11 1 6 11 33 | M V30 12 1 12 1 34 | M V30 END BOND 35 | M V30 END CTAB 36 | M END 37 | 38 | $$$$ 39 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits2_6.xyz: -------------------------------------------------------------------------------- 1 | 12 2 | 3 | C -3.931280 3.716638 -0.572830 4 | C -4.259179 4.524398 -1.576979 5 | C -5.337405 5.432699 -1.557432 6 | C -6.050247 5.411306 -0.341532 7 | C -5.761515 4.627169 0.679210 8 | C -4.701138 3.751084 0.616145 9 | H -3.657813 4.513243 -2.512328 10 | H -5.574269 6.045320 -2.338735 11 | H -6.897479 6.115768 -0.347414 12 | H -6.349325 4.631879 1.612180 13 | H -4.409603 3.090879 1.417100 14 | Du -2.815817 2.778991 -0.558990 15 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits2_7.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 4 3 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 2.4454 -1.2832 -0.5829 0 9 | M V30 2 C 3.5114 -1.8034 -0.8515 0 10 | M V30 3 Br 1.1833 -0.6524 -0.2771 0 11 | M V30 4 Br 4.7802 -2.4094 -1.1479 0 12 | M V30 END ATOM 13 | M V30 BEGIN BOND 14 | M V30 1 3 1 2 15 | M V30 2 1 3 1 16 | M V30 3 1 2 4 17 | M V30 END BOND 18 | M V30 END CTAB 19 | M END 20 | 21 | $$$$ 22 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits2_7.xyz: -------------------------------------------------------------------------------- 1 | 4 2 | 3 | C -2.416773 -0.716829 0.133273 4 | C -3.541617 -1.195352 0.287236 5 | Du -1.078796 -0.169268 -0.034072 6 | Du -4.826643 -1.748460 0.466831 7 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits2_8.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 12 12 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 4.7802 -2.4094 -1.1479 0 9 | M V30 2 C 4.8922 -3.7587 -1.4198 0 10 | M V30 3 C 6.1051 -4.3552 -1.7064 0 11 | M V30 4 C 7.2471 -3.5637 -1.7197 0 12 | M V30 5 C 7.1734 -2.2182 -1.4539 0 13 | M V30 6 C 5.9407 -1.6610 -1.1719 0 14 | M V30 7 H 4.0114 -4.4039 -1.4162 0 15 | M V30 8 H 6.1648 -5.4164 -1.9162 0 16 | M V30 9 H 8.2075 -4.0194 -1.9434 0 17 | M V30 10 H 8.0769 -1.6185 -1.4694 0 18 | M V30 11 H 5.9300 -0.5984 -0.9689 0 19 | M V30 12 Br 3.5114 -1.8034 -0.8515 0 20 | M V30 END ATOM 21 | M V30 BEGIN BOND 22 | M V30 1 2 1 2 23 | M V30 2 1 2 3 24 | M V30 3 2 3 4 25 | M V30 4 1 4 5 26 | M V30 5 2 5 6 27 | M V30 6 1 6 1 28 | M V30 7 1 2 7 29 | M V30 8 1 3 8 30 | M V30 9 1 4 9 31 | M V30 10 1 5 10 32 | M V30 11 1 6 11 33 | M V30 12 1 12 1 34 | M V30 END BOND 35 | M V30 END CTAB 36 | M END 37 | 38 | $$$$ 39 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits2_8.xyz: -------------------------------------------------------------------------------- 1 | 12 2 | 3 | C -4.826643 -1.748460 0.466831 4 | C -5.667653 -1.831175 -0.623134 5 | C -6.958379 -2.295777 -0.581014 6 | C -7.448034 -2.709251 0.606653 7 | C -6.669091 -2.663651 1.720674 8 | C -5.387585 -2.195739 1.664493 9 | H -5.249620 -1.490281 -1.604981 10 | H -7.533088 -2.311536 -1.520831 11 | H -8.474425 -3.093106 0.673317 12 | H -7.002965 -2.988375 2.713968 13 | H -4.727084 -2.146083 2.527528 14 | Du -3.541617 -1.195352 0.287236 15 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits_0.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 14 14 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 4.0824 -1.3099 0.4629 0 9 | M V30 2 C 4.6658 -0.4511 -0.4379 0 10 | M V30 3 C 3.8411 0.4481 -1.1137 0 11 | M V30 4 N 2.5144 0.5002 -0.9148 0 12 | M V30 5 C 1.9204 -0.3263 -0.0419 0 13 | M V30 6 C 2.7224 -1.2276 0.6402 0 14 | M V30 7 C 0.4780 -0.2936 0.1966 0 15 | M V30 8 N -0.2590 0.5410 -0.4359 0 16 | M V30 9 H 4.6997 -2.0112 0.9948 0 17 | M V30 10 H 5.7451 -0.4793 -0.6128 0 18 | M V30 11 H 4.3430 1.1168 -1.8240 0 19 | M V30 12 H 2.2130 -1.8924 1.3483 0 20 | M V30 13 H 0.0609 -0.9857 0.9125 0 21 | M V30 14 DummyAtom -1.6654 0.5662 -0.1974 0 22 | M V30 END ATOM 23 | M V30 BEGIN BOND 24 | M V30 1 1 1 2 25 | M V30 2 1 2 3 26 | M V30 3 1 3 4 27 | M V30 4 1 4 5 28 | M V30 5 1 5 6 29 | M V30 6 1 5 7 30 | M V30 7 2 7 8 31 | M V30 8 1 6 1 32 | M V30 9 1 1 9 33 | M V30 10 1 2 10 34 | M V30 11 1 3 11 35 | M V30 12 1 6 12 36 | M V30 13 1 7 13 37 | M V30 14 1 8 14 38 | M V30 END BOND 39 | M V30 END CTAB 40 | M END 41 | 42 | $$$$ 43 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits_0.xyz: -------------------------------------------------------------------------------- 1 | 14 2 | 3 | C 4.082411 -1.309904 0.462907 4 | C 4.665797 -0.451104 -0.437862 5 | C 3.841118 0.448053 -1.113697 6 | N 2.514351 0.500187 -0.914768 7 | C 1.920434 -0.326253 -0.041892 8 | C 2.722356 -1.227568 0.640178 9 | C 0.477961 -0.293566 0.196554 10 | N -0.259008 0.540954 -0.435909 11 | H 4.699656 -2.011158 0.994833 12 | H 5.745129 -0.479269 -0.612839 13 | H 4.343023 1.116780 -1.823979 14 | H 2.213020 -1.892405 1.348251 15 | H 0.060895 -0.985650 0.912540 16 | Du -1.665373 0.566250 -0.197360 17 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits_1.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 12 12 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -1.6654 0.5662 -0.1974 0 9 | M V30 2 C -2.2443 1.4471 0.6927 0 10 | M V30 3 C -3.6090 1.4746 0.9269 0 11 | M V30 4 C -4.4468 0.5953 0.2553 0 12 | M V30 5 C -3.8757 -0.3046 -0.6508 0 13 | M V30 6 C -2.5045 -0.3048 -0.8612 0 14 | M V30 7 Br -6.3207 0.6099 0.5558 0 15 | M V30 8 H -1.6083 2.1310 1.2174 0 16 | M V30 9 H -4.0685 2.1725 1.6322 0 17 | M V30 10 H -4.5508 -0.9796 -1.1614 0 18 | M V30 11 H -2.1332 -1.0367 -1.5839 0 19 | M V30 12 DummyAtom -0.2590 0.5410 -0.4359 0 20 | M V30 END ATOM 21 | M V30 BEGIN BOND 22 | M V30 1 1 1 2 23 | M V30 2 1 2 3 24 | M V30 3 1 3 4 25 | M V30 4 1 4 5 26 | M V30 5 1 5 6 27 | M V30 6 1 4 7 28 | M V30 7 1 6 1 29 | M V30 8 1 2 8 30 | M V30 9 1 3 9 31 | M V30 10 1 5 10 32 | M V30 11 1 6 11 33 | M V30 12 1 12 1 34 | M V30 END BOND 35 | M V30 END CTAB 36 | M END 37 | 38 | $$$$ 39 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/splits_1.xyz: -------------------------------------------------------------------------------- 1 | 12 2 | 3 | C -1.665373 0.566250 -0.197360 4 | C -2.244261 1.447139 0.692729 5 | C -3.608964 1.474583 0.926860 6 | C -4.446788 0.595270 0.255339 7 | C -3.875694 -0.304621 -0.650837 8 | C -2.504532 -0.304811 -0.861165 9 | Br -6.320696 0.609886 0.555842 10 | H -1.608277 2.131004 1.217378 11 | H -4.068512 2.172490 1.632189 12 | H -4.550839 -0.979550 -1.161353 13 | H -2.133207 -1.036735 -1.583940 14 | Du -0.259008 0.540954 -0.435909 15 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/transform2_0.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 12 12 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 5.3176 -4.8890 3.6894 0 9 | M V30 2 C 4.0507 -4.4942 4.0824 0 10 | M V30 3 C 3.2803 -3.7516 3.2728 0 11 | M V30 4 C 3.7659 -3.3776 2.0028 0 12 | M V30 5 C 4.9876 -3.7598 1.5995 0 13 | M V30 6 C 5.7466 -4.5156 2.4715 0 14 | M V30 7 H 5.8631 -5.4653 4.4313 0 15 | M V30 8 H 3.6670 -4.7774 5.0745 0 16 | M V30 9 H 2.2839 -3.4309 3.5398 0 17 | M V30 10 H 5.3828 -3.4747 0.6149 0 18 | M V30 11 H 6.7543 -4.8054 2.1516 0 19 | M V30 12 Br 2.8770 -2.4429 1.2687 0 20 | M V30 END ATOM 21 | M V30 BEGIN BOND 22 | M V30 1 1 1 2 23 | M V30 2 1 2 3 24 | M V30 3 1 3 4 25 | M V30 4 1 4 5 26 | M V30 5 1 5 6 27 | M V30 6 1 6 1 28 | M V30 7 1 1 7 29 | M V30 8 1 2 8 30 | M V30 9 1 3 9 31 | M V30 10 1 5 10 32 | M V30 11 1 6 11 33 | M V30 12 1 4 12 34 | M V30 END BOND 35 | M V30 END CTAB 36 | M END 37 | 38 | $$$$ 39 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/transform2_1.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 4 3 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 2.8770 -2.4429 1.2687 0 9 | M V30 2 C 2.1096 -1.6628 0.6501 0 10 | M V30 3 Br 3.7659 -3.3776 2.0028 0 11 | M V30 4 Br 1.2842 -0.7998 -0.0414 0 12 | M V30 END ATOM 13 | M V30 BEGIN BOND 14 | M V30 1 3 1 2 15 | M V30 2 1 3 1 16 | M V30 3 1 2 4 17 | M V30 END BOND 18 | M V30 END CTAB 19 | M END 20 | 21 | $$$$ 22 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/transform2_2.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 12 12 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 1.2842 -0.7998 -0.0414 0 9 | M V30 2 C -0.0954 -1.1207 0.2476 0 10 | M V30 3 C -1.0788 -0.1693 -0.0341 0 11 | M V30 4 C -0.8146 1.0687 -0.5541 0 12 | M V30 5 C 0.5163 1.3632 -0.8445 0 13 | M V30 6 C 1.5579 0.3730 -0.5697 0 14 | M V30 7 H -0.3551 -2.0644 0.6681 0 15 | M V30 8 H 0.7508 2.3126 -1.2565 0 16 | M V30 9 Br 2.1096 -1.6628 0.6501 0 17 | M V30 10 Br 2.7482 0.6728 -1.0609 0 18 | M V30 11 Br -1.8713 1.9637 -0.5486 0 19 | M V30 12 Br -2.4168 -0.7168 0.1333 0 20 | M V30 END ATOM 21 | M V30 BEGIN BOND 22 | M V30 1 1 1 2 23 | M V30 2 1 2 3 24 | M V30 3 1 3 4 25 | M V30 4 1 4 5 26 | M V30 5 1 5 6 27 | M V30 6 1 6 1 28 | M V30 7 1 2 7 29 | M V30 8 1 5 8 30 | M V30 9 1 9 1 31 | M V30 10 1 6 10 32 | M V30 11 1 4 11 33 | M V30 12 1 3 12 34 | M V30 END BOND 35 | M V30 END CTAB 36 | M END 37 | 38 | $$$$ 39 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/transform2_3.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 4 3 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 2.7482 0.6728 -1.0609 0 9 | M V30 2 C 3.9821 0.9772 -1.5896 0 10 | M V30 3 Br 1.5579 0.3730 -0.5697 0 11 | M V30 4 Br 5.2184 1.3018 -2.1099 0 12 | M V30 END ATOM 13 | M V30 BEGIN BOND 14 | M V30 1 3 1 2 15 | M V30 2 1 3 1 16 | M V30 3 1 2 4 17 | M V30 END BOND 18 | M V30 END CTAB 19 | M END 20 | 21 | $$$$ 22 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/transform2_4.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 12 12 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 5.2184 1.3018 -2.1099 0 9 | M V30 2 C 5.3833 2.4980 -2.7732 0 10 | M V30 3 C 6.5735 2.8613 -3.3176 0 11 | M V30 4 C 7.6431 2.0292 -3.2030 0 12 | M V30 5 C 7.5287 0.8178 -2.5511 0 13 | M V30 6 C 6.3018 0.4797 -2.0092 0 14 | M V30 7 H 4.5078 3.1510 -2.8407 0 15 | M V30 8 H 6.5819 3.8350 -3.8231 0 16 | M V30 9 H 8.5850 2.3369 -3.6440 0 17 | M V30 10 H 8.3824 0.1924 -2.4931 0 18 | M V30 11 H 6.2313 -0.4861 -1.4831 0 19 | M V30 12 Br 3.9821 0.9772 -1.5896 0 20 | M V30 END ATOM 21 | M V30 BEGIN BOND 22 | M V30 1 1 1 2 23 | M V30 2 1 2 3 24 | M V30 3 1 3 4 25 | M V30 4 1 4 5 26 | M V30 5 1 5 6 27 | M V30 6 1 6 1 28 | M V30 7 1 2 7 29 | M V30 8 1 3 8 30 | M V30 9 1 4 9 31 | M V30 10 1 5 10 32 | M V30 11 1 6 11 33 | M V30 12 1 12 1 34 | M V30 END BOND 35 | M V30 END CTAB 36 | M END 37 | 38 | $$$$ 39 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/transform2_5.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 4 3 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -1.8713 1.9637 -0.5486 0 9 | M V30 2 C -2.8158 2.7790 -0.5590 0 10 | M V30 3 Br -0.8146 1.0687 -0.5541 0 11 | M V30 4 Br -3.9313 3.7166 -0.5728 0 12 | M V30 END ATOM 13 | M V30 BEGIN BOND 14 | M V30 1 3 1 2 15 | M V30 2 1 3 1 16 | M V30 3 1 2 4 17 | M V30 END BOND 18 | M V30 END CTAB 19 | M END 20 | 21 | $$$$ 22 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/transform2_6.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 12 12 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -3.9313 3.7166 -0.5728 0 9 | M V30 2 C -4.2592 4.5244 -1.5770 0 10 | M V30 3 C -5.3374 5.4327 -1.5574 0 11 | M V30 4 C -6.0502 5.4113 -0.3415 0 12 | M V30 5 C -5.7615 4.6272 0.6792 0 13 | M V30 6 C -4.7011 3.7511 0.6161 0 14 | M V30 7 H -3.6578 4.5132 -2.5123 0 15 | M V30 8 H -5.5743 6.0453 -2.3387 0 16 | M V30 9 H -6.8975 6.1158 -0.3474 0 17 | M V30 10 H -6.3493 4.6319 1.6122 0 18 | M V30 11 H -4.4096 3.0909 1.4171 0 19 | M V30 12 Br -2.8158 2.7790 -0.5590 0 20 | M V30 END ATOM 21 | M V30 BEGIN BOND 22 | M V30 1 1 1 2 23 | M V30 2 1 2 3 24 | M V30 3 1 3 4 25 | M V30 4 1 4 5 26 | M V30 5 1 5 6 27 | M V30 6 1 6 1 28 | M V30 7 1 2 7 29 | M V30 8 1 3 8 30 | M V30 9 1 4 9 31 | M V30 10 1 5 10 32 | M V30 11 1 6 11 33 | M V30 12 1 12 1 34 | M V30 END BOND 35 | M V30 END CTAB 36 | M END 37 | 38 | $$$$ 39 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/transform2_7.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 4 3 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -2.4168 -0.7168 0.1333 0 9 | M V30 2 C -3.5416 -1.1954 0.2872 0 10 | M V30 3 Br -1.0788 -0.1693 -0.0341 0 11 | M V30 4 Br -4.8266 -1.7485 0.4668 0 12 | M V30 END ATOM 13 | M V30 BEGIN BOND 14 | M V30 1 3 1 2 15 | M V30 2 1 3 1 16 | M V30 3 1 2 4 17 | M V30 END BOND 18 | M V30 END CTAB 19 | M END 20 | 21 | $$$$ 22 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/transform2_8.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 12 12 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -4.8266 -1.7485 0.4668 0 9 | M V30 2 C -5.6677 -1.8312 -0.6231 0 10 | M V30 3 C -6.9584 -2.2958 -0.5810 0 11 | M V30 4 C -7.4480 -2.7093 0.6067 0 12 | M V30 5 C -6.6691 -2.6637 1.7207 0 13 | M V30 6 C -5.3876 -2.1957 1.6645 0 14 | M V30 7 H -5.2496 -1.4903 -1.6050 0 15 | M V30 8 H -7.5331 -2.3115 -1.5208 0 16 | M V30 9 H -8.4744 -3.0931 0.6733 0 17 | M V30 10 H -7.0030 -2.9884 2.7140 0 18 | M V30 11 H -4.7271 -2.1461 2.5275 0 19 | M V30 12 Br -3.5416 -1.1954 0.2872 0 20 | M V30 END ATOM 21 | M V30 BEGIN BOND 22 | M V30 1 1 1 2 23 | M V30 2 1 2 3 24 | M V30 3 1 3 4 25 | M V30 4 1 4 5 26 | M V30 5 1 5 6 27 | M V30 6 1 6 1 28 | M V30 7 1 2 7 29 | M V30 8 1 3 8 30 | M V30 9 1 4 9 31 | M V30 10 1 5 10 32 | M V30 11 1 6 11 33 | M V30 12 1 12 1 34 | M V30 END BOND 35 | M V30 END CTAB 36 | M END 37 | 38 | $$$$ 39 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/transform_0.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 14 14 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C 4.0824 -1.3099 0.4629 0 9 | M V30 2 C 4.6658 -0.4511 -0.4379 0 10 | M V30 3 C 3.8411 0.4481 -1.1137 0 11 | M V30 4 N 2.5144 0.5002 -0.9148 0 12 | M V30 5 C 1.9204 -0.3263 -0.0419 0 13 | M V30 6 C 2.7224 -1.2276 0.6402 0 14 | M V30 7 C 0.4780 -0.2936 0.1966 0 15 | M V30 8 N -0.2590 0.5410 -0.4359 0 16 | M V30 9 H 4.6997 -2.0112 0.9948 0 17 | M V30 10 H 5.7451 -0.4793 -0.6128 0 18 | M V30 11 H 4.3430 1.1168 -1.8240 0 19 | M V30 12 H 2.2130 -1.8924 1.3483 0 20 | M V30 13 H 0.0609 -0.9857 0.9125 0 21 | M V30 14 Br -1.6654 0.5662 -0.1974 0 22 | M V30 END ATOM 23 | M V30 BEGIN BOND 24 | M V30 1 1 1 2 25 | M V30 2 1 2 3 26 | M V30 3 1 3 4 27 | M V30 4 1 4 5 28 | M V30 5 1 5 6 29 | M V30 6 1 5 7 30 | M V30 7 2 7 8 31 | M V30 8 1 6 1 32 | M V30 9 1 1 9 33 | M V30 10 1 2 10 34 | M V30 11 1 3 11 35 | M V30 12 1 6 12 36 | M V30 13 1 7 13 37 | M V30 14 1 8 14 38 | M V30 END BOND 39 | M V30 END CTAB 40 | M END 41 | 42 | $$$$ 43 | -------------------------------------------------------------------------------- /examples/splitter_output_directory/transform_1.mol: -------------------------------------------------------------------------------- 1 | 2 | RDKit 3D 3 | 4 | 0 0 0 0 0 0 0 0 0 0999 V3000 5 | M V30 BEGIN CTAB 6 | M V30 COUNTS 12 12 0 0 0 7 | M V30 BEGIN ATOM 8 | M V30 1 C -1.6654 0.5662 -0.1974 0 9 | M V30 2 C -2.2443 1.4471 0.6927 0 10 | M V30 3 C -3.6090 1.4746 0.9269 0 11 | M V30 4 C -4.4468 0.5953 0.2553 0 12 | M V30 5 C -3.8757 -0.3046 -0.6508 0 13 | M V30 6 C -2.5045 -0.3048 -0.8612 0 14 | M V30 7 Br -6.3207 0.6099 0.5558 0 15 | M V30 8 H -1.6083 2.1310 1.2174 0 16 | M V30 9 H -4.0685 2.1725 1.6322 0 17 | M V30 10 H -4.5508 -0.9796 -1.1614 0 18 | M V30 11 H -2.1332 -1.0367 -1.5839 0 19 | M V30 12 Br -0.2590 0.5410 -0.4359 0 20 | M V30 END ATOM 21 | M V30 BEGIN BOND 22 | M V30 1 1 1 2 23 | M V30 2 1 2 3 24 | M V30 3 1 3 4 25 | M V30 4 1 4 5 26 | M V30 5 1 5 6 27 | M V30 6 1 4 7 28 | M V30 7 1 6 1 29 | M V30 8 1 2 8 30 | M V30 9 1 3 9 31 | M V30 10 1 5 10 32 | M V30 11 1 6 11 33 | M V30 12 1 12 1 34 | M V30 END BOND 35 | M V30 END CTAB 36 | M END 37 | 38 | $$$$ 39 | -------------------------------------------------------------------------------- /examples/testable_example.py: -------------------------------------------------------------------------------- 1 | import contextlib 2 | import logging 3 | import os 4 | from pathlib import Path 5 | 6 | import aligner_example 7 | import basic_example 8 | import cage_analysis_example 9 | import calculators_example 10 | import intermediates_example 11 | import mdanalysis_example 12 | import molecule_splitter_example 13 | import obabel_example 14 | import openmm_example 15 | import optwrite_example 16 | import shape_example 17 | import topology_extraction_example 18 | import torsion_example 19 | import zmatrix_example 20 | 21 | from stko import WrapperNotInstalledError 22 | 23 | logger = logging.getLogger(__name__) 24 | 25 | 26 | def main() -> None: 27 | """Run the example.""" 28 | init_dir = Path.cwd() 29 | os.chdir("examples/") 30 | 31 | try: 32 | intermediates_example.main() 33 | aligner_example.main() 34 | basic_example.main() 35 | cage_analysis_example.main() 36 | calculators_example.main() 37 | with contextlib.suppress(WrapperNotInstalledError): 38 | mdanalysis_example.main() 39 | molecule_splitter_example.main() 40 | with contextlib.suppress(WrapperNotInstalledError): 41 | obabel_example.main() 42 | openmm_example.main() 43 | shape_example.main() 44 | topology_extraction_example.main() 45 | torsion_example.main() 46 | zmatrix_example.main() 47 | optwrite_example.main() 48 | logger.info("all examples ran, at least!") 49 | 50 | finally: 51 | os.chdir(init_dir) 52 | 53 | 54 | if __name__ == "__main__": 55 | logging.basicConfig( 56 | level=logging.INFO, 57 | format="%(asctime)s | %(levelname)s | %(message)s", 58 | ) 59 | main() 60 | -------------------------------------------------------------------------------- /examples/topology_extraction_example.py: -------------------------------------------------------------------------------- 1 | # ruff: noqa: T201 2 | from pathlib import Path 3 | 4 | import stk 5 | 6 | import stko 7 | 8 | 9 | def main() -> None: 10 | """Run the example.""" 11 | bb1 = stk.BuildingBlock("NCCN", [stk.PrimaryAminoFactory()]) 12 | bb2 = stk.BuildingBlock( 13 | smiles="O=CC(C=O)C=O", 14 | functional_groups=[stk.AldehydeFactory()], 15 | ) 16 | cage1 = stk.ConstructedMolecule( 17 | topology_graph=stk.cage.FourPlusSix((bb1, bb2)), 18 | ) 19 | 20 | broken_bonds_by_id = [] 21 | disconnectors: set[int] = set() 22 | for bi in cage1.get_bond_infos(): 23 | if bi.get_building_block() is None: 24 | a1id = bi.get_bond().get_atom1().get_id() 25 | a2id = bi.get_bond().get_atom2().get_id() 26 | a, b = sorted((a1id, a2id)) 27 | broken_bonds_by_id.append((a, b)) 28 | disconnectors.update((a1id, a2id)) 29 | 30 | print(broken_bonds_by_id) 31 | print(disconnectors) 32 | print("--") 33 | new_topology_graph = stko.TopologyExtractor() 34 | tg_info = new_topology_graph.extract_topology( 35 | molecule=cage1, 36 | broken_bonds_by_id=broken_bonds_by_id, 37 | disconnectors=disconnectors, 38 | ) 39 | print(tg_info.get_vertex_positions()) 40 | print(tg_info.get_connectivities()) 41 | print(tg_info.get_edge_pairs()) 42 | output_directory = Path("output_directory") 43 | cage1.write(output_directory / "tg_cage.mol") 44 | tg_info.write(output_directory / "tg_info.pdb") 45 | 46 | 47 | if __name__ == "__main__": 48 | main() 49 | -------------------------------------------------------------------------------- /examples/torsion_example.py: -------------------------------------------------------------------------------- 1 | # ruff: noqa: T201 2 | from pathlib import Path 3 | 4 | import stk 5 | 6 | import stko 7 | 8 | 9 | def main() -> None: 10 | """Run the example.""" 11 | bb1 = stk.BuildingBlock("NCCNCCN", [stk.PrimaryAminoFactory()]) 12 | bb2 = stk.BuildingBlock("O=CCCC=O", [stk.AldehydeFactory()]) 13 | polymer = stk.ConstructedMolecule( 14 | stk.polymer.Linear( 15 | building_blocks=(bb1, bb2), 16 | repeating_unit="AB", 17 | orientations=[0, 0], 18 | num_repeating_units=1, 19 | ) 20 | ) 21 | 22 | output_directory = Path("output_directory") 23 | # Run calculations for bb. 24 | bb1.write(output_directory / "tors_test_bb1.mol") 25 | tors_results = stko.TorsionCalculator().get_results(bb1) 26 | print(tors_results.get_molecule()) 27 | for t, ang in tors_results.get_torsion_angles(): 28 | print(t, ang, t.get_atom_ids()) 29 | 30 | # Run calculations for constructed molecule. 31 | polymer.write(output_directory / "tors_test_polymer.mol") 32 | tors_results = stko.ConstructedMoleculeTorsionCalculator().get_results( 33 | polymer 34 | ) 35 | print(tors_results.get_molecule()) 36 | for torsion, ang in tors_results.get_torsion_angles(): 37 | print(torsion, ang, torsion.get_atom_ids()) 38 | for torsion_info in tors_results.get_torsion_infos(): 39 | print( 40 | "c", 41 | torsion_info.get_torsion(), 42 | torsion_info.get_building_block(), 43 | torsion_info.get_building_block_id(), 44 | torsion_info.get_building_block_torsion(), 45 | ) 46 | print(tors_results.get_torsion_infos_by_building_block()) 47 | for torsion_info in tors_results.get_torsion_infos(): 48 | print(stko.get_torsion_info_angles(polymer, torsion_info)) 49 | 50 | 51 | if __name__ == "__main__": 52 | main() 53 | -------------------------------------------------------------------------------- /examples/zmatrix_example.py: -------------------------------------------------------------------------------- 1 | # ruff: noqa: T201 2 | from pathlib import Path 3 | 4 | import stk 5 | 6 | import stko 7 | 8 | 9 | def main() -> None: 10 | """Run the example.""" 11 | bb1 = stk.BuildingBlock("NCCNCCN", [stk.PrimaryAminoFactory()]) 12 | bb2 = stk.BuildingBlock("O=CCCC=O", [stk.AldehydeFactory()]) 13 | polymer = stk.ConstructedMolecule( 14 | stk.polymer.Linear( 15 | building_blocks=(bb1, bb2), 16 | repeating_unit="AB", 17 | orientations=(0, 0), 18 | num_repeating_units=1, 19 | ) 20 | ) 21 | 22 | examples_output = Path("output_directory") 23 | examples_output.mkdir(parents=True, exist_ok=True) 24 | 25 | print(stko.ZMatrix().get_zmatrix(bb1)) 26 | bb1.write(examples_output / "bb1.mol") 27 | print(stko.ZMatrix().get_zmatrix(bb2)) 28 | bb2.write(examples_output / "bb2.mol") 29 | print(stko.ZMatrix().get_zmatrix(polymer)) 30 | polymer.write(examples_output / "polymer.mol") 31 | 32 | 33 | if __name__ == "__main__": 34 | main() 35 | -------------------------------------------------------------------------------- /justfile: -------------------------------------------------------------------------------- 1 | # List all recipes. 2 | default: 3 | @just --list 4 | 5 | # Build docs. 6 | docs: 7 | rm -rf ./docs/build docs/source/_autosummary 8 | make -C docs html 9 | echo Docs are in $PWD/docs/build/html/index.html 10 | 11 | # Install development environment. 12 | dev: 13 | pip install -e '.[dev]' 14 | mamba install -y -c conda-forge pytorch==2.3.1 torchdata==0.7.1 openff-toolkit openmm openmmtools rdkit!=2024.3.5 dgl espaloma_charge 15 | mamba install -y xtb 16 | mamba install -y openbabel 17 | mamba install -y mdanalysis 18 | 19 | 20 | # Run code checks. 21 | check: 22 | #!/usr/bin/env bash 23 | 24 | error=0 25 | trap error=1 ERR 26 | 27 | echo 28 | (set -x; ruff check . ) 29 | 30 | echo 31 | ( set -x; ruff format --check . ) 32 | 33 | echo 34 | ( set -x; mypy src examples ) 35 | 36 | echo 37 | ( set -x; pytest --cov=stko --cov-report term-missing ) 38 | 39 | echo 40 | ( set -x; make -C docs doctest ) 41 | 42 | test $error = 0 43 | 44 | # Auto-fix code issues. 45 | fix: 46 | ruff format . 47 | ruff check --fix . 48 | -------------------------------------------------------------------------------- /mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | show_error_codes = true 3 | implicit_optional = false 4 | warn_no_return = true 5 | strict_optional = true 6 | disallow_untyped_defs = true 7 | disallow_incomplete_defs = true 8 | check_untyped_defs = true 9 | disallow_untyped_decorators = true 10 | warn_unreachable = true 11 | disallow_any_generics = false 12 | 13 | [mypy-rdkit.*] 14 | follow_imports = skip 15 | follow_imports_for_stubs = True 16 | 17 | [mypy-scipy.*] 18 | ignore_missing_imports = True 19 | 20 | [mypy-openbabel.*] 21 | ignore_missing_imports = True 22 | 23 | [mypy-openmm.*] 24 | ignore_missing_imports = True 25 | 26 | [mypy-rmsd.*] 27 | ignore_missing_imports = True 28 | 29 | [mypy-espaloma_charge.*] 30 | ignore_missing_imports = True 31 | 32 | [mypy-openff.*] 33 | ignore_missing_imports = True 34 | 35 | [mypy-MDAnalysis.*] 36 | ignore_missing_imports = True 37 | 38 | [mypy-networkx.*] 39 | ignore_missing_imports = True 40 | 41 | [mypy-spindry.*] 42 | ignore_missing_imports = True 43 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools", "setuptools-scm"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "stko" 7 | maintainers = [ 8 | { name = "Andrew Tarzia", email = "andrew.tarzia@gmail.com" }, 9 | { name = "Lukas Turcani", email = "lukasturcani93@gmail.com" }, 10 | ] 11 | dependencies = [ 12 | "numpy<2", 13 | # Pinned while rdkit changes stk results. 14 | "rdkit == 2024.3.4", 15 | "stk", 16 | "networkx", 17 | "rmsd", 18 | ] 19 | requires-python = ">=3.11" 20 | dynamic = ["version"] 21 | readme = "README.rst" 22 | 23 | [project.optional-dependencies] 24 | dev = [ 25 | "ruff", 26 | "mypy", 27 | "moldoc==3.0.0", 28 | # TODO: Remove pin when https://github.com/TvoroG/pytest-lazy-fixture/issues/65 is resolved. 29 | # pytest-lazy-fixture 0.6.0 is incompatible with pytest 8.0.0 30 | "pytest<8", 31 | "pytest-datadir", 32 | "pytest-lazy-fixture", 33 | "pytest-cov", 34 | "sphinx", 35 | "sphinx-copybutton", 36 | "sphinx-rtd-theme", 37 | "twine", 38 | "build", 39 | ] 40 | 41 | [project.urls] 42 | github = "https://github.com/JelfsMaterialsGroup/stko" 43 | documentation = "https://stko-docs.readthedocs.io" 44 | 45 | [tool.setuptools_scm] 46 | write_to = "src/stko/_version.py" 47 | 48 | [tool.setuptools.packages.find] 49 | where = [ 50 | # list of folders that contain the packages (["."] by default) 51 | "src", 52 | ] 53 | 54 | [tool.ruff] 55 | line-length = 79 56 | 57 | [tool.ruff.lint] 58 | ignore = ["ANN401", "COM812", "ISC001", "FBT001", "FBT002"] 59 | select = ["ALL"] 60 | 61 | [tool.ruff.lint.pydocstyle] 62 | convention = "google" 63 | 64 | [tool.ruff.lint.per-file-ignores] 65 | "examples/*" = ["D100", "INP001"] 66 | "tests/*" = [ 67 | "D100", 68 | "D101", 69 | "D102", 70 | "D103", 71 | "D104", 72 | "D105", 73 | "D106", 74 | "D107", 75 | "S101", 76 | "INP001", 77 | ] 78 | "docs/source/conf.py" = ["D100", "INP001"] 79 | 80 | [tool.pytest.ini_options] 81 | testpaths = ["tests"] 82 | python_files = ["test_*.py", "*_test.py"] 83 | python_functions = ["test_*"] 84 | -------------------------------------------------------------------------------- /src/stko/_internal/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/src/stko/_internal/__init__.py -------------------------------------------------------------------------------- /src/stko/_internal/calculators/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/src/stko/_internal/calculators/__init__.py -------------------------------------------------------------------------------- /src/stko/_internal/calculators/extractors/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/src/stko/_internal/calculators/extractors/__init__.py -------------------------------------------------------------------------------- /src/stko/_internal/calculators/extractors/utilities.py: -------------------------------------------------------------------------------- 1 | def check_line(line: str, option: str, options_dict: dict[str, str]) -> bool: 2 | """Checks a line for a string based on option. 3 | 4 | Parameters: 5 | line: 6 | Line of output file to check. 7 | 8 | option: 9 | Define which property and string being checked for. 10 | They are defined in :meth:`_properties_dict` of the 11 | Extractor. 12 | 13 | options_dict: 14 | The :meth:`_properties_dict` of the Extractor. 15 | 16 | Returns: 17 | Returns ``True`` if the desired string is present. 18 | 19 | """ 20 | return options_dict[option] in line 21 | -------------------------------------------------------------------------------- /src/stko/_internal/calculators/geometry_analysis/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/src/stko/_internal/calculators/geometry_analysis/__init__.py -------------------------------------------------------------------------------- /src/stko/_internal/calculators/results/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/src/stko/_internal/calculators/results/__init__.py -------------------------------------------------------------------------------- /src/stko/_internal/calculators/results/energy_results.py: -------------------------------------------------------------------------------- 1 | from collections import abc 2 | 3 | 4 | class EnergyResults: 5 | """Results class containing molecule energy.""" 6 | 7 | def __init__(self, generator: abc.Iterable, unit_string: str) -> None: 8 | self._value = next(generator) # type: ignore[call-overload] 9 | self._unit_string = unit_string 10 | 11 | def get_energy(self) -> float: 12 | return self._value 13 | 14 | def get_unit_string(self) -> str: 15 | return self._unit_string 16 | -------------------------------------------------------------------------------- /src/stko/_internal/calculators/results/orca_results.py: -------------------------------------------------------------------------------- 1 | from collections import abc 2 | from pathlib import Path 3 | 4 | from stko._internal.calculators.extractors.orca_extractor import OrcaExtractor 5 | 6 | 7 | class OrcaResults: 8 | """Results class containing molecule Orca properties.""" 9 | 10 | def __init__( 11 | self, 12 | generator: abc.Iterable, 13 | output_file: Path | str, 14 | extractor: type = OrcaExtractor, 15 | ) -> None: 16 | # Run calculation. 17 | next(generator) # type: ignore[call-overload] 18 | self._extractor = extractor(output_file=output_file) 19 | 20 | def get_total_energy(self) -> tuple[float, str]: 21 | return (self._extractor.total_energy, "a.u.") 22 | -------------------------------------------------------------------------------- /src/stko/_internal/calculators/results/planarity_results.py: -------------------------------------------------------------------------------- 1 | from collections import abc 2 | 3 | 4 | class PlanarityResults: 5 | """Results class containing molecule planarity measures.""" 6 | 7 | def __init__(self, generator: abc.Iterable) -> None: 8 | self._values = next(generator) # type: ignore[call-overload] 9 | 10 | def get_planarity_parameter(self) -> float: 11 | return self._values["planarity_parameter"] 12 | 13 | def get_plane_deviation(self) -> float: 14 | return self._values["plane_deviation"] 15 | 16 | def get_plane_deviation_span(self) -> float: 17 | return self._values["plane_deviation_span"] 18 | -------------------------------------------------------------------------------- /src/stko/_internal/calculators/results/rmsd_results.py: -------------------------------------------------------------------------------- 1 | class RmsdResults: 2 | """Results class containing RMSD measures.""" 3 | 4 | def __init__(self, value: float) -> None: 5 | self._value = value 6 | 7 | def get_rmsd(self) -> float: 8 | return self._value 9 | -------------------------------------------------------------------------------- /src/stko/_internal/calculators/results/shape_results.py: -------------------------------------------------------------------------------- 1 | from collections import abc 2 | 3 | 4 | class ShapeResults: 5 | """Results class containing molecule shape measures.""" 6 | 7 | def __init__(self, generator: abc.Iterable) -> None: 8 | self._values = next(generator) # type: ignore[call-overload] 9 | 10 | def get_pmi1(self) -> float: 11 | return self._values["pmi1"] 12 | 13 | def get_pmi2(self) -> float: 14 | return self._values["pmi2"] 15 | 16 | def get_pmi3(self) -> float: 17 | return self._values["pmi3"] 18 | 19 | def get_npr1(self) -> float: 20 | return self._values["npr1"] 21 | 22 | def get_npr2(self) -> float: 23 | return self._values["npr2"] 24 | 25 | def get_asphericity(self) -> float: 26 | return self._values["asphericity"] 27 | 28 | def get_eccentricity(self) -> float: 29 | return self._values["eccentricity"] 30 | 31 | def get_inertial_shape_factor(self) -> float: 32 | return self._values["inertialshapefactor"] 33 | 34 | def get_radius_of_gyration(self) -> float: 35 | return self._values["radiusofgyration"] 36 | 37 | def get_spherocity_index(self) -> float: 38 | return self._values["spherocityindex"] 39 | -------------------------------------------------------------------------------- /src/stko/_internal/calculators/utilities.py: -------------------------------------------------------------------------------- 1 | from collections import defaultdict 2 | 3 | import numpy as np 4 | import stk 5 | 6 | 7 | def get_plane_normal(points: np.ndarray) -> np.ndarray: 8 | centroid = points.sum(axis=0) / len(points) 9 | return np.linalg.svd(points - centroid)[-1][2, :] 10 | 11 | 12 | def get_atom_maps(mol: stk.ConstructedMolecule) -> dict: 13 | """Get atom maps from building blocks to constructude molecule. 14 | 15 | Returns a dictionary of dictionaries from atom id (in building 16 | block) to constructed molecule atom, indexed by building block id. 17 | 18 | Parameters: 19 | mol: 20 | The :class:`stk.ConstructedMolecule` for which atom maps are 21 | desired. 22 | 23 | """ 24 | atom_maps = defaultdict(dict) # type: ignore[var-annotated] 25 | for atom_info in mol.get_atom_infos(): 26 | if atom_info is not None: 27 | bb_atom = atom_info.get_building_block_atom() 28 | bb_atom_id = bb_atom.get_id() # type: ignore[union-attr] 29 | atom_maps[atom_info.get_building_block_id()][bb_atom_id] = ( 30 | atom_info.get_atom() 31 | ) 32 | return atom_maps 33 | 34 | 35 | def is_inequivalent_atom(atom1: stk.Atom, atom2: stk.Atom) -> bool | None: 36 | if atom1.__class__ is not atom2.__class__: 37 | return True 38 | if atom1.get_id() != atom2.get_id(): 39 | return True 40 | if atom1.get_charge() != atom2.get_charge(): 41 | return True 42 | if atom1.get_atomic_number() != atom2.get_atomic_number(): 43 | return True 44 | return None 45 | -------------------------------------------------------------------------------- /src/stko/_internal/internal_types.py: -------------------------------------------------------------------------------- 1 | from typing import TypeVar 2 | 3 | import stk 4 | 5 | MoleculeT = TypeVar("MoleculeT", bound=stk.Molecule) 6 | ConstructedMoleculeT = TypeVar( 7 | "ConstructedMoleculeT", bound=stk.ConstructedMolecule 8 | ) 9 | -------------------------------------------------------------------------------- /src/stko/_internal/molecular/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/src/stko/_internal/molecular/__init__.py -------------------------------------------------------------------------------- /src/stko/_internal/molecular/atoms/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/src/stko/_internal/molecular/atoms/__init__.py -------------------------------------------------------------------------------- /src/stko/_internal/molecular/atoms/dummy_atom.py: -------------------------------------------------------------------------------- 1 | import logging 2 | from typing import Self 3 | 4 | import stk 5 | 6 | logger = logging.getLogger(__name__) 7 | 8 | 9 | class Du: 10 | """Dummy of an stk.Atom. 11 | 12 | Parameters: 13 | id: 14 | ID of dummy atom. 15 | 16 | """ 17 | 18 | def __init__(self, id: int) -> None: # noqa: A002 19 | self._stk_atom = stk.Atom( 20 | id=id, 21 | atomic_number=1, 22 | charge=0, 23 | ) 24 | self._atomic_number = 0 25 | self._charge = 0 26 | 27 | def get_id(self) -> int: 28 | return self._stk_atom.get_id() 29 | 30 | def get_atomic_number(self) -> int: 31 | return self._atomic_number 32 | 33 | def get_charge(self) -> int: 34 | return self._charge 35 | 36 | def clone(self) -> Self: 37 | return type(self)(self._stk_atom.get_id()) 38 | 39 | def __repr__(self) -> str: 40 | return f"{self.__class__.__name__}({self._stk_atom.get_id()})" 41 | 42 | def __str__(self) -> str: 43 | return repr(self) 44 | -------------------------------------------------------------------------------- /src/stko/_internal/molecular/constructed/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/src/stko/_internal/molecular/constructed/__init__.py -------------------------------------------------------------------------------- /src/stko/_internal/molecular/constructed/constructed_analysis.py: -------------------------------------------------------------------------------- 1 | import logging 2 | from collections import defaultdict 3 | 4 | import numpy as np 5 | import stk 6 | 7 | logger = logging.getLogger(__name__) 8 | 9 | 10 | class ConstructedAnalyser: 11 | """Analyses geometry of building blocks in constructed molecules. 12 | 13 | .. warning:: 14 | This code is only present in the latest versions of stko 15 | that require Python 3.11! 16 | 17 | """ 18 | 19 | def get_building_block_atom_ids( 20 | self, 21 | molecule: stk.ConstructedMolecule, 22 | ) -> dict[int | None, list[int]]: 23 | """Get the centroids of all building blocks. 24 | 25 | Parameters: 26 | molecule: 27 | Molecule to analyse. 28 | 29 | """ 30 | atom_ids = defaultdict(list) 31 | for atom in molecule.get_atom_infos(): 32 | if atom.get_building_block_id() is None: 33 | continue 34 | bb_id = atom.get_building_block_id() 35 | atom_ids[bb_id].append(atom.get_atom().get_id()) 36 | return atom_ids 37 | 38 | def get_building_block_centroids( 39 | self, 40 | molecule: stk.ConstructedMolecule, 41 | ) -> dict[int | None, np.ndarray]: 42 | """Get the centroids of all building blocks. 43 | 44 | Parameters: 45 | molecule: 46 | Molecule to analyse. 47 | 48 | """ 49 | atom_ids = self.get_building_block_atom_ids(molecule) 50 | return { 51 | i: molecule.get_centroid(atom_ids=atom_ids[i]) for i in atom_ids 52 | } 53 | -------------------------------------------------------------------------------- /src/stko/_internal/molecular/conversion/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/src/stko/_internal/molecular/conversion/__init__.py -------------------------------------------------------------------------------- /src/stko/_internal/molecular/decompose/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/src/stko/_internal/molecular/decompose/__init__.py -------------------------------------------------------------------------------- /src/stko/_internal/molecular/functional_groups/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/src/stko/_internal/molecular/functional_groups/__init__.py -------------------------------------------------------------------------------- /src/stko/_internal/molecular/intermediates/__init__.py: -------------------------------------------------------------------------------- 1 | """Module for getting intermediates.""" 2 | -------------------------------------------------------------------------------- /src/stko/_internal/molecular/molecule_modifiers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/src/stko/_internal/molecular/molecule_modifiers/__init__.py -------------------------------------------------------------------------------- /src/stko/_internal/molecular/networkx/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/src/stko/_internal/molecular/networkx/__init__.py -------------------------------------------------------------------------------- /src/stko/_internal/molecular/periodic/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/src/stko/_internal/molecular/periodic/__init__.py -------------------------------------------------------------------------------- /src/stko/_internal/molecular/subgroup_analysis/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/src/stko/_internal/molecular/subgroup_analysis/__init__.py -------------------------------------------------------------------------------- /src/stko/_internal/molecular/topology_extractor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/src/stko/_internal/molecular/topology_extractor/__init__.py -------------------------------------------------------------------------------- /src/stko/_internal/molecular/torsion/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/src/stko/_internal/molecular/torsion/__init__.py -------------------------------------------------------------------------------- /src/stko/_internal/molecular/torsion/torsion.py: -------------------------------------------------------------------------------- 1 | import logging 2 | from collections import abc 3 | 4 | import stk 5 | 6 | logger = logging.getLogger(__name__) 7 | 8 | 9 | class Torsion: 10 | """Represents a torsion angle in a molecule. 11 | 12 | Parameters: 13 | atom1: 14 | First atom in torsion. 15 | 16 | atom2: 17 | Second atom in torsion. 18 | 19 | atom3: 20 | Third atom in torsion. 21 | 22 | atom4: 23 | Fourth atom in torsion. 24 | 25 | """ 26 | 27 | def __init__( 28 | self, 29 | atom1: stk.Atom | None, 30 | atom2: stk.Atom | None, 31 | atom3: stk.Atom | None, 32 | atom4: stk.Atom | None, 33 | ) -> None: 34 | self._atom1 = atom1 35 | self._atom2 = atom2 36 | self._atom3 = atom3 37 | self._atom4 = atom4 38 | 39 | def get_atoms(self) -> tuple[stk.Atom | None, ...]: 40 | return ( 41 | self._atom1, 42 | self._atom2, 43 | self._atom3, 44 | self._atom4, 45 | ) 46 | 47 | def get_atom_ids(self) -> tuple[int, ...]: 48 | return tuple( 49 | atom.get_id() # type: ignore[union-attr] 50 | for atom in self.get_atoms() 51 | ) 52 | 53 | def __iter__(self) -> abc.Iterator[stk.Atom | None]: 54 | return iter(self.get_atoms()) 55 | 56 | def __str__(self) -> str: 57 | return ( 58 | f"{self.__class__.__name__}({self._atom1}, " 59 | f"{self._atom2}, {self._atom3}, {self._atom4})" 60 | ) 61 | 62 | def __repr__(self) -> str: 63 | return str(self) 64 | -------------------------------------------------------------------------------- /src/stko/_internal/optimizers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/src/stko/_internal/optimizers/__init__.py -------------------------------------------------------------------------------- /src/stko/_internal/utilities/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/src/stko/_internal/utilities/__init__.py -------------------------------------------------------------------------------- /src/stko/_internal/utilities/exceptions.py: -------------------------------------------------------------------------------- 1 | class WrapperNotInstalledError(Exception): ... 2 | 3 | 4 | class OptimizerError(Exception): ... 5 | 6 | 7 | class ForceFieldSetupError(Exception): ... 8 | 9 | 10 | class CalculatorError(Exception): ... 11 | 12 | 13 | class DifferentAtomError(Exception): ... 14 | 15 | 16 | class DifferentMoleculeError(Exception): ... 17 | 18 | 19 | class ConversionError(Exception): ... 20 | 21 | 22 | class ExpectedMetalError(Exception): ... 23 | 24 | 25 | class PathError(Exception): ... 26 | 27 | 28 | class ForceFieldError(Exception): ... 29 | 30 | 31 | class LewisStructureError(Exception): ... 32 | 33 | 34 | class InputError(Exception): ... 35 | 36 | 37 | class InvalidSolventError(Exception): ... 38 | 39 | 40 | class ConvergenceError(Exception): ... 41 | 42 | 43 | class NotStartedError(Exception): ... 44 | 45 | 46 | class NotCompletedError(Exception): ... 47 | 48 | 49 | class SettingConflictError(Exception): ... 50 | 51 | 52 | class NotDitopicThreeSiteError(Exception): ... 53 | -------------------------------------------------------------------------------- /src/stko/functional_groups.py: -------------------------------------------------------------------------------- 1 | """Tools for functional_groups.""" 2 | 3 | from stko._internal.molecular.functional_groups.three_site import ( 4 | CNCFactory, 5 | CNNFactory, 6 | NNNFactory, 7 | ThreeSiteFactory, 8 | ThreeSiteFG, 9 | ) 10 | 11 | __all__ = [ 12 | "CNCFactory", 13 | "CNNFactory", 14 | "NNNFactory", 15 | "ThreeSiteFG", 16 | "ThreeSiteFactory", 17 | ] 18 | -------------------------------------------------------------------------------- /src/stko/molecular_utilities.py: -------------------------------------------------------------------------------- 1 | """Tools for molecules.""" 2 | 3 | from stko._internal.molecular.molecular_utilities import ( 4 | merge_stk_molecules, 5 | separate_molecule, 6 | update_stk_from_rdkit_conformer, 7 | ) 8 | 9 | __all__ = [ 10 | "merge_stk_molecules", 11 | "separate_molecule", 12 | "update_stk_from_rdkit_conformer", 13 | ] 14 | -------------------------------------------------------------------------------- /src/stko/molecule_analysis.py: -------------------------------------------------------------------------------- 1 | """Tools for molecular analysis.""" 2 | 3 | from stko._internal.calculators.geometry_analysis.geometry import ( 4 | GeometryAnalyser, 5 | ) 6 | from stko._internal.molecular.constructed.constructed_analysis import ( 7 | ConstructedAnalyser, 8 | ) 9 | from stko._internal.molecular.decompose.decompose_moc import DecomposeMOC 10 | from stko._internal.molecular.subgroup_analysis.subgroup_analyser import ( 11 | AlkyneAngle, 12 | C5N1Planarity, 13 | C6Planarity, 14 | Subgroup, 15 | SubgroupAnalyser, 16 | X5Planarity, 17 | ) 18 | from stko._internal.molecular.subgroup_analysis.three_site_analysis import ( 19 | DitopicThreeSiteAnalyser, 20 | ) 21 | 22 | __all__ = [ 23 | "AlkyneAngle", 24 | "C5N1Planarity", 25 | "C6Planarity", 26 | "ConstructedAnalyser", 27 | "DecomposeMOC", 28 | "DitopicThreeSiteAnalyser", 29 | "GeometryAnalyser", 30 | "Subgroup", 31 | "SubgroupAnalyser", 32 | "X5Planarity", 33 | ] 34 | -------------------------------------------------------------------------------- /src/stko/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/src/stko/py.typed -------------------------------------------------------------------------------- /src/stko/topology_functions.py: -------------------------------------------------------------------------------- 1 | """Tools for topology manipulation.""" 2 | 3 | from stko._internal.molecular.intermediates.unreacted import ( 4 | IntermediatePool, 5 | NamedIntermediate, 6 | UnreactedTopologyGraph, 7 | ) 8 | 9 | __all__ = ["IntermediatePool", "NamedIntermediate", "UnreactedTopologyGraph"] 10 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/__init__.py -------------------------------------------------------------------------------- /tests/calculators/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/calculators/__init__.py -------------------------------------------------------------------------------- /tests/calculators/geometry/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/calculators/geometry/__init__.py -------------------------------------------------------------------------------- /tests/calculators/geometry/case_data.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import stk 4 | 5 | 6 | @dataclass(frozen=True, slots=True) 7 | class CaseData: 8 | molecule: stk.Molecule 9 | metal_atom_distances: dict[tuple[int, int], float] 10 | metal_centroid_angles: dict[tuple[int, int], float] 11 | min_centoid_distance: float 12 | avg_centoid_distance: tuple[float, float] 13 | radius_gyration: float 14 | min_atom_atom_distance: float 15 | max_diameter: float 16 | bonds: dict[tuple[str, str], list[float]] 17 | angles: dict[tuple[str, str, str], list[float]] 18 | torsions: dict[tuple[str, str, str, str], list[float]] 19 | name: str 20 | -------------------------------------------------------------------------------- /tests/calculators/geometry/test_calculate_angles.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import stko 4 | 5 | from .case_data import CaseData 6 | 7 | 8 | def test_calculate_angles(case_data: CaseData) -> None: 9 | analyser = stko.molecule_analysis.GeometryAnalyser() 10 | 11 | result = analyser.calculate_angles(case_data.molecule) 12 | for triple in result: 13 | if triple == ("C", "C", "C"): 14 | continue 15 | if "H" in triple: 16 | continue 17 | assert len(result[triple]) == len(case_data.angles[triple]) 18 | assert np.allclose( 19 | result[triple], case_data.angles[triple], rtol=0, atol=1e-3 20 | ) 21 | -------------------------------------------------------------------------------- /tests/calculators/geometry/test_calculate_bonds.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import stko 4 | 5 | from .case_data import CaseData 6 | 7 | 8 | def test_calculate_bonds(case_data: CaseData) -> None: 9 | analyser = stko.molecule_analysis.GeometryAnalyser() 10 | 11 | result = analyser.calculate_bonds(case_data.molecule) 12 | for pair in result: 13 | if pair == ("C", "C"): 14 | continue 15 | if "H" in pair: 16 | continue 17 | assert len(result[pair]) == len(case_data.bonds[pair]) 18 | assert np.allclose( 19 | result[pair], case_data.bonds[pair], rtol=0, atol=1e-3 20 | ) 21 | -------------------------------------------------------------------------------- /tests/calculators/geometry/test_calculate_torsions.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import stko 4 | 5 | from .case_data import CaseData 6 | 7 | 8 | def test_calculate_torsions(case_data: CaseData) -> None: 9 | analyser = stko.molecule_analysis.GeometryAnalyser() 10 | 11 | result = analyser.calculate_torsions(case_data.molecule) 12 | for four in result: 13 | if four == ("C", "C", "C", "C"): 14 | continue 15 | if "H" in four: 16 | continue 17 | assert len(result[four]) == len(case_data.torsions[four]) 18 | assert np.allclose( 19 | result[four], case_data.torsions[four], rtol=0, atol=1e-3 20 | ) 21 | -------------------------------------------------------------------------------- /tests/calculators/geometry/test_get_avg_centroid_distance.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import stko 4 | 5 | from .case_data import CaseData 6 | 7 | 8 | def test_get_avg_centroid_distance(case_data: CaseData) -> None: 9 | analyser = stko.molecule_analysis.GeometryAnalyser() 10 | 11 | result = analyser.get_avg_centroid_distance(case_data.molecule) 12 | assert np.isclose( 13 | result[0], case_data.avg_centoid_distance[0], atol=1e-3, rtol=0 14 | ) 15 | assert np.isclose( 16 | result[1], case_data.avg_centoid_distance[1], atol=1e-3, rtol=0 17 | ) 18 | -------------------------------------------------------------------------------- /tests/calculators/geometry/test_get_max_diamter.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import stko 4 | 5 | from .case_data import CaseData 6 | 7 | 8 | def test_get_max_diameter(case_data: CaseData) -> None: 9 | analyser = stko.molecule_analysis.GeometryAnalyser() 10 | 11 | result = analyser.get_max_diameter(case_data.molecule) 12 | assert np.isclose(result, case_data.max_diameter, atol=1e-3, rtol=0) 13 | -------------------------------------------------------------------------------- /tests/calculators/geometry/test_get_metal_centroid_metal_angle.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import stko 4 | 5 | from .case_data import CaseData 6 | 7 | 8 | def test_get_metal_centroid_metal_angle(case_data: CaseData) -> None: 9 | analyser = stko.molecule_analysis.GeometryAnalyser() 10 | 11 | result = analyser.get_metal_centroid_metal_angle( 12 | case_data.molecule, 13 | metal_atom_nos=(26, 46), 14 | ) 15 | assert len(result) == len(case_data.metal_centroid_angles) 16 | for i in result: 17 | assert np.isclose( 18 | result[i], case_data.metal_centroid_angles[i], atol=1e-3, rtol=0 19 | ) 20 | -------------------------------------------------------------------------------- /tests/calculators/geometry/test_get_metal_distances.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import stko 4 | 5 | from .case_data import CaseData 6 | 7 | 8 | def test_get_metal_distances(case_data: CaseData) -> None: 9 | analyser = stko.molecule_analysis.GeometryAnalyser() 10 | 11 | result = analyser.get_metal_distances( 12 | case_data.molecule, 13 | metal_atom_nos=(26, 46), 14 | ) 15 | assert len(result) == len(case_data.metal_atom_distances) 16 | for i in result: 17 | assert np.isclose( 18 | result[i], case_data.metal_atom_distances[i], rtol=0, atol=1e-2 19 | ) 20 | -------------------------------------------------------------------------------- /tests/calculators/geometry/test_get_min_atom_atom.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import stko 4 | 5 | from .case_data import CaseData 6 | 7 | 8 | def test_get_min_atom_atom_distance(case_data: CaseData) -> None: 9 | analyser = stko.molecule_analysis.GeometryAnalyser() 10 | 11 | result = analyser.get_min_atom_atom_distance(case_data.molecule) 12 | assert np.isclose( 13 | result, case_data.min_atom_atom_distance, atol=1e-3, rtol=0 14 | ) 15 | -------------------------------------------------------------------------------- /tests/calculators/geometry/test_get_min_centroid_distance.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import stko 4 | 5 | from .case_data import CaseData 6 | 7 | 8 | def test_get_min_centroid_distance(case_data: CaseData) -> None: 9 | analyser = stko.molecule_analysis.GeometryAnalyser() 10 | 11 | result = analyser.get_min_centroid_distance(case_data.molecule) 12 | assert np.isclose( 13 | result, case_data.min_centoid_distance, atol=1e-3, rtol=0 14 | ) 15 | -------------------------------------------------------------------------------- /tests/calculators/geometry/test_get_radius_gyration.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import stko 4 | 5 | from .case_data import CaseData 6 | 7 | 8 | def test_get_radius_gyration(case_data: CaseData) -> None: 9 | analyser = stko.molecule_analysis.GeometryAnalyser() 10 | 11 | result = analyser.get_radius_gyration(case_data.molecule) 12 | assert np.isclose(result, case_data.radius_gyration, atol=1e-3, rtol=0) 13 | -------------------------------------------------------------------------------- /tests/calculators/openbabel/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/calculators/openbabel/__init__.py -------------------------------------------------------------------------------- /tests/calculators/openbabel/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import stk 3 | 4 | 5 | def a_molecule() -> stk.BuildingBlock: 6 | return stk.BuildingBlock(smiles="CCCCCC") 7 | 8 | 9 | @pytest.fixture 10 | def unoptimized_mol() -> stk.BuildingBlock: 11 | return a_molecule() 12 | -------------------------------------------------------------------------------- /tests/calculators/openbabel/test_obabel_calculators.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import stk 3 | 4 | import stko 5 | 6 | try: 7 | from openbabel import openbabel 8 | except ImportError: 9 | openbabel = None 10 | 11 | 12 | def test_open_babel_energy(unoptimized_mol: stk.BuildingBlock) -> None: 13 | if openbabel is None: 14 | with pytest.raises(stko.WrapperNotInstalledError): 15 | calculator = stko.OpenBabelEnergy("uff") 16 | else: 17 | calculator = stko.OpenBabelEnergy("uff") 18 | test_energy = calculator.get_energy(unoptimized_mol) 19 | assert test_energy == 141.44622279628743 # noqa: PLR2004 20 | 21 | calculator = stko.OpenBabelEnergy("gaff") 22 | test_energy = calculator.get_energy(unoptimized_mol) 23 | assert test_energy == 66.47095418890525 # noqa: PLR2004 24 | 25 | calculator = stko.OpenBabelEnergy("ghemical") 26 | test_energy = calculator.get_energy(unoptimized_mol) 27 | assert test_energy == 86.59956589041794 # noqa: PLR2004 28 | 29 | calculator = stko.OpenBabelEnergy("mmff94") 30 | test_energy = calculator.get_energy(unoptimized_mol) 31 | assert test_energy == 7.607999187460175 # noqa: PLR2004 32 | -------------------------------------------------------------------------------- /tests/calculators/openmm/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/calculators/openmm/__init__.py -------------------------------------------------------------------------------- /tests/calculators/openmm/conftest.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import pytest 4 | import stk 5 | 6 | 7 | @dataclass(frozen=True, slots=True) 8 | class CaseData: 9 | molecule: stk.Molecule 10 | energy: float 11 | 12 | 13 | @pytest.fixture( 14 | scope="session", 15 | params=[ 16 | CaseData( 17 | molecule=stk.BuildingBlock("NCCN"), 18 | energy=142.99500933275297, 19 | ), 20 | CaseData( 21 | molecule=stk.ConstructedMolecule( 22 | topology_graph=stk.host_guest.Complex( 23 | host=stk.BuildingBlock("NCCN"), 24 | guests=stk.host_guest.Guest( 25 | building_block=stk.BuildingBlock("CC"), 26 | displacement=(5, 5, 5), 27 | ), 28 | optimizer=stk.Spinner(), 29 | ), 30 | ), 31 | energy=165.25686166058674, 32 | ), 33 | CaseData( 34 | molecule=stk.ConstructedMolecule( 35 | topology_graph=stk.host_guest.Complex( 36 | host=stk.BuildingBlock("NCCN"), 37 | guests=stk.host_guest.Guest( 38 | building_block=stk.BuildingBlock("NCCN"), 39 | displacement=(4, 4, 4), 40 | ), 41 | optimizer=stk.Spinner(), 42 | ), 43 | ), 44 | energy=285.665342151835, 45 | ), 46 | ], 47 | ) 48 | def case_molecule(request: pytest.FixtureRequest) -> CaseData: 49 | return request.param 50 | -------------------------------------------------------------------------------- /tests/calculators/openmm/test_openmm_energy.py: -------------------------------------------------------------------------------- 1 | try: 2 | from openff.toolkit import ForceField 3 | except ImportError: 4 | ForceField = None 5 | import numpy as np 6 | 7 | import stko 8 | 9 | from .conftest import CaseData 10 | 11 | 12 | def test_openmm_energy(case_molecule: CaseData) -> None: 13 | if ForceField is not None: 14 | energy = ( 15 | stko.OpenMMEnergy( 16 | force_field=ForceField("openff_unconstrained-2.1.0.offxml"), 17 | partial_charges_method="espaloma-am1bcc", 18 | ).get_energy(case_molecule.molecule), 19 | ) 20 | 21 | assert np.isclose(energy, case_molecule.energy) 22 | -------------------------------------------------------------------------------- /tests/calculators/planarity/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/calculators/planarity/__init__.py -------------------------------------------------------------------------------- /tests/calculators/planarity/test_planarity_calculators.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import stko 4 | 5 | from .conftest import CaseData 6 | 7 | 8 | def test_planarity_calculation(case_data: CaseData) -> None: 9 | calc = stko.PlanarityCalculator() 10 | test = calc.get_results( 11 | mol=case_data.molecule, 12 | plane_atom_ids=case_data.plane_ids, 13 | deviation_atom_ids=case_data.deviation_ids, 14 | ) 15 | assert np.isclose( 16 | test.get_plane_deviation(), 17 | case_data.plane_deviation, 18 | atol=1e-4, 19 | ) 20 | assert np.isclose( 21 | test.get_plane_deviation_span(), 22 | case_data.plane_span, 23 | atol=1e-4, 24 | ) 25 | assert np.isclose( 26 | test.get_planarity_parameter(), 27 | case_data.planarity_parameter, 28 | atol=1e-4, 29 | ) 30 | -------------------------------------------------------------------------------- /tests/calculators/pore/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/calculators/pore/__init__.py -------------------------------------------------------------------------------- /tests/calculators/pore/case_data.py: -------------------------------------------------------------------------------- 1 | import stk 2 | 3 | 4 | class CaseData: 5 | def __init__( 6 | self, 7 | molecule: stk.Molecule, 8 | name: str, 9 | ) -> None: 10 | self.molecule = molecule 11 | self.name = name 12 | -------------------------------------------------------------------------------- /tests/calculators/rmsd/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/calculators/rmsd/__init__.py -------------------------------------------------------------------------------- /tests/calculators/rmsd/test_rmsd_calculators.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | 4 | import stko 5 | 6 | from .conftest import CaseData 7 | 8 | 9 | def test_rmsd(case_data: CaseData) -> None: 10 | calculator = stko.RmsdCalculator(case_data.mol1) 11 | results = calculator.get_results(case_data.mol2) 12 | test_rmsd = results.get_rmsd() 13 | assert np.isclose(test_rmsd, case_data.rmsd, atol=1e-4) 14 | 15 | 16 | def test_kabsch_rmsd(case_data: CaseData) -> None: 17 | calculator = stko.KabschRmsdCalculator(case_data.mol1) 18 | results = calculator.get_results(case_data.mol2) 19 | test_rmsd = results.get_rmsd() 20 | assert np.isclose(test_rmsd, case_data.kabsch_rmsd, atol=1e-4) 21 | 22 | 23 | def test_rmsd_ignore_hydrogens(ignore_h_case_data: CaseData) -> None: 24 | calculator = stko.RmsdCalculator( 25 | ignore_h_case_data.mol1, ignore_hydrogens=True 26 | ) 27 | results = calculator.get_results(ignore_h_case_data.mol2) 28 | test_rmsd = results.get_rmsd() 29 | assert np.isclose(test_rmsd, ignore_h_case_data.rmsd, atol=1e-4) 30 | 31 | 32 | def test_rmsd_aligned(aligned_case_data: CaseData) -> None: 33 | calculator = stko.RmsdMappedCalculator(aligned_case_data.mol1) 34 | results = calculator.get_results(aligned_case_data.mol2) 35 | test_rmsd = results.get_rmsd() 36 | assert np.isclose(test_rmsd, aligned_case_data.rmsd, atol=1e-4) 37 | 38 | 39 | def test_rmsd_different_molecule(different_case_data: CaseData) -> None: 40 | calculator = stko.RmsdCalculator(different_case_data.mol1) 41 | with pytest.raises(stko.DifferentMoleculeError): 42 | calculator.get_results(different_case_data.mol2) 43 | 44 | 45 | def test_rmsd_different_atom(ordering_case_data: CaseData) -> None: 46 | calculator = stko.RmsdCalculator(ordering_case_data.mol1) 47 | with pytest.raises(stko.DifferentAtomError): 48 | calculator.get_results(ordering_case_data.mol2) 49 | -------------------------------------------------------------------------------- /tests/calculators/torsion/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/calculators/torsion/__init__.py -------------------------------------------------------------------------------- /tests/molecular/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/molecular/__init__.py -------------------------------------------------------------------------------- /tests/molecular/atoms/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/molecular/atoms/__init__.py -------------------------------------------------------------------------------- /tests/molecular/atoms/dummy_atom/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/molecular/atoms/dummy_atom/__init__.py -------------------------------------------------------------------------------- /tests/molecular/atoms/dummy_atom/case_data.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import stko 4 | 5 | 6 | @dataclass(frozen=True, slots=True) 7 | class CaseData: 8 | atom: stko.Du 9 | id: int 10 | -------------------------------------------------------------------------------- /tests/molecular/atoms/dummy_atom/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | import stko 5 | 6 | from .case_data import CaseData 7 | 8 | 9 | @pytest.fixture 10 | def case_data_1(id: int) -> CaseData: # noqa: A002 11 | """A :class:`.CaseData` instance.""" 12 | return CaseData( 13 | atom=stko.Du(id), 14 | id=id, 15 | ) 16 | 17 | 18 | @pytest.fixture(params=(lazy_fixture("case_data_1"),)) 19 | def case_data(request: pytest.FixtureRequest) -> CaseData: 20 | """A :class:`.CaseData` instance.""" 21 | return request.param 22 | 23 | 24 | @pytest.fixture( 25 | params=[0, 3], 26 | ) 27 | def id(request: pytest.FixtureRequest) -> int: # noqa: A001 28 | """An atom id.""" 29 | return request.param 30 | 31 | 32 | @pytest.fixture 33 | def dummy_atom(id: int) -> stko.Du: # noqa: A002 34 | """An :class:`.Du` instance.""" 35 | return stko.Du(id).clone() 36 | -------------------------------------------------------------------------------- /tests/molecular/atoms/dummy_atom/test_clone.py: -------------------------------------------------------------------------------- 1 | import stko 2 | from tests.molecular.atoms.utilities import is_equivalent_atom 3 | 4 | 5 | def test_clone(dummy_atom: stko.Du) -> None: 6 | clone = dummy_atom.clone() 7 | is_equivalent_atom(dummy_atom, clone) 8 | -------------------------------------------------------------------------------- /tests/molecular/atoms/dummy_atom/test_get_atomic_number.py: -------------------------------------------------------------------------------- 1 | from .case_data import CaseData 2 | 3 | 4 | def test_get_atomic_number(case_data: CaseData) -> None: 5 | assert case_data.atom.get_atomic_number() == 0 6 | -------------------------------------------------------------------------------- /tests/molecular/atoms/dummy_atom/test_get_charge.py: -------------------------------------------------------------------------------- 1 | from .case_data import CaseData 2 | 3 | 4 | def test_get_charge(case_data: CaseData) -> None: 5 | assert case_data.atom.get_charge() == 0 6 | -------------------------------------------------------------------------------- /tests/molecular/atoms/dummy_atom/test_get_id.py: -------------------------------------------------------------------------------- 1 | from .case_data import CaseData 2 | 3 | 4 | def test_get_id(case_data: CaseData) -> None: 5 | assert case_data.atom.get_id() == case_data.id 6 | -------------------------------------------------------------------------------- /tests/molecular/atoms/positioned_atom/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/molecular/atoms/positioned_atom/__init__.py -------------------------------------------------------------------------------- /tests/molecular/atoms/positioned_atom/case_data.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import stko 4 | 5 | 6 | @dataclass(frozen=True, slots=True) 7 | class CaseData: 8 | atom: stko.PositionedAtom 9 | id: int 10 | charge: int 11 | atomic_number: int 12 | position: tuple[float, float, float] 13 | -------------------------------------------------------------------------------- /tests/molecular/atoms/positioned_atom/test_clone.py: -------------------------------------------------------------------------------- 1 | import stko 2 | from tests.molecular.atoms.utilities import is_equivalent_atom 3 | 4 | 5 | def test_clone(positioned_atom: stko.PositionedAtom) -> None: 6 | clone = positioned_atom.clone() 7 | is_equivalent_atom(positioned_atom, clone) 8 | -------------------------------------------------------------------------------- /tests/molecular/atoms/positioned_atom/test_get_atomic_number.py: -------------------------------------------------------------------------------- 1 | import stko 2 | 3 | from .case_data import CaseData 4 | 5 | 6 | def test_get_atomic_number(case_data: CaseData) -> None: 7 | _test_get_atomic_number(case_data.atom, case_data.atomic_number) 8 | 9 | 10 | def _test_get_atomic_number( 11 | atom: stko.PositionedAtom, atomic_number: int 12 | ) -> None: 13 | assert atom.get_atomic_number() == atomic_number 14 | -------------------------------------------------------------------------------- /tests/molecular/atoms/positioned_atom/test_get_charge.py: -------------------------------------------------------------------------------- 1 | from .case_data import CaseData 2 | 3 | 4 | def test_get_charge(case_data: CaseData) -> None: 5 | assert case_data.atom.get_charge() == case_data.charge 6 | -------------------------------------------------------------------------------- /tests/molecular/atoms/positioned_atom/test_get_id.py: -------------------------------------------------------------------------------- 1 | from .case_data import CaseData 2 | 3 | 4 | def test_get_id(case_data: CaseData) -> None: 5 | assert case_data.atom.get_id() == case_data.id 6 | -------------------------------------------------------------------------------- /tests/molecular/atoms/positioned_atom/test_get_position.py: -------------------------------------------------------------------------------- 1 | import stko 2 | 3 | from .case_data import CaseData 4 | 5 | 6 | def test_get_position(case_data: CaseData) -> None: 7 | _test_get_position(case_data.atom, case_data.position) 8 | 9 | 10 | def _test_get_position( 11 | atom: stko.PositionedAtom, position: tuple[float, float, float] 12 | ) -> None: 13 | assert atom.get_position() == position 14 | -------------------------------------------------------------------------------- /tests/molecular/atoms/positioned_atom/test_repr.py: -------------------------------------------------------------------------------- 1 | import stk 2 | 3 | import stko 4 | from tests.molecular.atoms.utilities import is_equivalent_atom 5 | 6 | 7 | def test_repr(positioned_atom: stko.PositionedAtom) -> None: 8 | other = stko.PositionedAtom( 9 | atom=eval(repr(positioned_atom), dict(stk.__dict__)), # noqa: S307 10 | position=positioned_atom.get_position(), 11 | ) 12 | is_equivalent_atom(other, positioned_atom) 13 | -------------------------------------------------------------------------------- /tests/molecular/atoms/positioned_atom/test_with_id.py: -------------------------------------------------------------------------------- 1 | import stko 2 | from tests.molecular.atoms.utilities import is_equivalent_atom 3 | 4 | 5 | def test_with_id(positioned_atom: stko.PositionedAtom, id: int) -> None: # noqa: A002 6 | # Save a clone to ensure that "atom" is not changed by the test. 7 | before = positioned_atom.clone() 8 | _test_with_id(positioned_atom, id) 9 | is_equivalent_atom(before, positioned_atom) 10 | 11 | 12 | def _test_with_id(positioned_atom: stko.PositionedAtom, id: int) -> None: # noqa: A002 13 | new_atom = positioned_atom.with_id(id) 14 | assert new_atom is not positioned_atom 15 | assert new_atom.__class__ is positioned_atom.__class__ 16 | assert new_atom.get_id() == id 17 | assert new_atom.get_charge() == positioned_atom.get_charge() 18 | atm_num = positioned_atom.get_atomic_number() 19 | assert new_atom.get_atomic_number() == atm_num 20 | assert new_atom.get_position() == positioned_atom.get_position() 21 | -------------------------------------------------------------------------------- /tests/molecular/atoms/utilities.py: -------------------------------------------------------------------------------- 1 | import rdkit.Chem.AllChem as rdkit # noqa: N813 2 | import stk 3 | 4 | 5 | def is_equivalent_atom(atom1: stk.Atom, atom2: stk.Atom) -> None: 6 | assert atom1 is not atom2 7 | assert atom1.__class__ is atom2.__class__ 8 | assert atom1.get_id() == atom2.get_id() 9 | assert atom1.get_charge() == atom2.get_charge() 10 | assert atom1.get_atomic_number() == atom2.get_atomic_number() 11 | 12 | 13 | _periodic_table = rdkit.GetPeriodicTable() 14 | 15 | atomic_numbers = { 16 | stk.__dict__[ 17 | _periodic_table.GetElementSymbol(atomic_number) 18 | ]: atomic_number 19 | for atomic_number in range(1, 119) 20 | } 21 | -------------------------------------------------------------------------------- /tests/molecular/constructed/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/molecular/constructed/__init__.py -------------------------------------------------------------------------------- /tests/molecular/constructed/case_data.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import numpy as np 4 | import stk 5 | 6 | 7 | @dataclass(frozen=True, slots=True) 8 | class CaseData: 9 | constructed_molecule: stk.ConstructedMolecule 10 | centroids: dict[int, np.ndarray] 11 | atom_ids: dict[int, list[int]] 12 | name: str 13 | -------------------------------------------------------------------------------- /tests/molecular/constructed/test_get_building_block_atom_ids.py: -------------------------------------------------------------------------------- 1 | import stko 2 | from tests.molecular.constructed.case_data import CaseData 3 | 4 | 5 | def test_get_building_block_atom_ids(case_data: CaseData) -> None: 6 | analyser = stko.molecule_analysis.ConstructedAnalyser() 7 | result = analyser.get_building_block_atom_ids( 8 | case_data.constructed_molecule 9 | ) 10 | assert len(result) == len(case_data.atom_ids) 11 | for i in result: 12 | assert result[i] == case_data.atom_ids[i] 13 | -------------------------------------------------------------------------------- /tests/molecular/constructed/test_get_building_block_centroids.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import stko 4 | from tests.molecular.constructed.case_data import CaseData 5 | 6 | 7 | def test_get_building_block_centroids(case_data: CaseData) -> None: 8 | analyser = stko.molecule_analysis.ConstructedAnalyser() 9 | result = analyser.get_building_block_centroids( 10 | case_data.constructed_molecule 11 | ) 12 | assert len(result) == len(case_data.centroids) 13 | for i in result: 14 | assert np.allclose( 15 | result[i], case_data.centroids[i], rtol=0, atol=1e-3 16 | ) 17 | -------------------------------------------------------------------------------- /tests/molecular/decompose/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/molecular/decompose/__init__.py -------------------------------------------------------------------------------- /tests/molecular/decompose/case_data.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import stk 4 | 5 | 6 | @dataclass(frozen=True, slots=True) 7 | class CaseData: 8 | cage: stk.Molecule 9 | num_ligands: int 10 | metal_atom_nos: tuple[int] 11 | bb_smiles: tuple[str] 12 | name: str 13 | -------------------------------------------------------------------------------- /tests/molecular/decompose/test_decomposemoc.py: -------------------------------------------------------------------------------- 1 | import stk 2 | 3 | import stko 4 | from tests.molecular.decompose.case_data import CaseData 5 | 6 | 7 | def test_decomposemoc(case_data: CaseData) -> None: 8 | ligands = stko.molecule_analysis.DecomposeMOC().decompose( 9 | molecule=case_data.cage, 10 | metal_atom_nos=case_data.metal_atom_nos, 11 | ) 12 | 13 | assert case_data.num_ligands == len(ligands) 14 | 15 | for ligand in ligands: 16 | smiles = stk.Smiles().get_key(ligand) 17 | assert smiles in case_data.bb_smiles 18 | -------------------------------------------------------------------------------- /tests/molecular/functional_group/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/molecular/functional_group/__init__.py -------------------------------------------------------------------------------- /tests/molecular/functional_group/case_data.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import stko 4 | 5 | 6 | @dataclass(frozen=True, slots=True) 7 | class CaseData: 8 | smiles: str 9 | num_fgs: int 10 | factory: stko.functional_groups.ThreeSiteFactory 11 | name: str 12 | -------------------------------------------------------------------------------- /tests/molecular/functional_group/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import stko 4 | 5 | from .case_data import CaseData 6 | 7 | 8 | @pytest.fixture( 9 | scope="session", 10 | params=( 11 | lambda name: CaseData( 12 | smiles="C1=CC=CC=C1", 13 | num_fgs=0, 14 | factory=stko.functional_groups.ThreeSiteFactory( 15 | smarts="[Br][C][O]" 16 | ), 17 | name=name, 18 | ), 19 | lambda name: CaseData( 20 | smiles="C1=NC=CN=C1", 21 | num_fgs=2, 22 | factory=stko.functional_groups.CNCFactory(), 23 | name=name, 24 | ), 25 | lambda name: CaseData( 26 | smiles="C1=NC=CN=C1", 27 | num_fgs=0, 28 | factory=stko.functional_groups.CNNFactory(), 29 | name=name, 30 | ), 31 | lambda name: CaseData( 32 | smiles="C1=CC=CN=C1", 33 | num_fgs=1, 34 | factory=stko.functional_groups.CNCFactory(), 35 | name=name, 36 | ), 37 | lambda name: CaseData( 38 | smiles="C1=CN=NC=C1", 39 | num_fgs=0, 40 | factory=stko.functional_groups.ThreeSiteFactory( 41 | smarts="[Br][C][O]" 42 | ), 43 | name=name, 44 | ), 45 | lambda name: CaseData( 46 | smiles="C1=CN=NC=C1", 47 | num_fgs=2, 48 | factory=stko.functional_groups.CNNFactory(), 49 | name=name, 50 | ), 51 | lambda name: CaseData( 52 | smiles="C1=CN=NC=C1", 53 | num_fgs=0, 54 | factory=stko.functional_groups.CNCFactory(), 55 | name=name, 56 | ), 57 | ), 58 | ) 59 | def case_data(request: pytest.FixtureRequest) -> CaseData: 60 | return request.param( 61 | f"{request.fixturename}{request.param_index}", 62 | ) 63 | -------------------------------------------------------------------------------- /tests/molecular/functional_group/test_threesite.py: -------------------------------------------------------------------------------- 1 | import stk 2 | 3 | from tests.molecular.functional_group.case_data import CaseData 4 | 5 | 6 | def test_threesite(case_data: CaseData) -> None: 7 | num_fgs = stk.BuildingBlock( 8 | smiles=case_data.smiles, 9 | functional_groups=case_data.factory, 10 | ).get_num_functional_groups() 11 | 12 | assert case_data.num_fgs == num_fgs 13 | -------------------------------------------------------------------------------- /tests/molecular/mdanalysis/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/molecular/mdanalysis/__init__.py -------------------------------------------------------------------------------- /tests/molecular/mdanalysis/conftest.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | import stk 4 | 5 | _pd = stk.BuildingBlock( 6 | smiles="[Pd+2]", 7 | functional_groups=(stk.SingleAtom(stk.Pd(0, charge=2)) for _ in range(4)), 8 | position_matrix=np.array([[0, 0, 0]]), 9 | ) 10 | 11 | # Define a bidentate ligand with two functional groups. 12 | _bidentate_ligand = stk.BuildingBlock( 13 | smiles="NCCN", 14 | functional_groups=[ 15 | stk.SmartsFunctionalGroupFactory( 16 | smarts="[#7]~[#6]", 17 | bonders=(0,), 18 | deleters=(), 19 | ), 20 | ], 21 | ) 22 | 23 | # Construct a cis-protected square planar metal complex. 24 | _complex = stk.ConstructedMolecule( 25 | topology_graph=stk.metal_complex.CisProtectedSquarePlanar( 26 | metals=_pd, 27 | ligands=_bidentate_ligand, 28 | ), 29 | ) 30 | 31 | 32 | @pytest.fixture( 33 | params=( 34 | stk.BuildingBlock("NCCN"), 35 | stk.BuildingBlock("c1ccccc1"), 36 | _complex, 37 | ), 38 | ) 39 | def molecule(request: pytest.FixtureRequest) -> stk.Molecule: 40 | return request.param 41 | -------------------------------------------------------------------------------- /tests/molecular/mdanalysis/test_universe.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | import stk 4 | 5 | import stko 6 | 7 | try: 8 | import MDAnalysis as mda # noqa: N813 9 | except ModuleNotFoundError: 10 | mda = None 11 | 12 | 13 | def test_universe(molecule: stk.Molecule) -> None: 14 | if mda is None: 15 | with pytest.raises(stko.WrapperNotInstalledError): 16 | result = stko.MDAnalysis().get_universe(molecule) 17 | else: 18 | result = stko.MDAnalysis().get_universe(molecule) 19 | 20 | assert result.atoms.n_atoms == molecule.get_num_atoms() 21 | 22 | for atom, stk_atom in zip( 23 | result.atoms, molecule.get_atoms(), strict=False 24 | ): 25 | assert atom.ix == stk_atom.get_id() 26 | 27 | for pos, stk_pos in zip( 28 | result.atoms.positions, 29 | molecule.get_position_matrix(), 30 | strict=False, 31 | ): 32 | assert np.allclose(pos, stk_pos) 33 | -------------------------------------------------------------------------------- /tests/molecular/subgroup/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/molecular/subgroup/__init__.py -------------------------------------------------------------------------------- /tests/molecular/subgroup/case_data.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import stk 4 | 5 | 6 | @dataclass(frozen=True, slots=True) 7 | class CaseData: 8 | molecule: stk.Molecule 9 | sub_group_data: dict[str, list[float]] 10 | name: str 11 | -------------------------------------------------------------------------------- /tests/molecular/subgroup/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import stk 3 | 4 | from .case_data import CaseData 5 | 6 | 7 | @pytest.fixture( 8 | scope="session", 9 | params=( 10 | lambda name: CaseData( 11 | molecule=stk.BuildingBlock("C1=CC=CC=C1"), 12 | sub_group_data={ 13 | "c6_planarity": [2.7518147481201438e-06], 14 | "c5n1_planarity": [], 15 | "x5_planarity": [], 16 | "c#c_angle": [], 17 | }, 18 | name=name, 19 | ), 20 | lambda name: CaseData( 21 | molecule=stk.BuildingBlock("C1N=CC(CCC2CCOC2)N=1"), 22 | sub_group_data={ 23 | "c6_planarity": [], 24 | "c5n1_planarity": [], 25 | "x5_planarity": [1.3688005804646254e-06, 0.932064037529801], 26 | "c#c_angle": [], 27 | }, 28 | name=name, 29 | ), 30 | lambda name: CaseData( 31 | molecule=stk.BuildingBlock("C1=CC=C(C=C1)C#CC2=CN=CC=C2"), 32 | sub_group_data={ 33 | "c6_planarity": [8.41286151020968e-08], 34 | "c5n1_planarity": [5.678704369238556e-08], 35 | "x5_planarity": [], 36 | "c#c_angle": [179.00063441359868], 37 | }, 38 | name=name, 39 | ), 40 | ), 41 | ) 42 | def case_data(request: pytest.FixtureRequest) -> CaseData: 43 | return request.param( 44 | f"{request.fixturename}{request.param_index}", 45 | ) 46 | -------------------------------------------------------------------------------- /tests/molecular/subgroup/test_subgroup_analysis.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import stko 4 | from tests.molecular.subgroup.case_data import CaseData 5 | 6 | 7 | def test_get_binder_distance(case_data: CaseData) -> None: 8 | analyser = stko.molecule_analysis.SubgroupAnalyser() 9 | 10 | results = analyser.calculate(case_data.molecule) 11 | for test in results: 12 | assert len(results[test]) == len(case_data.sub_group_data[test]) 13 | assert np.allclose( 14 | results[test], 15 | case_data.sub_group_data[test], 16 | rtol=0, 17 | atol=1e-3, 18 | ) 19 | -------------------------------------------------------------------------------- /tests/molecular/threesite/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/molecular/threesite/__init__.py -------------------------------------------------------------------------------- /tests/molecular/threesite/case_data.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import stk 4 | 5 | 6 | @dataclass(frozen=True, slots=True) 7 | class CaseData: 8 | building_block: stk.BuildingBlock 9 | binder_distance: float 10 | binder_centroid_angle: float 11 | binder_adjacent_torsion: float 12 | binder_angles: tuple[float, float] 13 | binder_binder_angle: float 14 | name: str 15 | 16 | @property 17 | def bite_angles(self) -> tuple[float, float]: 18 | return self.binder_angles[0] - 90, self.binder_angles[1] - 90 19 | -------------------------------------------------------------------------------- /tests/molecular/threesite/test_get_adjecent_positions.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import stko 4 | from tests.molecular.threesite.case_data import CaseData 5 | 6 | 7 | def test_get_adjacent_centroids(case_data: CaseData) -> None: 8 | threesite_analysis = stko.molecule_analysis.DitopicThreeSiteAnalyser() 9 | 10 | centroids = threesite_analysis.get_adjacent_centroids( 11 | case_data.building_block 12 | ) 13 | assert np.linalg.norm(centroids[0] - centroids[1]) > 0.1 # noqa: PLR2004 14 | -------------------------------------------------------------------------------- /tests/molecular/threesite/test_get_binder_adjacent_torsion.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import stko 4 | from tests.molecular.threesite.case_data import CaseData 5 | 6 | 7 | def test_get_binder_adjacent_torsion(case_data: CaseData) -> None: 8 | threesite_analysis = stko.molecule_analysis.DitopicThreeSiteAnalyser() 9 | 10 | result = threesite_analysis.get_binder_adjacent_torsion( 11 | case_data.building_block 12 | ) 13 | assert np.isclose( 14 | case_data.binder_adjacent_torsion, result, rtol=0, atol=1e-3 15 | ) 16 | -------------------------------------------------------------------------------- /tests/molecular/threesite/test_get_binder_angles.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import stko 4 | from tests.molecular.threesite.case_data import CaseData 5 | 6 | 7 | def test_get_binder_angles(case_data: CaseData) -> None: 8 | threesite_analysis = stko.molecule_analysis.DitopicThreeSiteAnalyser() 9 | 10 | result = threesite_analysis.get_binder_angles(case_data.building_block) 11 | assert np.isclose(case_data.binder_angles[0], result[0], rtol=0, atol=1e-3) 12 | assert np.isclose(case_data.binder_angles[1], result[1], rtol=0, atol=1e-3) 13 | 14 | result = threesite_analysis.get_halfbite_angles(case_data.building_block) 15 | assert np.isclose(case_data.bite_angles[0], result[0], rtol=0, atol=1e-3) 16 | assert np.isclose(case_data.bite_angles[1], result[1], rtol=0, atol=1e-3) 17 | -------------------------------------------------------------------------------- /tests/molecular/threesite/test_get_binder_binder_angle.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import stko 4 | from tests.molecular.threesite.case_data import CaseData 5 | 6 | 7 | def test_get_binder_binder_angle(case_data: CaseData) -> None: 8 | threesite_analysis = stko.molecule_analysis.DitopicThreeSiteAnalyser() 9 | 10 | result = threesite_analysis.get_binder_binder_angle( 11 | case_data.building_block 12 | ) 13 | assert np.isclose( 14 | case_data.binder_binder_angle, 15 | result, 16 | rtol=0, 17 | atol=1e-3, 18 | ) 19 | -------------------------------------------------------------------------------- /tests/molecular/threesite/test_get_binder_centroid_angle.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import stko 4 | from tests.molecular.threesite.case_data import CaseData 5 | 6 | 7 | def test_get_binder_centroid_angle(case_data: CaseData) -> None: 8 | threesite_analysis = stko.molecule_analysis.DitopicThreeSiteAnalyser() 9 | 10 | result = threesite_analysis.get_binder_centroid_angle( 11 | case_data.building_block 12 | ) 13 | assert np.isclose( 14 | case_data.binder_centroid_angle, 15 | result, 16 | rtol=0, 17 | atol=1e-3, 18 | ) 19 | -------------------------------------------------------------------------------- /tests/molecular/threesite/test_get_binder_distance.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import stko 4 | from tests.molecular.threesite.case_data import CaseData 5 | 6 | 7 | def test_get_binder_distance(case_data: CaseData) -> None: 8 | threesite_analysis = stko.molecule_analysis.DitopicThreeSiteAnalyser() 9 | 10 | distance = threesite_analysis.get_binder_distance(case_data.building_block) 11 | assert np.isclose(case_data.binder_distance, distance, rtol=0, atol=1e-3) 12 | -------------------------------------------------------------------------------- /tests/molecular/utilities/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/molecular/utilities/__init__.py -------------------------------------------------------------------------------- /tests/molecular/utilities/test_merge_molecules.py: -------------------------------------------------------------------------------- 1 | import stko 2 | 3 | from .conftest import CaseData 4 | 5 | 6 | def test_merge_molecules(case_data: CaseData) -> None: 7 | merged = stko.molecular_utilities.merge_stk_molecules(case_data.molecules) 8 | assert merged.get_num_atoms() == sum( 9 | [i.get_num_atoms() for i in case_data.molecules] 10 | ) 11 | assert merged.get_num_bonds() == sum( 12 | [i.get_num_bonds() for i in case_data.molecules] 13 | ) 14 | -------------------------------------------------------------------------------- /tests/molecular/utilities/test_seperate_molecules.py: -------------------------------------------------------------------------------- 1 | import stko 2 | 3 | from .conftest import CaseData 4 | 5 | 6 | def test_seperate_molecules(together_case_data: CaseData) -> None: 7 | distinct = stko.molecular_utilities.separate_molecule( 8 | together_case_data.molecule 9 | ) 10 | assert together_case_data.molecule.get_num_atoms() == sum( 11 | [i[0].get_num_atoms() for i in distinct] 12 | ) 13 | assert together_case_data.molecule.get_num_bonds() == sum( 14 | [i[0].get_num_bonds() for i in distinct] 15 | ) 16 | -------------------------------------------------------------------------------- /tests/molecular/z_matrix/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/molecular/z_matrix/__init__.py -------------------------------------------------------------------------------- /tests/molecular/z_matrix/case_data.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import stk 4 | 5 | 6 | @dataclass(frozen=True, slots=True) 7 | class CaseData: 8 | molecule: stk.Molecule 9 | zmatrix: str 10 | -------------------------------------------------------------------------------- /tests/molecular/z_matrix/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import stk 3 | 4 | from .case_data import CaseData 5 | 6 | 7 | @pytest.fixture( 8 | params=( 9 | CaseData( 10 | molecule=stk.BuildingBlock("NCCN"), 11 | zmatrix=( 12 | "N\n" 13 | "C 1 1.44\n" 14 | "C 2 1.531 54.65\n" 15 | "N 3 1.42 111.07 1 -60.0\n" 16 | "H 4 3.353 114.1 2 49.59\n" 17 | "H 5 1.714 52.52 3 -139.34\n" 18 | "H 6 2.495 49.74 4 65.03\n" 19 | "H 7 1.846 87.9 5 -7.22\n" 20 | "H 8 2.377 85.07 6 -58.27\n" 21 | "H 9 1.818 92.5 7 -59.1\n" 22 | "H 10 2.99 69.57 8 119.38\n" 23 | "H 11 1.7510 51.71 9 -161.42" 24 | ), 25 | ), 26 | CaseData( 27 | molecule=stk.BuildingBlock("BrC#CBr"), 28 | zmatrix=( 29 | "Br\nC 1 1.9\nC 2 1.211 0.17\nBr 3 1.892 179.14 1 -171.59" 30 | ), 31 | ), 32 | ), 33 | ) 34 | def case_data(request: pytest.FixtureRequest) -> CaseData: 35 | return request.param 36 | -------------------------------------------------------------------------------- /tests/molecular/z_matrix/test_zmatrix.py: -------------------------------------------------------------------------------- 1 | import stk 2 | 3 | import stko 4 | from tests.molecular.z_matrix.case_data import CaseData 5 | 6 | 7 | def test_zmatrix(case_data: CaseData) -> None: 8 | _test_zmatrix(case_data.molecule, case_data.zmatrix) 9 | 10 | 11 | def _test_zmatrix(molecule: stk.Molecule, zmatrix: str) -> None: 12 | result = stko.ZMatrix().get_zmatrix(molecule) 13 | assert result == zmatrix 14 | -------------------------------------------------------------------------------- /tests/optimizers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/optimizers/__init__.py -------------------------------------------------------------------------------- /tests/optimizers/aligner/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/optimizers/aligner/__init__.py -------------------------------------------------------------------------------- /tests/optimizers/aligner/test_aligner.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import stko 4 | from tests.optimizers.aligner.conftest import CaseData, CasePotential 5 | from tests.optimizers.utilities import ( 6 | inequivalent_position_matrices, 7 | is_equivalent_molecule, 8 | ) 9 | 10 | 11 | def test_aligner(case_molecule: CaseData) -> None: 12 | calculator = stko.RmsdCalculator(case_molecule.initial_molecule) 13 | test_rmsd_unopt = calculator.get_results(case_molecule.molecule).get_rmsd() 14 | optimizer = stko.Aligner( 15 | initial_molecule=case_molecule.initial_molecule, 16 | matching_pairs=(("C", "C"), ("N", "N")), 17 | ) 18 | opt_res = optimizer.optimize(case_molecule.molecule) 19 | is_equivalent_molecule(opt_res, case_molecule.molecule) 20 | inequivalent_position_matrices(opt_res, case_molecule.molecule) 21 | 22 | test_rmsd = calculator.get_results(opt_res).get_rmsd() 23 | 24 | assert np.isclose(test_rmsd, case_molecule.rmsd, atol=1e-2) 25 | assert test_rmsd < test_rmsd_unopt 26 | 27 | 28 | def test_alignment_potential(case_potential: CasePotential) -> None: 29 | aligner = stko.Aligner( 30 | initial_molecule=case_potential.initial_molecule, 31 | matching_pairs=case_potential.pairs, 32 | ) 33 | potential = stko.AlignmentPotential( 34 | matching_pairs=case_potential.pairs, 35 | width=2, 36 | ) 37 | supramolecule = aligner._get_supramolecule(case_potential.molecule) # noqa: SLF001 38 | assert np.isclose( 39 | case_potential.potential, 40 | potential.compute_potential( 41 | supramolecule, 42 | ), 43 | atol=1e-2, 44 | ) 45 | -------------------------------------------------------------------------------- /tests/optimizers/gulp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/optimizers/gulp/__init__.py -------------------------------------------------------------------------------- /tests/optimizers/gulp/conftest.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | import stk 4 | 5 | import stko 6 | 7 | 8 | def a_molecule() -> stk.BuildingBlock: 9 | return stk.BuildingBlock(smiles="CC") 10 | 11 | 12 | @pytest.fixture 13 | def unoptimized_mol() -> stk.BuildingBlock: 14 | return a_molecule() 15 | 16 | 17 | class PassingOptimizer(stko.Optimizer): 18 | def optimize(self, mol: stko.MoleculeT) -> stko.MoleculeT: 19 | return mol.with_centroid(np.array([1, 3, 3])) 20 | 21 | 22 | class FailingOptimizer(stko.Optimizer): 23 | def optimize(self, mol: stko.MoleculeT) -> stko.MoleculeT: # noqa: ARG002 24 | raise RuntimeError 25 | 26 | 27 | @pytest.fixture 28 | def passing_optimizer() -> PassingOptimizer: 29 | return PassingOptimizer() 30 | 31 | 32 | @pytest.fixture 33 | def failing_optimizer() -> FailingOptimizer: 34 | return FailingOptimizer() 35 | -------------------------------------------------------------------------------- /tests/optimizers/gulp/fixtures/conformer.xyz: -------------------------------------------------------------------------------- 1 | 8 2 | 1,5.0,0.207467138253947,0.245970616427967,267.505966560289 3 | C -0.74873 0.01254 0.08187 4 | C 0.75325 -0.00453 -0.03139 5 | H -1.21565 -0.9294 -0.08591 6 | H -1.00574 0.41323 1.09345 7 | H -1.09608 0.79503 -0.60147 8 | H 1.02245 -0.86479 -0.73236 9 | H 1.19827 0.93931 -0.43282 10 | H 1.25464 -0.29976 0.89505 11 | -------------------------------------------------------------------------------- /tests/optimizers/gulp/fixtures/gulp_MD_template.xyz: -------------------------------------------------------------------------------- 1 | 8 2 | 3 | C -0.740311 0.031708 0.101938 4 | C 0.759745 -0.018037 -0.034338 5 | H -1.147794 -0.631419 -0.709389 6 | H -1.112740 -0.392374 1.046552 7 | H -1.126246 1.053504 -0.103446 8 | H 0.979395 0.035073 -1.132194 9 | H 1.255730 0.873409 0.404376 10 | H 1.132222 -0.951865 0.426502 11 | -------------------------------------------------------------------------------- /tests/optimizers/maeextractor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/optimizers/maeextractor/__init__.py -------------------------------------------------------------------------------- /tests/optimizers/maeextractor/case_data.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | 4 | @dataclass(frozen=True, slots=True) 5 | class CaseData: 6 | run_name: str 7 | mae_path: str 8 | n: int 9 | energies: list[tuple[float, int]] 10 | min_energy: float 11 | path: str 12 | name: str 13 | -------------------------------------------------------------------------------- /tests/optimizers/maeextractor/test-out.maegz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/optimizers/maeextractor/test-out.maegz -------------------------------------------------------------------------------- /tests/optimizers/maeextractor/test_maeextractor.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | from stko import MAEExtractor 4 | from tests.optimizers.maeextractor.case_data import CaseData 5 | 6 | 7 | def test_maeextractor(case_data: CaseData) -> None: 8 | """Test :class:`.MAEExtractor`.""" 9 | dir_path = Path(__file__).resolve().parent 10 | # Extract the lowest energy conformer into its own .mae file. 11 | extractor = MAEExtractor( 12 | run_name=str(dir_path / case_data.run_name), 13 | n=case_data.n, 14 | ) 15 | 16 | assert extractor.mae_path.name == case_data.mae_path 17 | 18 | assert len(extractor.energies) == len(case_data.energies) 19 | min_energy = 1e24 20 | for test, known in zip( 21 | extractor.energies, case_data.energies, strict=True 22 | ): 23 | assert test == known 24 | min_energy = min(test[0], min_energy) 25 | 26 | assert min_energy == extractor.min_energy 27 | 28 | assert extractor.min_energy == case_data.min_energy 29 | 30 | assert extractor.path.name == case_data.path 31 | 32 | dir_path.joinpath("test-out.mae").unlink() 33 | if case_data.n == 1: 34 | dir_path.joinpath("test-outEXTRACTED_76.mae").unlink() 35 | elif case_data.n == 4: # noqa: PLR2004 36 | dir_path.joinpath("test-outEXTRACTED_36_conf_2.mae").unlink() 37 | dir_path.joinpath("test-outEXTRACTED_6_conf_3.mae").unlink() 38 | dir_path.joinpath("test-outEXTRACTED_76_conf_0.mae").unlink() 39 | dir_path.joinpath("test-outEXTRACTED_78_conf_1.mae").unlink() 40 | -------------------------------------------------------------------------------- /tests/optimizers/openmm/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/optimizers/openmm/__init__.py -------------------------------------------------------------------------------- /tests/optimizers/openmm/conftest.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import pytest 4 | import stk 5 | 6 | 7 | @dataclass(frozen=True, slots=True) 8 | class CaseData: 9 | molecule: stk.Molecule 10 | opt_energy: float 11 | 12 | 13 | @pytest.fixture( 14 | scope="session", 15 | params=[ 16 | CaseData( 17 | molecule=stk.BuildingBlock("C"), 18 | opt_energy=0.22629718073104876, 19 | ), 20 | ], 21 | ) 22 | def case_molecule(request: pytest.FixtureRequest) -> CaseData: 23 | return request.param 24 | -------------------------------------------------------------------------------- /tests/optimizers/openmm/test_openmm.py: -------------------------------------------------------------------------------- 1 | try: 2 | from openff.toolkit import ForceField 3 | except ImportError: 4 | ForceField = None 5 | import numpy as np 6 | 7 | import stko 8 | 9 | from .conftest import CaseData 10 | 11 | 12 | def test_openmm(case_molecule: CaseData) -> None: 13 | if ForceField is not None: 14 | optimiser = stko.OpenMMForceField( 15 | # Load the openff-2.1.0 force field appropriate for 16 | # vacuum calculations (without constraints) 17 | force_field=ForceField("openff_unconstrained-2.1.0.offxml"), 18 | restricted=False, 19 | partial_charges_method="espaloma-am1bcc", 20 | ) 21 | opt_molecule = optimiser.optimize(case_molecule.molecule) 22 | 23 | energy = ( 24 | stko.OpenMMEnergy( 25 | force_field=ForceField("openff_unconstrained-2.1.0.offxml"), 26 | partial_charges_method="espaloma-am1bcc", 27 | ).get_energy(opt_molecule), 28 | ) 29 | 30 | assert np.isclose(energy, case_molecule.opt_energy) 31 | -------------------------------------------------------------------------------- /tests/optimizers/optimizer/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/optimizers/optimizer/__init__.py -------------------------------------------------------------------------------- /tests/optimizers/optimizer/conftest.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | import stk 4 | 5 | import stko 6 | 7 | 8 | def a_molecule() -> stk.BuildingBlock: 9 | return stk.BuildingBlock(smiles="CC") 10 | 11 | 12 | @pytest.fixture 13 | def unoptimized_mol() -> stk.BuildingBlock: 14 | return a_molecule() 15 | 16 | 17 | class PassingOptimizer(stko.Optimizer): 18 | def optimize(self, mol: stko.MoleculeT) -> stko.MoleculeT: 19 | return mol.with_centroid(np.array([1, 3, 3])) 20 | 21 | 22 | class FailingOptimizer(stko.Optimizer): 23 | def optimize(self, mol: stko.MoleculeT) -> stko.MoleculeT: # noqa: ARG002 24 | msg = "I am a failing optimizer." 25 | raise RuntimeError(msg) 26 | 27 | 28 | @pytest.fixture 29 | def passing_optimizer() -> PassingOptimizer: 30 | return PassingOptimizer() 31 | 32 | 33 | @pytest.fixture 34 | def failing_optimizer() -> FailingOptimizer: 35 | return FailingOptimizer() 36 | -------------------------------------------------------------------------------- /tests/optimizers/optimizer/test_optimizers.py: -------------------------------------------------------------------------------- 1 | from copy import deepcopy 2 | 3 | import stk 4 | 5 | import stko 6 | from tests.optimizers.optimizer.conftest import ( 7 | FailingOptimizer, 8 | PassingOptimizer, 9 | ) 10 | from tests.optimizers.utilities import ( 11 | inequivalent_position_matrices, 12 | is_equivalent_molecule, 13 | ) 14 | 15 | 16 | def test_optimizer_sequence( 17 | passing_optimizer: PassingOptimizer, 18 | unoptimized_mol: stk.BuildingBlock, 19 | ) -> None: 20 | opts = [deepcopy(passing_optimizer) for _ in range(10)] 21 | opt_seq = stko.OptimizerSequence(*opts) 22 | opt_res = opt_seq.optimize(unoptimized_mol) 23 | is_equivalent_molecule(opt_res, unoptimized_mol) 24 | inequivalent_position_matrices(opt_res, unoptimized_mol) 25 | 26 | 27 | def test_trycatchoptimizer( 28 | passing_optimizer: PassingOptimizer, 29 | failing_optimizer: FailingOptimizer, 30 | unoptimized_mol: stk.BuildingBlock, 31 | ) -> None: 32 | opt = stko.TryCatchOptimizer( 33 | try_optimizer=failing_optimizer, 34 | catch_optimizer=passing_optimizer, 35 | ) 36 | opt_res = opt.optimize(unoptimized_mol) 37 | is_equivalent_molecule(opt_res, unoptimized_mol) 38 | inequivalent_position_matrices(opt_res, unoptimized_mol) 39 | -------------------------------------------------------------------------------- /tests/optimizers/rdkit/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JelfsMaterialsGroup/stko/05fd3669270808e89ad8fa22ba5432678bb9ff7d/tests/optimizers/rdkit/__init__.py -------------------------------------------------------------------------------- /tests/optimizers/rdkit/test_rdkit_optimizers.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import stk 3 | 4 | import stko 5 | from tests.optimizers.rdkit.conftest import CaseData 6 | from tests.optimizers.utilities import ( 7 | inequivalent_position_matrices, 8 | is_equivalent_molecule, 9 | ) 10 | 11 | 12 | def test_mmff_opt(case_mmff_molecule: CaseData) -> None: 13 | energy = stko.MMFFEnergy().get_energy(case_mmff_molecule.molecule) 14 | optimizer = stko.MMFF() 15 | opt_res = optimizer.optimize(case_mmff_molecule.molecule) 16 | is_equivalent_molecule(opt_res, case_mmff_molecule.molecule) 17 | inequivalent_position_matrices(opt_res, case_mmff_molecule.molecule) 18 | opt_energy = stko.MMFFEnergy().get_energy(opt_res) 19 | assert np.isclose(energy, case_mmff_molecule.unoptimised_energy, atol=1e-3) 20 | assert opt_energy < case_mmff_molecule.unoptimised_energy 21 | 22 | 23 | def test_uff_opt(case_uff_molecule: CaseData) -> None: 24 | energy = stko.UFFEnergy().get_energy(case_uff_molecule.molecule) 25 | optimizer = stko.UFF() 26 | opt_res = optimizer.optimize(case_uff_molecule.molecule) 27 | is_equivalent_molecule(opt_res, case_uff_molecule.molecule) 28 | inequivalent_position_matrices(opt_res, case_uff_molecule.molecule) 29 | opt_energy = stko.UFFEnergy().get_energy(opt_res) 30 | assert np.isclose(energy, case_uff_molecule.unoptimised_energy, atol=1e-3) 31 | assert opt_energy < case_uff_molecule.unoptimised_energy 32 | 33 | 34 | def test_etkdg_opt(case_etkdg_molecule: stk.BuildingBlock) -> None: 35 | optimizer = stko.ETKDG() 36 | opt_res = optimizer.optimize(case_etkdg_molecule) 37 | is_equivalent_molecule(opt_res, case_etkdg_molecule) 38 | inequivalent_position_matrices(opt_res, case_etkdg_molecule) 39 | 40 | optimizer = stko.ETKDG(random_seed=2584) 41 | opt_res = optimizer.optimize(case_etkdg_molecule) 42 | is_equivalent_molecule(opt_res, case_etkdg_molecule) 43 | inequivalent_position_matrices(opt_res, case_etkdg_molecule) 44 | -------------------------------------------------------------------------------- /tests/optimizers/utilities.py: -------------------------------------------------------------------------------- 1 | import itertools as it 2 | 3 | import numpy as np 4 | import stk 5 | 6 | 7 | def is_equivalent_atom(atom1: stk.Atom, atom2: stk.Atom) -> None: 8 | assert atom1.get_id() == atom2.get_id() 9 | assert atom1.get_charge() == atom2.get_charge() 10 | assert atom1.get_atomic_number() == atom2.get_atomic_number() 11 | assert atom1.__class__ is atom2.__class__ 12 | 13 | 14 | def is_equivalent_bond(bond1: stk.Bond, bond2: stk.Bond) -> None: 15 | assert bond1.__class__ is bond2.__class__ 16 | assert bond1.get_order() == bond2.get_order() 17 | assert bond1.get_periodicity() == bond2.get_periodicity() 18 | is_equivalent_atom(bond1.get_atom1(), bond2.get_atom1()) 19 | is_equivalent_atom(bond1.get_atom2(), bond2.get_atom2()) 20 | 21 | 22 | def is_equivalent_molecule( 23 | molecule1: stk.Molecule, molecule2: stk.Molecule 24 | ) -> None: 25 | atoms = it.zip_longest( 26 | molecule1.get_atoms(), 27 | molecule2.get_atoms(), 28 | ) 29 | for atom1, atom2 in atoms: 30 | is_equivalent_atom(atom1, atom2) 31 | 32 | bonds = it.zip_longest( 33 | molecule1.get_bonds(), 34 | molecule2.get_bonds(), 35 | ) 36 | for bond1, bond2 in bonds: 37 | is_equivalent_bond(bond1, bond2) 38 | 39 | 40 | def inequivalent_position_matrices( 41 | molecule1: stk.Molecule, molecule2: stk.Molecule 42 | ) -> None: 43 | pos1 = molecule1.get_position_matrix() 44 | pos2 = molecule2.get_position_matrix() 45 | 46 | assert not np.allclose(pos1, pos2) 47 | --------------------------------------------------------------------------------