Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ top of things.
* Make commits of logical units
* Make sure your commit messages are informative
* Make sure you have added the necessary tests for your changes
* Add examples: take a look at the corresponding [README.md](./examples/README.md)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also update CHANGELOG (here and for your change!)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should I mention that I changed the CONTRIBUTING.md file in the CHANGELOG?


## Submitting Changes

Expand Down
34 changes: 17 additions & 17 deletions doc/source/examples/COSMORSConformers/cosmors_conformers.ipynb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ Initial imports

from scm.plams.recipes.adfcosmorsconformers import ADFCOSMORSConfJob, ADFCOSMORSConfFilter
from scm.plams import Molecule, from_smiles, Settings, init, config, JobRunner
from scm.conformers import ConformersJob
from scm.plams import ConformersJob

# this line is not required in AMS2025+
init();

::

PLAMS working folder: /path/plams/examples/COSMORSConformers/plams_workdir
PLAMS working folder: /path/plams/examples/COSMORSConformers/plams_workdir.002

.. code:: ipython3

Expand Down Expand Up @@ -80,21 +80,21 @@ Finally, we give this information to the ``ADFCOSMORSConfJob`` class. We also sp

::

[19.03|15:33:37] JOB plamsjob STARTED
[19.03|15:33:37] Waiting for job plamsjob to finish
[19.03|15:33:37] JOB plamsjob/conformers_uff STARTED
[19.03|15:33:37] JOB plamsjob/additional_1 STARTED
[19.03|15:33:37] JOB plamsjob/adf_conformers STARTED
[19.03|15:33:37] JOB plamsjob/adf_filter STARTED
[19.03|15:33:37] Waiting for job conformers_uff to finish
[19.03|15:33:37] Waiting for job adf_filter to finish
[19.03|15:33:37] Waiting for job additional_1 to finish
[19.03|15:33:37] Waiting for job adf_conformers to finish
[19.03|15:33:44] JOB plamsjob/conformers_uff SUCCESSFUL
[19.03|15:33:45] JOB plamsjob/additional_1 SUCCESSFUL
[19.03|15:43:18] JOB plamsjob/adf_conformers SUCCESSFUL
[19.03|15:43:19] JOB plamsjob/adf_filter SUCCESSFUL
[19.03|15:43:19] JOB plamsjob/replay STARTED
[12.09|16:17:48] JOB plamsjob STARTED
[12.09|16:17:48] Waiting for job plamsjob to finish
[12.09|16:17:48] JOB plamsjob/conformers_uff STARTED
[12.09|16:17:48] JOB plamsjob/additional_1 STARTED
[12.09|16:17:48] JOB plamsjob/adf_conformers STARTED
[12.09|16:17:48] JOB plamsjob/adf_filter STARTED
[12.09|16:17:48] Waiting for job adf_filter to finish
[12.09|16:17:48] Waiting for job conformers_uff to finish
[12.09|16:17:48] Waiting for job additional_1 to finish
[12.09|16:17:48] Waiting for job adf_conformers to finish
[12.09|16:17:52] JOB plamsjob/conformers_uff SUCCESSFUL
[12.09|16:17:54] JOB plamsjob/additional_1 SUCCESSFUL
[12.09|16:24:45] JOB plamsjob/adf_conformers SUCCESSFUL
[12.09|16:24:45] JOB plamsjob/adf_filter SUCCESSFUL
[12.09|16:24:45] JOB plamsjob/replay STARTED
... (PLAMS log lines truncated) ...

.. code:: ipython3
Expand Down
148 changes: 56 additions & 92 deletions doc/source/examples/ConformersGeneration/conformers.ipynb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ Initial imports
import matplotlib.pyplot as plt
import numpy as np

from scm.conformers import ConformersJob
from scm.plams import ConformersJob
from scm.plams import *

# this line is not required in AMS2025+
init();

::

PLAMS working folder: /path/plams/examples/ConformersGeneration/plams_workdir
PLAMS working folder: /path/plams/examples/ConformersGeneration/plams_workdir.002

