Skip to content

Commit

Permalink
fix 1583 by kekulizing before reperceiving aromaticity, update releas…
Browse files Browse the repository at this point in the history
…enotes (#1591)
  • Loading branch information
j-wags authored Apr 26, 2023
1 parent 4085ad8 commit cee85d1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/releasehistory.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Releases follow the `major.minor.micro` scheme recommended by [PEP440](https://w

### Bugfixes
- [PR #1589](https://github.com/openforcefield/openff-toolkit/pull/1589): Fixes [Issue #1579](https://github.com/openforcefield/openff-toolkit/issues/1579), where Molecule.from_polymer_pdb could not handle NH2 caps at C termini.
- [PR #1591](https://github.com/openforcefield/openff-toolkit/pull/1591): Fixes [#1563](https://github.com/openforcefield/openff-toolkit/issues/1563), where `from_rdkit` would sometimes raise an error about radicals if a molecule using a non-MDL aromaticity model was provided.

### Improved documentation and warnings

Expand Down
9 changes: 9 additions & 0 deletions openff/toolkit/tests/test_toolkits.py
Original file line number Diff line number Diff line change
Expand Up @@ -2527,6 +2527,15 @@ def test_from_rdkit_radical(self):
with pytest.raises(RadicalsNotSupportedError):
RDKitToolkitWrapper().from_rdkit(rdmol)

def test_from_rdkit_incompatible_aromaticity(self):
"""Test loading an rdmol where the aromaticity was set by a model that disagrees with MDL"""
from rdkit import Chem

smi = "c2scnc2C"
rdmol = Chem.MolFromSmiles(smi)
Chem.SetAromaticity(rdmol, Chem.AromaticityModel.AROMATICITY_RDKIT)
Molecule.from_rdkit(rdmol)

def test_from_rdkit_transition_metal_radical(self):
"""Test that parsing an rdmol with a transition metal radical works."""
from rdkit import Chem
Expand Down
1 change: 0 additions & 1 deletion openff/toolkit/utils/rdkit_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1790,7 +1790,6 @@ def from_rdkit(
^ Chem.SANITIZE_SETAROMATICITY
^ Chem.SANITIZE_ADJUSTHS
^ Chem.SANITIZE_CLEANUPCHIRALITY
^ Chem.SANITIZE_KEKULIZE
),
)
Chem.SetAromaticity(rdmol, Chem.AromaticityModel.AROMATICITY_MDL)
Expand Down

0 comments on commit cee85d1

Please sign in to comment.