Skip to content

Commit

Permalink
Merge branch 'main' into revert-1663-revert-1509-no-chemistry
Browse files Browse the repository at this point in the history
  • Loading branch information
j-wags authored Jul 16, 2023
2 parents db0082b + 0e4af26 commit 299195b
Show file tree
Hide file tree
Showing 18 changed files with 53 additions and 81 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
| **Status** | [![GH Actions Status](https://github.com/openforcefield/openff-toolkit/workflows/CI/badge.svg)](https://github.com/openforcefield/openff-toolkit/actions?query=branch%3Amain+workflow%3ACI) [![Codecov coverage](https://img.shields.io/codecov/c/github/openforcefield/openff-toolkit.svg?logo=Codecov&logoColor=white)](https://codecov.io/gh/openforcefield/openff-toolkit) |
| :------ |:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Latest Release** | [![Last release tag](https://img.shields.io/github/release-pre/openforcefield/openff-toolkit.svg)](https://github.com/openforcefield/openff-toolkit/releases) [![Commits since release](https://img.shields.io/github/commits-since/openforcefield/openff-toolkit/0.13.2.svg)](https://github.com/openforcefield/openff-toolkit/releases/tag/0.13.2) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.8056838.svg)](https://doi.org/10.5281/zenodo.8056838)
| **Communication** | [![docs stable](https://img.shields.io/badge/docs-stable-5077AB.svg?logo=read%20the%20docs)](https://open-forcefield-toolkit.readthedocs.io/) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openforcefield/openff-toolkit/stable?filepath=%2Fexamples%2F) [![user & dev discussions](https://img.shields.io/badge/user%20%26%20dev%20discussions-GitHub-red?logo=github)](https://github.com/openforcefield/discussions/discussions) |
| **Latest Release** | [![Last release tag](https://img.shields.io/github/release-pre/openforcefield/openff-toolkit.svg)](https://github.com/openforcefield/openff-toolkit/releases) [![Commits since release](https://img.shields.io/github/commits-since/openforcefield/openff-toolkit/0.14.0.svg)](https://github.com/openforcefield/openff-toolkit/releases/tag/0.14.0) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.8102071.svg)](https://doi.org/10.5281/zenodo.8102071)
| **Communication** | [![docs stable](https://img.shields.io/badge/docs-stable-5077AB.svg?logo=read%20the%20docs)](https://open-forcefield-toolkit.readthedocs.io/) [![user & dev discussions](https://img.shields.io/badge/user%20%26%20dev%20discussions-GitHub-red?logo=github)](https://github.com/openforcefield/discussions/discussions) |
| **Foundation** | [![license](https://img.shields.io/github/license/openforcefield/openff-toolkit.svg)](https://opensource.org/licenses/MIT) [![platforms](https://img.shields.io/badge/Platforms-Linux%2C%20MacOS-orange.svg)](https://open-forcefield-toolkit.readthedocs.io/en/stable/installation.html) [![python](https://img.shields.io/badge/python-3.9%2C%203.10-blue.svg)](https://open-forcefield-toolkit.readthedocs.io/en/stable/installation.html) [![Funding](https://img.shields.io/badge/Funding-Open%20Force%20Field%20Consortium-brightgreen.svg)](http://openforcefield.org) |
| **Installation** | [![Releases](https://img.shields.io/badge/obtain-latest-green.svg)](https://github.com/openforcefield/openff-toolkit/releases) [![Conda](https://img.shields.io/conda/v/conda-forge/openff-toolkit.svg)](https://anaconda.org/conda-forge/openff-toolkit) [![Last updated](https://anaconda.org/conda-forge/openff-toolkit/badges/latest_release_relative_date.svg)](https://anaconda.org/conda-forge/openff-toolkit) [![Anaconda Cloud downloads](https://anaconda.org/conda-forge/openff-toolkit/badges/downloads.svg)](https://anaconda.org/conda-forge/openff-toolkit) |

Expand All @@ -17,7 +17,7 @@ The toolkit currently covers two main areas we have committed to stably maintain

## Documentation

[Documentation](https://open-forcefield-toolkit.readthedocs.io/en/stable/) for the Open Force Field Toolkit is hosted at [readthedocs](https://open-forcefield-toolkit.readthedocs.io/en/stable). Example notebooks are hosted on [binder](https://mybinder.org/v2/gh/openforcefield/openff-toolkit/stable?filepath=%2Fexamples%2F)
[Documentation](https://open-forcefield-toolkit.readthedocs.io/en/stable/) for the Open Force Field Toolkit is hosted at [readthedocs](https://open-forcefield-toolkit.readthedocs.io/en/stable). Example notebooks are hosted on available in the `examples/` repository.

## How to cite

Expand Down
26 changes: 16 additions & 10 deletions docs/releasehistory.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,38 @@ Releases follow the `major.minor.micro` scheme recommended by [PEP440](https://w
* `minor` increments add features but do not break API compatibility
* `micro` increments represent bugfix releases or improvements in documentation

# 0.14.0 (or other breaking change some months after 0.12.0)

### Behavior changes
## Current development

### API-breaking changes
- [PR #15XX](https://github.com/openforcefield/openff-toolkit/pull/15XX):
Removes `ChemicalEnvironment` and the entire `openff.toolkit.typing.chemistry` submodule, which was deprecated in 0.12.0.

## Current development
### Behavior changes

### API-breaking changes
### Bugfixes

- [PR #1667](https://github.com/openforcefield/openff-toolkit/pull/1667): A more helpful exception is now raised when `Topology.from_openmm` is given an OpenMM Topology with virtual sites.

### New features

### Improved documentation and warnings


## 0.14.0

### API-breaking changes
- [PR #1649](https://github.com/openforcefield/openff-toolkit/pull/1649): Removes tests and associated modules from the public API.
- [PR #1508](https://github.com/openforcefield/openff-toolkit/pull/1508): Removes the `return_topology` kwawrg from `ForceField.create_openmm_system` which was [deprecated in version 0.11.0](https://docs.openforcefield.org/projects/toolkit/en/stable/releasehistory.html#breaking-change-interchange-now-responsible-for-system-parametrization). To access the `Topology` that results from parametrization, call `ForceField.create_interchange` and access the `.topology` attribute of the returned `Interchange` object.
- [PR #1506](https://github.com/openforcefield/openff-toolkit/pull/1506):
Removes several classes and properties in the `topology` submodule that were [deprecated in version 0.11.0](https://docs.openforcefield.org/projects/toolkit/en/stable/releasehistory.html#breaking-change-topology-molecule-representation).
- [PR #1506](https://github.com/openforcefield/openff-toolkit/pull/1506): Removes several classes and properties in the `topology` submodule that were [deprecated in version 0.11.0](https://docs.openforcefield.org/projects/toolkit/en/stable/releasehistory.html#breaking-change-topology-molecule-representation).


### Behavior changes

- [PR #1652](https://github.com/openforcefield/openff-toolkit/pull/1652): Fixes issue [#1642](https://github.com/openforcefield/openff-toolkit/issues/1642) by making AmberToolsToolkitWrapper thread-safe (previously `AmberToolsToolkitWrapper.assign_partial_charges` and `assign_fractional_bond_orders` were not)

### Bugfixes

- [PR #1654](https://github.com/openforcefield/openff-toolkit/pull/1654): Fixes issue [#1653](https://github.com/openforcefield/openff-toolkit/issues/1653), where a test that expected RDKit to fail began returning an error when RDKit became able to generate conformers for octahedral molecules.

### New features

### Improved documentation and warnings
- [PR #1572](https://github.com/openforcefield/openff-toolkit/pull/1572): Improved installation guide in line with ecosystem docs.

Expand Down
43 changes: 0 additions & 43 deletions environment.yml

This file was deleted.

2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Examples using SMIRNOFF with the toolkit

The following examples are available in [the OpenFF toolkit repository](https://github.com/openforcefield/openff-toolkit/tree/stable/examples). Each can be run interactively in the browser with [binder](https://mybinder.org/v2/gh/openforcefield/openforcefield/stable?filepath=%2Fexamples%2F), without installing anything on your computer.
The following examples are available in [the OpenFF toolkit repository](https://github.com/openforcefield/openff-toolkit/tree/stable/examples).

## Index of provided examples

Expand Down
2 changes: 0 additions & 2 deletions examples/SMIRNOFF_simulation/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
## Simulate a system parametrized with the Open Force Field Toolkit

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openforcefield/openff-toolkit/stable?filepath=examples%2FSMIRNOFF_simulation%2Frun_simulation.ipynb)

The notebook `run_simulation.ipynb` shows how to use the Open Force Field Toolkit to create a parametrized `System` object that can be used to run a molecular dynamic simulation with OpenMM.
2 changes: 0 additions & 2 deletions examples/conformer_energies/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
## Computing small molecule energies using a SMIRNOFF force field

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openforcefield/openff-toolkit/stable?filepath=examples%2Fconformer_energies%2Fconformer_energies.ipynb)

These examples illustrate how to compute small molecule vacuum energies (for example, for different conformers of the same molecule) using a SMIRNOFF force field.

* [`conformer_energies.ipynb`](conformer_energies.ipynb) contains an example illustrating the computation of conformer energies using a SMIRNOFF force field
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
## Parameter coverage analysis

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openforcefield/openforcefield/stable?filepath=%2Fexamples%2Fcheck_dataset_parameter_coverage%2Fcheck_parameter_coverage.ipynb)

This example shows how to use the Open Force Field Toolkit to ingest a dataset of molecules, and generate a report summarizing any chemistry that can not be parameterized.
2 changes: 0 additions & 2 deletions examples/external/swap_amber_parameters/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
## Taking an AMBER system and replacing the ligand parameters with OpenFF parameters

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openforcefield/openff-toolkit/stable?filepath=examples%2Fswap_amber_parameters%2F)

This example illustrates how the [ParmEd](http://parmed.github.io/ParmEd/html/index.html) utility can be used to take a fully parameterized (and solvated) protein-ligand system and replace the ligand parameters with those from OpenFF. In this case, the system uses an AMBER protein force field, ions, and TIP3P water, and we replace the GAFF ligand parameters with OpenFF parameters, writing out the resulting fully parameterized system.

### BRD4:inhibitor complex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@

### BRD4:inhibitor complex

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openforcefield/openff-toolkit/stable?filepath=examples%2external%2Fusing_smirnoff_with_amber_protein_forcefield%2FBRD4_inhibitor_benchmark.ipynb)

[`BRD4_inhibitor_benchmark.ipynb`](BRD4_inhibitor_benchmark.ipynb) contains an example illustrating applying Sage and ff14SB parameters to a BRD4:inhibitor complex taken from the [free energy benchmark systems living review](https://www.annualreviews.org/doi/abs/10.1146/annurev-biophys-070816-033654) [GitHub repo](https://github.com/MobleyLab/benchmarksets/tree/master/input_files/BRD4).

2 changes: 0 additions & 2 deletions examples/forcefield_modification/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
## Manipulating SMIRNOFF parameters after loading into a `ForceField` object

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openforcefield/openff-toolkit/stable?filepath=examples%2Fforcefield_modification%2Fforcefield_modification.ipynb)

In this example, we'll parameterize a ligand automatically, and then play with its parameters via the `ForceField` class to demonstrate the Toolkit's ability to facilitate force field optimization. For each modification, we'll calculate the energy for the original conformation, and then minimize the energy and visualize the result.
2 changes: 0 additions & 2 deletions examples/inspect_assigned_parameters/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
## Inspecting which SMIRNOFF parameters are assigned to specific molecules

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openforcefield/openff-toolkit/stable?filepath=examples%2Finspect_assigned_parameters%2Finspect_assigned_parameters.ipynb)

These examples illustrate how to inspect which SMIRNOFF parameters are assigned to specific atoms for a test molecule, and to sets of molecules.
2 changes: 0 additions & 2 deletions examples/toolkit_showcase/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
## Toolkit Showcase: Protein-ligand simulation with an OpenFF force field

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openforcefield/openff-toolkit/stable?filepath=examples%2Ftoolkit_showcase%2Ftoolkit_showcase.ipynb)

This introductory example will demonstrate how to prepare a system for Molecular Dynamics that combines solvent, a ligand using the Sage open force field, and a protein using a standard Amber force field. We'll use a number of tools from the Python molecular science ecosystem to take a pre-docked benchmark example from scratch all the way through to simulation and visualization, all without leaving the notebook.
2 changes: 0 additions & 2 deletions examples/using_smirnoff_in_amber_or_gromacs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
## Export OpenFF-generated OpenMM System to AMBER and GROMACS files

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openforcefield/openff-toolkit/stable?filepath=examples%2Fusing_smirnoff_in_amber_or_gromacs%2Fconvert_to_amber_gromacs.ipynb)

This example shows how you can convert an OpenMM `System` generated with the Open Forcefield Toolkit, which can be simulated natively with OpenMM, into AMBER prmtop/inpcrd and GROMACS top/gro input files through the ParmEd library.

#### Manifest:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
## Combining a small molecule with Sage and a protein parameterized with an Amber protein force field

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openforcefield/openff-toolkit/stable?filepath=examples%2Fusing_smirnoff_with_amber_protein_forcefield)

### Toluene in complex with T4 lysozyme L99A in TIP3P-FB water

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openforcefield/openff-toolkit/stable?filepath=examples%2Fusing_smirnoff_with_amber_protein_forcefield%2Ftoluene_in_T4_lysozyme.ipynb)

[`toluene_in_T4_lysozyme.ipynb`](toluene_in_T4_lysozyme.ipynb) contains an example illustrating applying Sage and ff14SB parameters to toluene complexed with T4 lysozyme L99A in a TIP3P water box.
2 changes: 0 additions & 2 deletions examples/visualization/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Built-in visualizations in `openff-toolkit`

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openforcefield/openff-toolkit/stable?filepath=examples%2Fvisualization%2Fvisualization.ipynb)

PR [#560](https://github.com/openforcefield/openff-toolkit/pull/560) introduced rich representation for the `openff.toolkit.topology.Molecule` objects. This means you can visualize them in your Jupyter Notebooks:

We have implemented three backends:
Expand Down
18 changes: 18 additions & 0 deletions openff/toolkit/_tests/test_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
MissingUniqueMoleculesError,
MoleculeNotInTopologyError,
UnassignedChemistryInPDBError,
VirtualSitesUnsupportedError,
WrongShapeError,
)

Expand Down Expand Up @@ -518,6 +519,23 @@ def test_from_openmm(self):
for omm_atom, off_atom in zip(pdbfile.topology.atoms(), topology.atoms):
assert omm_atom.name == off_atom.name

def test_from_openmm_virtual_sites(self):
from openff.toolkit import ForceField

water = Molecule.from_mapped_smiles("[O:1]([H:2])[H:3]")
opc = ForceField("opc-1.0.1.offxml")

openmm_topology = opc.create_interchange([water]).to_openmm_topology()

with pytest.raises(
VirtualSitesUnsupportedError,
match="Atom <Atom 3 \(EP\) of chain 0 residue 0 \(UNK\)>.* a virtual site",
):
Topology.from_openmm(
openmm_topology,
unique_molecules=[water],
)

def test_from_openmm_missing_reference(self):
"""Test creation of an OpenFF Topology object from an OpenMM Topology when missing a unique molecule"""
pdbfile = app.PDBFile(
Expand Down
11 changes: 11 additions & 0 deletions openff/toolkit/topology/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
MissingUniqueMoleculesError,
MoleculeNotInTopologyError,
NotBondedError,
VirtualSitesUnsupportedError,
WrongShapeError,
)
from openff.toolkit.utils.serialization import Serializable
Expand Down Expand Up @@ -1285,6 +1286,12 @@ def _openmm_topology_to_networkx(openmm_topology):
# Convert all openMM mols to graphs
omm_topology_G = nx.Graph()
for atom in openmm_topology.atoms():
if atom.element is None:
raise VirtualSitesUnsupportedError(
f"Atom {atom} has element None and is probably a virtual site. Virtual sites "
"cannot be stored in `Topology` objects but can be stored in `Interchange` "
"objects produced by `ForceField`s with virtual site parameters."
)
omm_topology_G.add_node(
atom.index,
atomic_number=atom.element.atomic_number,
Expand Down Expand Up @@ -1319,6 +1326,10 @@ def from_openmm(
Hierarchy schemes are taken from the OpenMM topology, not from
``unique_molecules``.
If any virtual sites are detected in the OpenMM topology,
``VirtualSitesUnsupportedError`` is raised because the ``Topology``
object model does not store virtual sites.
Parameters
----------
openmm_topology
Expand Down
4 changes: 4 additions & 0 deletions openff/toolkit/utils/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ class HierarchySchemeNotFoundException(OpenFFToolkitException):
that doesn't have one with the given iterator name"""


class VirtualSitesUnsupportedError(OpenFFToolkitException):
"""Exception raised when trying to store virtual sites in a `Molecule` or `Topology` object."""


class MissingIndexedAttributeError(
OpenFFToolkitException, IndexError, KeyError, AttributeError
):
Expand Down

0 comments on commit 299195b

Please sign in to comment.