Initial structure
~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -83,10 +83,10 @@ Run conformer generation

::

[04.02|15:07:47] JOB generate STARTED
[04.02|15:07:47] JOB generate RUNNING
[04.02|15:08:56] JOB generate FINISHED
[04.02|15:08:56] JOB generate SUCCESSFUL
[12.09|16:10:47] JOB generate STARTED
[12.09|16:10:47] JOB generate RUNNING
[12.09|16:10:51] JOB generate FINISHED
[12.09|16:10:51] JOB generate SUCCESSFUL

Conformer generation results
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -115,33 +115,6 @@ Some helper functions
def get_conformers(job: ConformersJob):
return job.results.get_conformers()


def plot_conformers(job: ConformersJob, indices=None, temperature=298, unit="kcal/mol", lowest=True):
molecules = get_conformers(job)
energies = get_energies(job, unit)
populations = get_populations(job, temperature)

if isinstance(indices, int):
N_plot = min(indices, len(energies))
if lowest:
indices = list(range(N_plot))
else:
indices = np.linspace(0, len(energies) - 1, N_plot, dtype=np.int32)
if indices is None:
indices = list(range(min(3, len(energies))))

fig, axes = plt.subplots(1, len(indices), figsize=(12, 3))
if len(indices) == 1:
axes = [axes]

for ax, i in zip(axes, indices):
mol = molecules[i]
E = energies[i]
population = populations[i]

plot_molecule(mol, ax=ax)
ax.set_title(f"#{i+1}\nΔE = {E:.2f} kcal/mol\nPop.: {population:.3f} (T = {temperature} K)")

.. code:: ipython3

try:
Expand Down Expand Up @@ -203,27 +176,27 @@ You can also see the **relative populations** of these conformers at the specifi
============ ============= ================
Conformer Id ΔE [kcal/mol] Pop. (T = 298 K)
============ ============= ================
1 0.00 0.557
2 0.57 0.214
3 1.00 0.102
4 1.18 0.076
5 2.12 0.015
6 2.22 0.013
7 2.40 0.010
8 2.50 0.008
9 3.44 0.002
10 3.53 0.001
11 3.76 0.001
12 5.50 0.000
13 6.78 0.000
14 12.85 0.000
15 15.70 0.000
16 18.79 0.000
1 0.00 0.503
2 0.30 0.302
3 0.67 0.162
4 2.11 0.014
5 2.12 0.014
6 2.89 0.004
7 3.84 0.001
8 6.71 0.000
9 13.42 0.000
10 14.07 0.000
11 15.25 0.000
12 15.79 0.000
13 15.83 0.000
14 17.77 0.000
15 18.79 0.000
16 23.98 0.000
============ ============= ================

.. code:: ipython3

plot_conformers(generate_job, 4, temperature=temperature, unit=unit, lowest=True)
generate_job.results.plot_conformers(4, temperature=temperature, unit=unit, lowest=True);

.. figure:: conformers_files/conformers_18_0.png

