Skip to content

Commit ce2dd7c

Browse files
authored
Merge branch 'master' into link-ff-repos
2 parents 88d25a1 + f8ea460 commit ce2dd7c

File tree

11 files changed

+956
-315
lines changed

11 files changed

+956
-315
lines changed

The-SMIRNOFF-force-field-format.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,14 @@ Currently, only classical fixed point charge models are supported, but future ex
190190

191191
### `<LibraryCharges>`: Library charges for polymeric residues and special solvent models
192192

193-
.. warning:: This functionality is not yet implemented and will appear in a future version of the toolkit. Please see `Issue 25 on the Open Force Field Toolkit issue tracker <https://github.com/openforcefield/openforcefield/issues/25>`_.
194-
195193
A mechanism is provided for specifying library charges that can be applied to molecules or residues that match provided templates.
196194
Library charges are applied first, and atoms for which library charges are applied will be excluded from alternative charging schemes listed below.
197195

198196
For example, to assign partial charges for a non-terminal ALA residue from the [AMBER ff14SB](http://doi.org/10.1021/acs.jctc.5b00255) parameter set:
199197
```XML
200198
<LibraryCharges version="0.3">
201-
<!-- match a non-terminal alanine residue with AMBER ff14SB partial charges-->
202-
<LibraryCharge name="ALA" smirks="[NX3:1]([#1:2])([#6])[#6H1:3]([#1:4])([#6:5]([#1:6])([#1:7])[#1:8])[#6:9](=[#8:10])[#7]" charge1="-0.4157*elementary_charge" charge2="0.2719*elementary_charge" charge3="0.0337*elementary_charge" charge4="0.0823*elementary_charge" charge5="-0.1825*elementary_charge" charge6="0.0603*elementary_charge" charge7="0.0603*elementary_charge" charge8="0.0603*elementary_charge" charge9="0.5973*elementary_charge" charge10="-0.5679*elementary_charge">
199+
<!-- match a non-terminal alanine residue with AMBER ff14SB partial charges -->
200+
<LibraryCharge name="ALA" smirks="[NX3:1]([#1:2])([#6])[#6H1:3]([#1:4])([#6:5]([#1:6])([#1:7])[#1:8])[#6:9](=[#8:10])[#7]" charge1="-0.4157*elementary_charge" charge2="0.2719*elementary_charge" charge3="0.0337*elementary_charge" charge4="0.0823*elementary_charge" charge5="-0.1825*elementary_charge" charge6="0.0603*elementary_charge" charge7="0.0603*elementary_charge" charge8="0.0603*elementary_charge" charge9="0.5973*elementary_charge" charge10="-0.5679*elementary_charge"/>
203201
...
204202
</LibraryCharges>
205203
```
@@ -214,10 +212,17 @@ For example, to ensure water molecules are assigned partial charges for [TIP3P](
214212
```XML
215213
<LibraryCharges version="0.3">
216214
<!-- TIP3P water oxygen with charge override -->
217-
<LibraryCharge name="TIP3P" smirks="[#1:1]-[#8X2H2+0:2]-[#1:3]" charge1="+0.417*elementary_charge" charge2="-0.834*elementary_charge" charge3="+0.417*elementary_charge"/>
215+
<LibraryCharge name="TIP3P" smirks="[#1:1]-[#8X2H2+0:2]-[#1:3]" charge1="0.417*elementary_charge" charge2="-0.834*elementary_charge" charge3="0.417*elementary_charge"/>
218216
</LibraryCharges>
219217
```
220218

219+
220+
| LibraryCharges section tag version | Tag attributes and default values | Required parameter attributes | Optional parameter attributes |
221+
|------------------------------------|--------------------------------------|---------------------------------|-------------------------------|
222+
| 0.3 | | `smirks`, `charges` (indexed) | `name`, `id`, `parent_id` |
223+
224+
225+
221226
### `<ChargeIncrementModel>`: Small molecule and fragment charges
222227

223228
.. warning:: This functionality is not yet implemented and will appear in a future version of the toolkit. This area of the SMIRNOFF spec is under further consideration. Please see `Issue 208 on the Open Force Field Toolkit issue tracker <https://github.com/openforcefield/openforcefield/issues/208>`_.

docs/releasehistory.rst

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,49 @@ Releases follow the ``major.minor.micro`` scheme recommended by `PEP440 <https:/
1111
Current Development
1212
-------------------
1313

14+
New features
15+
""""""""""""
16+
- `PR #433 <https://github.com/openforcefield/openforcefield/pull/433>`_: Closes
17+
`Issue #25 <https://github.com/openforcefield/openforcefield/issues/25>`_ by adding
18+
initial support for the
19+
`LibraryCharges tag in the SMIRNOFF specification <https://open-forcefield-toolkit.readthedocs.io/en/latest/smirnoff.html#librarycharges-library-charges-for-polymeric-residues-and-special-solvent-models>`_
20+
using
21+
:py:class:`LibraryChargeHandler <openforcefield.typing.engines.smirnoff.parameters.LibraryChargeHandler>`.
22+
For a molecule to have charges assigned using LibraryCharges, all of its atoms must be covered by
23+
at least one LibraryCharge. If an atom is covered by multiple LibraryCharges, then the last
24+
one read will be applied (per the hierarchy rules in the SMIRNOFF format).
25+
26+
This functionality is thus able to apply per-residue charges similar to those in traditional
27+
protein force fields. At this time, there is no concept of "residues" or "fragments" during
28+
parametrization, so it is not possible to assign charges to `some` atoms in a molecule using
29+
LibraryCharges, but calculate charges for other atoms in the same molecule using a different
30+
method. To assign charges to a protein, LibraryCharges SMARTS must be provided for
31+
the standard residues, as well as for any capping groups and post-translational modifications
32+
that are present.
33+
34+
Behavior changed
35+
""""""""""""""""
36+
- `PR #433 <https://github.com/openforcefield/openforcefield/pull/433>`_: If a molecule
37+
can not be assigned charges by any charge-assignment method, an
38+
``openforcefield.typing.engines.smirnoff.parameters.UnassignedMoleculeChargeException``
39+
will be raised. Previously, creating a system without either ``ToolkitAM1BCCHandler`` or
40+
the ``charge_from_molecules`` keyword argument to ``ForceField.create_openmm_system`` would
41+
produce a system where the molecule has zero charge on all atoms. However, given that we
42+
will soon be adding more options for charge assignment, it is important that
43+
failures not be silent. Molecules with zero charge can still be produced by setting the
44+
``Molecule.partial_charges`` array to be all zeroes, and including the molecule in the
45+
``charge_from_molecules`` keyword argument to ``create_openmm_system``.
46+
- `PR #433 <https://github.com/openforcefield/openforcefield/pull/433>`_: Due to risks
47+
introduced by permitting charge assignment using partially-overlapping ``LibraryCharge``s,
48+
the toolkit will now raise a
49+
``openforcefield.typing.engines.smirnoff.parameters.NonIntegralMoleculeChargeException``
50+
if the sum of partial charges on a molecule are found to be more than 0.001 elementary charge units
51+
different than the molecule's formal charge. This exception can be overridden by providing
52+
the ``allow_nonintegral_charges=True`` keyword argument to ``ForceField.create_openmm_system``.
53+
54+
55+
56+
1457
Tests added
1558
"""""""""""
1659
- `PR #430 <https://github.com/openforcefield/openforcefield/pull/430>`_: Added test for
@@ -21,14 +64,21 @@ Tests added
2164
Bugfixes
2265
""""""""
2366
- `PR #431 <https://github.com/openforcefield/openforcefield/pull/431>`_: Fixes an issue
24-
where ``ToolkitWrapper``s would improperly search for functionality in the
67+
where ``ToolkitWrapper`` objects would improperly search for functionality in the
2568
``GLOBAL_TOOLKIT_REGISTRY``, even though a specific ``ToolkitRegistry`` was requested for an
2669
operation.
2770
- `PR #439 <https://github.com/openforcefield/openforcefield/pull/439>`_: Fixes
28-
`Issue #438 <https://github.com/openforcefield/openforcefield/issues/438>`_, by replacing
71+
`Issue #438 <https://github.com/openforcefield/openforcefield/issues/438>`_, by replacing
2972
call to NetworkX ``Graph.node`` with call to ``Graph.nodes``, per
3073
`2.4 migration guide <https://networkx.github.io/documentation/stable/release/release_2.4.html>`_.
3174

75+
Files modified
76+
""""""""""""""
77+
- `PR #433 <https://github.com/openforcefield/openforcefield/pull/433>`_: Updates
78+
the previously-nonfunctional ``test_forcefields/tip3p.offxml`` to a functional state
79+
by updating it to the SMIRNOFF
80+
0.3 specification, and specifying atomic charges using the ``LibraryCharges`` tag.
81+
3282

3383
0.5.1 - Adding the parameter coverage example notebook
3484
------------------------------------------------------

docs/typing.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ For more information, see ``examples/forcefield_modification``.
6262
ProperTorsionHandler.ProperTorsionType
6363
ImproperTorsionHandler.ImproperTorsionType
6464
vdWHandler.vdWType
65+
LibraryChargeHandler.LibraryChargeType
6566
GBSAHandler.GBSAType
6667

6768
Parameter Handlers
@@ -83,6 +84,7 @@ During system creation, each ``ParameterHandler`` registered to a ``ForceField``
8384
ImproperTorsionHandler
8485
vdWHandler
8586
ElectrostaticsHandler
87+
LibraryChargeHandler
8688
ToolkitAM1BCCHandler
8789
GBSAHandler
8890

examples/check_dataset_parameter_coverage/check_parameter_coverage.ipynb

Lines changed: 32 additions & 30 deletions
Large diffs are not rendered by default.
Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
<?xml version="1.0" encoding='ASCII'?>
2-
3-
<SMIRNOFF version="0.2" aromaticity_model="OEAroModel_MDL">
4-
2+
<SMIRNOFF version="0.3" aromaticity_model="OEAroModel_MDL">
53
<!-- SMIRks Native Open Force Field (SMIRNOFF) file -->
6-
<Date>2019-05-17</Date>
7-
<Author>J. D. Chodera, MSKCC; A. Rizzi, Weill Cornell; C. C. Bannan, UC Irvine</Author>
8-
4+
<Date>2019-10-26</Date>
5+
<Author>J. D. Chodera, MSKCC; A. Rizzi, Weill Cornell; J. Wagner, Open Force Field; C. C. Bannan, UC Irvine</Author>
96
<!-- SMIRNOFF file implementing TIP3P water model. -->
10-
<vdW potential="Lennard-Jones-12-6" combining_rules="Lorentz-Berthelot" scale12="0.0" scale13="0.0" scale14="0.5" scale15="1" sigma_unit="nanometers" epsilon_unit="kilojoules_per_mole" switch_width="1.0" switch_width_unit="angstroms" cutoff="9.0" cutoff_unit="angstroms" method="cutoff">
11-
<!-- TIP3P water oxygen with charge override -->
12-
<!-- WARNING: charges are not supported yet (see issue openforcefield#25), and they are currently here only for documentation -->
13-
<Atom smirks="[#1]-[#8X2H2+0:1]-[#1]" id="n1" sigma="0.31507524065751241" epsilon="0.635968" charge="-0.834"/>
14-
<!-- TIP3P water hydrogen with charge override -->
15-
<!-- WARNING: charges are not supported yet (see issue openforcefield#25), and they are currently here only for documentation -->
16-
<Atom smirks="[#1:1]-[#8X2H2+0]-[#1]" id="n2" sigma="1" epsilon="0" charge="0.417"/>
7+
<!-- These values are taken from OpenMM's TIP3P implementation: https://github.com/openmm/openmm/blob/f9106ddb6a0d72c960c73b23ed0e07cd7190a80f/wrappers/python/simtk/openmm/app/data/tip3p.xml -->
8+
<vdW version="0.3" potential="Lennard-Jones-12-6" combining_rules="Lorentz-Berthelot" scale12="0.0" scale13="0.0" scale14="0.5" scale15="1" switch_width="1.0 * angstroms" cutoff="9.0 * angstroms" method="cutoff">
9+
<Atom smirks="[#1]-[#8X2H2+0:1]-[#1]" id="n1" sigma="0.31507524065751241 * nanometers" epsilon="0.635968 * kilojoules_per_mole" />
10+
<Atom smirks="[#1:1]-[#8X2H2+0]-[#1]" id="n2" sigma="1 * nanometers" epsilon="0 * kilojoules_per_mole" />
1711
</vdW>
18-
19-
<Constraints distance_unit="angstroms">
12+
<LibraryCharges version="0.3">
13+
<LibraryCharge name="TIP3P" smirks="[#1:1]-[#8X2H2+0:2]-[#1:3]" charge1="0.417*elementary_charge" charge2="-0.834*elementary_charge" charge3="0.417*elementary_charge"/>
14+
</LibraryCharges>
15+
<Constraints version="0.3">
2016
<!-- constrain water O-H bond to equilibrium bond length (overrides earlier constraint) -->
21-
<Constraint smirks="[#1:1]-[#8X2H2+0:2]-[#1]" id="c1" distance="0.9572"/>
17+
<Constraint smirks="[#1:1]-[#8X2H2+0:2]-[#1]" id="c1" distance="0.9572 * angstrom"/>
2218
<!-- constrain water H...H, calculating equilibrium length from H-O-H equilibrium angle and H-O equilibrium bond lengths -->
23-
<Constraint smirks="[#1:1]-[#8X2H2+0]-[#1:2]" id="c2" distance="1.5139006545247014"/>
19+
<Constraint smirks="[#1:1]-[#8X2H2+0]-[#1:2]" id="c2" distance="1.5139006545247014 * angstrom"/>
2420
</Constraints>
25-
2621
</SMIRNOFF>

0 commit comments

Comments
 (0)