Skip to content

Commit 9553e9c

Browse files
authored
Merge pull request #582 from openforcefield/proper_torsion_wbo
Add proper torsion fractional bond interpolation
2 parents a2f1ff3 + 624d9ac commit 9553e9c

File tree

9 files changed

+1214
-87
lines changed

9 files changed

+1214
-87
lines changed

The-SMIRNOFF-force-field-format.md

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,10 +475,47 @@ U = \sum_{i=1}^N k_i * (1 + cos(periodicity_i * phi - phase_i))
475475

476476
If the `potential` attribute is omitted, it defaults to `k*(1+cos(periodicity*theta-phase))`.
477477

478-
| ProperTorsions section tag version | Tag attributes and default values | Required parameter attributes | Optional parameter attributes |
479-
|-------------------------------------|--------------------------------------------------------------------------|---------------------------------------|-------------------------------|
480-
| 0.3 | `potential="k*(1+cos(periodicity*theta-phase))"`, `default_idivf="auto"` | `smirks`, `k`, `phase`, `periodicity` | `idivf`, `id`, `parent_id` |
481478

479+
#### Fractional torsion bond orders
480+
481+
Fractional torsion bond orders can be used to allow interpolation and extrapolation of torsion parameters.
482+
This is similar to the functionality provided by fractional bond orders detailed above.
483+
For example, these parameters:
484+
```XML
485+
<ProperTorsions version="0.3" potential="k*(1+cos(periodicity*theta-phase))" default_idivf="auto">
486+
<Proper smirks="[*:1]:[#6X4:2]-[#6X4:3]:[*:4]" periodicity1="2" phase1="0.0 * degree" k1="1.00*kilocalories_per_mole" idivf1="1.0"/>
487+
<Proper smirks="[*:1]:[#6X4:2]=[#6X4:3]:[*:4]" periodicity1="2" phase1="0.0 * degree" k1="1.80*kilocalories_per_mole" idivf1="1.0"/>
488+
...
489+
```
490+
can be replaced by a single parameter line by first defining the `fractional_bondorder_method` header-level attribute to specify a method for computing the fractional bond order and `fractional_bondorder_interpolation` for specifying the procedure for interpolating parameters between specified integer bond orders:
491+
```XML
492+
<ProperTorsions version="0.3" potential="k*(1+cos(periodicity*theta-phase))" default_idivf="auto" fractional_bondorder_method="AM1-Wiberg" fractional_bondorder_interpolation="linear">
493+
<Proper smirks="[*:1]:[#6X4:2]~[#6X4:3]:[*:4]" periodicity1="2" phase1="0.0 * degree" k1_bondorder1="1.00*kilocalories_per_mole" k1_bondorder2="1.80*kilocalories_per_mole" idivf1="1.0"/>
494+
...
495+
```
496+
This allows specification of the barrier height for e.g. bond orders 1 and 2 (single and double bonds), and then interpolation between those based on the partial/fractional bond order.
497+
Note that in actual usage partial/fractional bond order may never be exactly 1 or 2, or perhaps even near 2; these values only serve to define the slope of the line used for interpolation.
498+
In the example above, we replaced the two proper torsion terms (one single central bond (`-`) and one double central bond (`=`)) with a single term giving the barrier heights for bond order 1 and 2.
499+
If there are cases where the fractional bond order is 1.5, this can correspond to e.g. an aromatic bond.
500+
When barrier heights for more than two integer bond orders are specified, (say, 1, 2, and 3), the interpolation lines are drawn between successive points as a piecewiese linear function.
501+
502+
Cases in which the fractional bond order for the central bond is outside of the bond orders specified (e.g. 1 and 2 above), the barrier height ``k#`` is *extrapolated* using the same slope of the line used for interpolation.
503+
This works even when barrier heights for more than two integer bond orders are specified (say, 1, 2, and 3), in which case the piecewise linear extrapolation beyond the bounds uses the slope of the line defined by the nearest two bond orders.
504+
In other words, a fractional bond order of 3.2 would yield an interpolated `k#` value determined by the interpolation line between ``k#_bondorder2`` and ``k#_bondorder3``.
505+
A fractional bond order of .9 would yield an interpolated `k#` value determined by the interpolation line between ``k#_bondorder1`` and ``k#_bondorder2``.
506+
507+
508+
Some key usage points:
509+
* `fractional_bondorder_method` defaults to `AM1-Wiberg`.
510+
* `fractional_bondorder_interpolation` defaults to `linear`, which is the only supported scheme for now.
511+
512+
| ProperTorsions section tag version | Tag attributes and default values | Required parameter attributes | Optional parameter attributes |
513+
|-------------------------------------|---------------------------------------------------------------------------|---------------------------------------|-------------------------------|
514+
| 0.3 | `potential="k*(1+cos(periodicity*theta-phase))"`, `default_idivf="auto"`, | `smirks`, `k`, `phase`, `periodicity` | `idivf`, `id`, `parent_id` |
515+
|-------------------------------------|---------------------------------------------------------------------------|---------------------------------------|-------------------------------|
516+
| 0.4 | `potential="k*(1+cos(periodicity*theta-phase))"`, `default_idivf="auto"`, | `smirks`, `k_bondorder`, | `idivf`, `id`, `parent_id` |
517+
| | `fractional_bondorder_method="AM1-Wiberg"`, | `phase`, `periodicity` | |
518+
| | `fractional_bondorder_interpolation="linear"` | | |
482519

483520
### `<ImproperTorsions>`
484521

docs/releasehistory.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ New features
162162
- `PR #573 <https://github.com/openforcefield/openforcefield/pull/573>`_:
163163
Adds ``quacpac`` error output to ``quacpac`` failure in ``Molecule.compute_partial_charges_am1bcc``.
164164
- `PR #560 <https://github.com/openforcefield/openforcefield/issues/560>`_: Added visualization method to the the Molecule class.
165+
- `PR #582 <https://github.com/openforcefield/openforcefield/pull/582>`_: Added fractional bond order interpolation
166+
Adds `return_topology` kwarg to
167+
:py:meth:`Forcefield.create_openmm_system <openforcefield.typing.engines.smirnoff.forcefield.ForceField.create_openmm_system>`,
168+
which returns the processed topology along with the system when ``True`` (default ``False``).
165169

166170

167171
Behavior changed
@@ -234,7 +238,7 @@ Tests added
234238
:py:meth:`Molecule.chemical_environment_matches <openforcefield.topology.Molecule.chemical_environment_matches>`
235239
to check that the complete set of matches is returned.
236240
- `PR #509 <https://github.com/openforcefield/openforcefield/pull/509>`_: Added test for
237-
:py:meth:`Forcefield.create_openmm_system <openforcefield.typing.engines.smirnoff.forcefield.create_openmm_system>`
241+
:py:meth:`Forcefield.create_openmm_system <openforcefield.typing.engines.smirnoff.forcefield.ForceField.create_openmm_system>`
238242
to check that a protein system can be created.
239243
- `PR #506 <https://github.com/openforcefield/openforcefield/pull/506>`_: Added a test for the molecule
240244
identified in issue #513 as loosing aromaticity when converted to rdkit.
@@ -253,6 +257,8 @@ Tests added
253257
for ``quacpac`` failure in ``Molecule.compute_partial_charges_am1bcc``.
254258
- `PR #579 <https://github.com/openforcefield/openforcefield/pull/579>`_: Adds regression tests to ensure RDKit can be
255259
be used to write multi-model PDB files.
260+
- `PR #582 <https://github.com/openforcefield/openforcefield/pull/582>`_: Added fractional bond order interpolation tests,
261+
tests for `ValidatedDict <openforcefield.utils.collections.ValidatedDict>`
256262

257263

258264
Bugfixes

0 commit comments

Comments
 (0)