Expand All @@ -249,7 +222,7 @@ Below, the most stable conformers (within 8 kcal/mol of the most stable conforme

::

InputConformersSet /path/plams/examples/ConformersGeneration/plams_workdir.006/generate/conformers.rkf
InputConformersSet /path/plams/examples/ConformersGeneration/plams_workdir.002/generate/conformers.rkf

InputMaxEnergy 8.0

Expand All @@ -265,10 +238,10 @@ Below, the most stable conformers (within 8 kcal/mol of the most stable conforme

::

[04.02|15:08:56] JOB reoptimize STARTED
[04.02|15:08:56] JOB reoptimize RUNNING
[04.02|15:09:01] JOB reoptimize FINISHED
[04.02|15:09:01] JOB reoptimize SUCCESSFUL
[12.09|16:11:00] JOB reoptimize STARTED
[12.09|16:11:00] JOB reoptimize RUNNING
[12.09|16:11:02] JOB reoptimize FINISHED
[12.09|16:11:02] JOB reoptimize SUCCESSFUL

.. code:: ipython3

Expand All @@ -277,22 +250,18 @@ Below, the most stable conformers (within 8 kcal/mol of the most stable conforme
============ ============= ================
Conformer Id ΔE [kcal/mol] Pop. (T = 298 K)
============ ============= ================
1 0.00 0.270
2 0.11 0.225
3 0.41 0.134
4 0.63 0.093
5 0.91 0.058
6 0.97 0.052
7 1.02 0.048
8 1.14 0.039
9 1.19 0.036
10 1.41 0.025
11 1.57 0.019
1 0.00 0.540
2 0.64 0.184
3 0.84 0.131
4 1.09 0.086
5 1.82 0.025
6 1.90 0.022
7 2.25 0.012
============ ============= ================

.. code:: ipython3

plot_conformers(reoptimize_job, 4, temperature=temperature, unit=unit, lowest=True)
reoptimize_job.results.plot_conformers(4, temperature=temperature, unit=unit, lowest=True);

.. figure:: conformers_files/conformers_23_0.png

Expand All @@ -318,10 +287,10 @@ The **Score** task runs **SinglePoint** jobs on the conformers in a set. This le

::

[04.02|15:09:02] JOB score STARTED
[04.02|15:09:02] JOB score RUNNING
[04.02|15:09:05] JOB score FINISHED
[04.02|15:09:05] JOB score SUCCESSFUL
[12.09|16:11:09] JOB score STARTED
[12.09|16:11:09] JOB score RUNNING
[12.09|16:11:10] JOB score FINISHED
[12.09|16:11:10] JOB score SUCCESSFUL

.. code:: ipython3

Expand All @@ -330,22 +299,18 @@ The **Score** task runs **SinglePoint** jobs on the conformers in a set. This le
============ ============= ================
Conformer Id ΔE [kcal/mol] Pop. (T = 298 K)
============ ============= ================
1 0.00 0.373
2 0.34 0.209
3 0.40 0.188
4 0.70 0.114
5 1.06 0.063
6 1.85 0.016
7 1.89 0.015
8 2.41 0.006
9 2.48 0.006
10 2.59 0.005
11 2.73 0.004
1 0.00 0.654
2 0.89 0.146
3 0.93 0.136
4 1.70 0.037
5 2.12 0.018
6 2.60 0.008
7 4.01 0.001
============ ============= ================

.. code:: ipython3

plot_conformers(score_job, 4, temperature=temperature, unit=unit, lowest=True)
score_job.results.plot_conformers(4, temperature=temperature, unit=unit, lowest=True);

.. figure:: conformers_files/conformers_27_0.png

Expand All @@ -372,10 +337,10 @@ Below, we filter the conformers set to only the conformers within 1 kcal/mol of

::

[04.02|15:09:05] JOB filter STARTED
[04.02|15:09:05] JOB filter RUNNING
[04.02|15:09:06] JOB filter FINISHED
[04.02|15:09:06] JOB filter SUCCESSFUL
[12.09|16:11:15] JOB filter STARTED
[12.09|16:11:15] JOB filter RUNNING
[12.09|16:11:15] JOB filter FINISHED
[12.09|16:11:15] JOB filter SUCCESSFUL

.. code:: ipython3

Expand All @@ -384,15 +349,14 @@ Below, we filter the conformers set to only the conformers within 1 kcal/mol of
============ ============= ================
Conformer Id ΔE [kcal/mol] Pop. (T = 298 K)
============ ============= ================
1 0.00 0.421
2 0.34 0.236
3 0.40 0.213
4 0.70 0.129
1 0.00 0.699
2 0.89 0.156
3 0.93 0.145
============ ============= ================

.. code:: ipython3

plot_conformers(filter_job, 4, temperature=temperature, unit=unit, lowest=True)
filter_job.results.plot_conformers(4, temperature=temperature, unit=unit, lowest=True);

.. figure:: conformers_files/conformers_32_0.png

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading