Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make atom names more unique #1096

Merged
merged 2 commits into from Sep 30, 2021
Merged

Make atom names more unique #1096

merged 2 commits into from Sep 30, 2021

Conversation

mattwthompson
Copy link
Member

@mattwthompson mattwthompson commented Sep 27, 2021

May fix #1095

I'm not sure if something more than appending 'x' is appropriate; something even longer would reduce the changes of collisions to zero but might cause other issues, like Amber files not being able to write them out at all due to the limitations of how their FORTRAn parsers are designed.

@codecov
Copy link

codecov bot commented Sep 27, 2021

Codecov Report

Merging #1096 (c28e21d) into master (d39905b) will decrease coverage by 0.41%.
The diff coverage is 100.00%.

Copy link
Member

@j-wags j-wags left a comment

Choose a reason for hiding this comment

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

Thanks @mattwthompson! This is a definite improvement and removes some mines from the system-conversion minefield. In the future, we may also consider letting users customize the suffix, so that multiple OpenFF ligands don't have atom type collisions. But this change is straightforward and should solve most of the cases where the old problem occured.

Thanks again, and please update the releasenotes before merging!

@mattwthompson mattwthompson merged commit 8a076ae into master Sep 30, 2021
@mattwthompson mattwthompson deleted the atom-names-x branch September 30, 2021 15:20
Yoshanuikabundi added a commit that referenced this pull request Oct 28, 2021
Squashed commit of the following:

commit 708a5c7
Author: Jeff Wagner <jwagnerjpl@gmail.com>
Date:   Tue Oct 26 13:13:04 2021 -0700

    Update README.md

commit 48a3e3f
Author: Jeff Wagner <jwagnerjpl@gmail.com>
Date:   Tue Oct 26 13:11:07 2021 -0700

    Update releasehistory.md

commit 88b03bf
Author: Jeff Wagner <jwagnerjpl@gmail.com>
Date:   Tue Oct 26 11:58:35 2021 -0700

    Cleanup and releasenotes prep for 0.10.1 (#1112)

    * cleanup and releasenotes prep for 0.10.1

    * Apply suggestions from code review

    Co-authored-by: Matt Thompson <mattwthompson@protonmail.com>

    * make CI run without mypy/typing-extensions

    * drop deps that are pulling in pydantic --> typing-extensions

    * revert changes to pre-release testing

    Co-authored-by: Matt Thompson <mattwthompson@protonmail.com>

commit ac99d2e
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Oct 18 05:39:02 2021 -0500

    Bump actions/checkout from 2.3.4 to 2.3.5 (#1107)

    Bumps [actions/checkout](https://github.com/actions/checkout) from 2.3.4 to 2.3.5.
    - [Release notes](https://github.com/actions/checkout/releases)
    - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
    - [Commits](actions/checkout@v2.3.4...v2.3.5)

    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit e8353ef
Author: Matt Thompson <mattwthompson@protonmail.com>
Date:   Thu Oct 7 10:47:56 2021 -0500

    Fall back to hill formula in Molecule.__repr__ if to_smiles() fails (#1087)

    * Fall back to hill formula in Molecule.__repr__ if to_smiles() fails

    * Update openff/toolkit/tests/test_molecule.py

    Co-authored-by: Jeff Wagner <jwagnerjpl@gmail.com>

    * Lint

    * Update openff/toolkit/tests/test_molecule.py

    * Lint

    * Update release history

    Co-authored-by: Jeff Wagner <jwagnerjpl@gmail.com>

commit 893575a
Merge: 36e4e30 a8472a7
Author: David Dotson <dotsdl@gmail.com>
Date:   Fri Oct 1 16:43:38 2021 -0700

    Merge pull request #1101 from openforcefield/qcschema_fix

    `to_qcschema` fix with no bonds.

commit a8472a7
Author: David Dotson <dotsdl@gmail.com>
Date:   Fri Oct 1 10:08:01 2021 -0700

    Added changelog entry for #1101

commit bf10ad8
Author: Josh Horton <Josh.Horton@newcastle.ac.uk>
Date:   Fri Oct 1 16:49:58 2021 +0100

    make sure connectivity is none when we have no bonds

commit 36e4e30
Author: Matt Thompson <mattwthompson@protonmail.com>
Date:   Thu Sep 30 11:00:33 2021 -0500

    Use Quantity.value_in_unit() instead of dividing quantities by units (#1088)

    * Use Quantity.value_in_unit() instead of dividing quantities by units

    * More fixes found by @lilyminium

    * Update openff/toolkit/topology/molecule.py

    Co-authored-by: trevorgokey <50244806+trevorgokey@users.noreply.github.com>

    * Fix atom positions unit logic

    Co-authored-by: trevorgokey <50244806+trevorgokey@users.noreply.github.com>

commit 8a076ae
Author: Matt Thompson <mattwthompson@protonmail.com>
Date:   Thu Sep 30 10:20:26 2021 -0500

    Make atom names more unique (#1096)

    * Append 'x' to atom names to avoid downstream clashes

    * Update release notes, note TODO from review

commit 7ab1636
Author: Matt Thompson <mattwthompson@protonmail.com>
Date:   Thu Sep 30 08:38:35 2021 -0500

    Avoid ParseError deprecation warning when not imported (#1094)

commit d39905b
Author: Lily Wang <31115101+lilyminium@users.noreply.github.com>
Date:   Thu Sep 23 11:55:46 2021 -0700

    Speed up rdkit distances (#1070)

    * replace rdkit distances

    * add branch to ci

    * small modifications

    * blacken and remove CI

    * add comments and change variable name

    Co-authored-by: Matt Thompson <mattwthompson@protonmail.com>

commit fa18468
Author: Matt Thompson <mattwthompson@protonmail.com>
Date:   Thu Sep 23 12:12:27 2021 -0500

    Preparations for supporting type annotations (#1059)

    * Gradual typing: Set up mypy without type annotations

    * Add mypy to CI

    * Add mypy to CI

    * Fix syntax in environment file

    * Update configuration, turn off no-redef globally

    * Prevent mypy from quitting CI runs early

    * Run mypy in CI only when RDKit and OpenEye backends are installed

    * Only run mypy on "true/true" parts of matrix

    * Update import skips for openmm

commit 6cfad71
Author: Lily Wang <31115101+lilyminium@users.noreply.github.com>
Date:   Wed Sep 22 16:42:21 2021 -0700

    Raise subclass of AttributeError in __getattr__ (#1052)

    * add new exception

    * black likes newlines

    * isort alphabetically

    * update releasehistory

commit b9caeac
Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date:   Wed Sep 22 14:39:17 2021 -0700

    [pre-commit.ci] pre-commit autoupdate (#1083)

    updates:
    - [github.com/psf/black: 21.8b0 → 21.9b0](psf/black@21.8b0...21.9b0)

    Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

commit c0f9ebe
Author: Matt Thompson <mattwthompson@protonmail.com>
Date:   Wed Sep 22 16:27:34 2021 -0500

    Assorted README fixes (#1082)

    * Update README: smirnoff.html links, latest -> stable, Sage changes

    * Add link to force field plugin entry point

commit 9310765
Author: Josh A. Mitchell <yoshanuikabundi@gmail.com>
Date:   Thu Sep 23 00:40:06 2021 +1000

    Updating install guide (#1062)

    * Update install guide

    * Reorganise installation.md to avoid repeating information

    * Describe installing from source

    * Add section describing WSL and platform support

    * Recommend WSL2 and mention hardware reqs

    * Mention the Jupyter WSL caveat

    * Update changelog

    Co-authored-by: Jeff Wagner <jwagnerjpl@gmail.com>

commit b1c41ae
Author: Josh A. Mitchell <yoshanuikabundi@gmail.com>
Date:   Thu Sep 16 10:02:20 2021 +1000

    Disable HTML post processing to help RTD builds pass (#1080)

commit be3079e
Author: Jeff Wagner <jwagnerjpl@gmail.com>
Date:   Wed Sep 15 16:21:52 2021 -0700

    fix binder links

commit 6a85063
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Sep 14 09:35:58 2021 -0500

    Bump codecov/codecov-action from 2.0.3 to 2.1.0 (#1078)

    Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2.0.3 to 2.1.0.
    - [Release notes](https://github.com/codecov/codecov-action/releases)
    - [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
    - [Commits](codecov/codecov-action@v2.0.3...v2.1.0)

    ---
    updated-dependencies:
    - dependency-name: codecov/codecov-action
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 1440cf6
Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date:   Mon Sep 13 14:41:46 2021 -0500

    [pre-commit.ci] pre-commit autoupdate (#1077)

    updates:
    - [github.com/nbQA-dev/nbQA: 1.1.0 → 1.1.1](nbQA-dev/nbQA@1.1.0...1.1.1)

    Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

commit 36f3c75
Author: Josh A. Mitchell <yoshanuikabundi@gmail.com>
Date:   Mon Sep 13 19:52:38 2021 +1000

    Update Example notebooks to Sage force field (#1065)

    * Update check_parameter_coverage to Sage FF

    * Update conformer-energies to Sage FF

    * Update forcefield_modification to Sage FF

    * Update inspect_assigned_parameters to Sage FF

    * Update smirnoff_simulation to Sage FF

    * Update using_smirnoff_in_amber_or_gromacs to Sage FF

    * Update swap_amber_parameters to Sage FF

    * Update toolkit_showcase to Sage FF

    * Update using_smirnoff_with_amber_protein_forcefield to Sage FF

    * Update virtual_sites to Sage FF

    * [pre-commit.ci] auto fixes from pre-commit.com hooks

    for more information, see https://pre-commit.ci

    * Update changelog

    * Fix references to old force fields in comments

    * Update conformer_energies.py to use Sage and print out the used force field

    * Add pin for openff-forcefield >=2.0.0 to examples environment

    * Add example script behaviour change to changelog

    * Merge `master` into `update-example-ffs`

    Squashed commit of the following:

    commit b3bcc88
    Author: Jeff Wagner <jwagnerjpl@gmail.com>
    Date:   Fri Sep 10 13:42:37 2021 -0700

        Update latest release tag to be 'stable' instead of 'latest' (#1068)

        * update use of latest tag to refer to 'stable' instead of 'latest' (since 'latest' clashes with the RTD builtin 'latest' keyword)

        * Update .github/workflows/release.yml

        Co-authored-by: Josh A. Mitchell <yoshanuikabundi@gmail.com>

        * Update notebook links from 'latest' to 'stable' tag

        * cosmetic commit to kick ci

        Co-authored-by: Josh A. Mitchell <yoshanuikabundi@gmail.com>

    commit 9d9f933
    Author: Matt Thompson <mattwthompson@protonmail.com>
    Date:   Thu Sep 9 18:24:25 2021 -0500

        Safely import OpenMM (#1063)

        * Pin to OpenMM 7.5.x

        * Loosen OpenMM pin

        * Fix link to OpenMM ForceField API docs

        * Unpin everything

        * Cleanup

        * Gracefully import OpenMM in examples

        * Safely import OpenMM everywhere

        * Clean up an import

        * Run CI with openmm==7.5 pin

        * Run CI with openmm==7.6 pin

        * Unpin OpenMM, run slow tests

        * Revert addition of slow tests

    commit e4b56ab
    Author: Matt Thompson <mattwthompson@protonmail.com>
    Date:   Thu Sep 9 17:12:30 2021 -0500

        Catch/raise descriptive error on conformer generation failure (#1050)

        * Catch/raise descriptive error on conformer generation failure

        * Run slow tests in PR

        * Remove useless raise_exception_types, add test in Molecule API

        * Remove unused import

        * Update openff/toolkit/utils/exceptions.py

        Co-authored-by: Lily Wang <31115101+lilyminium@users.noreply.github.com>

        * Use uranium hexafluoride to test conformer generation failures

        * Make conformer generation try other toolkits

        * Explicitly test that both OpenEye and RDKit fail on UF6

        * Update CHANGELOG

        * Fix change pushed to wrong branch

        Co-authored-by: Lily Wang <31115101+lilyminium@users.noreply.github.com>

    commit 7a3fad5
    Author: Matt Thompson <mattwthompson@protonmail.com>
    Date:   Wed Sep 8 16:01:00 2021 -0500

        nbqa-black -> black (#1064)

    Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

commit b3bcc88
Author: Jeff Wagner <jwagnerjpl@gmail.com>
Date:   Fri Sep 10 13:42:37 2021 -0700

    Update latest release tag to be 'stable' instead of 'latest' (#1068)

    * update use of latest tag to refer to 'stable' instead of 'latest' (since 'latest' clashes with the RTD builtin 'latest' keyword)

    * Update .github/workflows/release.yml

    Co-authored-by: Josh A. Mitchell <yoshanuikabundi@gmail.com>

    * Update notebook links from 'latest' to 'stable' tag

    * cosmetic commit to kick ci

    Co-authored-by: Josh A. Mitchell <yoshanuikabundi@gmail.com>

commit 9d9f933
Author: Matt Thompson <mattwthompson@protonmail.com>
Date:   Thu Sep 9 18:24:25 2021 -0500

    Safely import OpenMM (#1063)

    * Pin to OpenMM 7.5.x

    * Loosen OpenMM pin

    * Fix link to OpenMM ForceField API docs

    * Unpin everything

    * Cleanup

    * Gracefully import OpenMM in examples

    * Safely import OpenMM everywhere

    * Clean up an import

    * Run CI with openmm==7.5 pin

    * Run CI with openmm==7.6 pin

    * Unpin OpenMM, run slow tests

    * Revert addition of slow tests

commit e4b56ab
Author: Matt Thompson <mattwthompson@protonmail.com>
Date:   Thu Sep 9 17:12:30 2021 -0500

    Catch/raise descriptive error on conformer generation failure (#1050)

    * Catch/raise descriptive error on conformer generation failure

    * Run slow tests in PR

    * Remove useless raise_exception_types, add test in Molecule API

    * Remove unused import

    * Update openff/toolkit/utils/exceptions.py

    Co-authored-by: Lily Wang <31115101+lilyminium@users.noreply.github.com>

    * Use uranium hexafluoride to test conformer generation failures

    * Make conformer generation try other toolkits

    * Explicitly test that both OpenEye and RDKit fail on UF6

    * Update CHANGELOG

    * Fix change pushed to wrong branch

    Co-authored-by: Lily Wang <31115101+lilyminium@users.noreply.github.com>

commit 7a3fad5
Author: Matt Thompson <mattwthompson@protonmail.com>
Date:   Wed Sep 8 16:01:00 2021 -0500

    nbqa-black -> black (#1064)

commit 6463e8a
Author: Matt Thompson <mattwthompson@protonmail.com>
Date:   Thu Sep 2 17:36:06 2021 -0500

    Remove dormant API points (#1058)

    * Remove dead API points

    * Remove _networkx_to_hill_formula, replace _to_mdtraj, update release notes

    * Fix typo

commit 881c29a
Author: Matt Thompson <mattwthompson@protonmail.com>
Date:   Thu Sep 2 15:49:04 2021 -0500

    Minor fixes for OpenMM 7.6 API changes (#1061)

    * Pin to OpenMM 7.5.x

    * Loosen OpenMM pin

    * Fix link to OpenMM ForceField API docs

    * Unpin everything

    * Cleanup

    * Gracefully import OpenMM in examples

    * Test on OpenMM 7.5

    * Remove OpenMM 7.5 pin

commit e0b632d
Author: Josh A. Mitchell <yoshanuikabundi@gmail.com>
Date:   Thu Sep 2 09:11:23 2021 +1000

    Enable new OpenFF theme (#979)

    * Enable openff theme

    * Typo

    * Convert headers in index to captions

    * Updates to work with main theme branch

    * Fix logo colours

    Co-authored-by: Jeff Wagner <jwagnerjpl@gmail.com>

commit 7cb165a
Author: Josh A. Mitchell <yoshanuikabundi@gmail.com>
Date:   Thu Sep 2 09:10:27 2021 +1000

    Improve visualization with RDKit backend (#1001)

    * Improve usage of RDKit visualization backend

    * Compute 2d coordinates again every time

    * lint

    * Update changelog

    * Update visualize test for new return type

    * Implement show_hydrogens for openeye

    * Remove errant print

    * Fix incorrect rendering of radicals

    Rdkit has a complicated system for including Hydrogen atoms. It
    is discussed here:
    https://sourceforge.net/p/rdkit/mailman/message/36699970/

    In brief, there are three levels of hydrogen inclusion: Explicit
    and in graph, explicit, and implicit. This is meant to model the
    difference between hydrogens that are explicit in a SMILES string,
    and those that are inferred by the toolkit, but it unfortunately
    goes even further than that. For instance, if hydrogens are removed
    from a molecule with the rdkit.Chem.rdmolops.RemoveHs() function,
    which is the recommended way to make explicit hydrogens implicit
    for visualization, RdKit can then imply the existence of hydrogens
    using its valence model. This can, for example, convert a radical
    to the stable species of equivalent charge, even if this means
    adding hydrogens. In fact, before this commit, simply calling the
    OFFTK Molecule.to_rdkit method could convert, for example, the
    hydroxyl radical to water:

    >>> from openff.toolkit.topology import Molecule
    >>> from rdkit import Chem
    >>>
    >>> radical = Molecule.from_smiles("[O][H]")
    >>> rd_radical = radical.to_rdkit()
    >>> Chem.MolToSmiles(rd_radical)
    '[H]O'

    Visualizing rd_radical clearly demonstrates that this is water;
    the oxygen atom has an implicit hydrogen. This can also be seen
    by building the radical up from individual atoms and bonds.

    OFFTK has a different philosophy: all the hydrogens are either
    provided or inferred when the Molecule is created, and then they are
    explicitly represented in the molecular graph forever. This commit
    sets the `NoImplicit` property for all atoms in a rdkit molecule
    created by to_rdkit to True. Since all the hydrogens in a Molecule
    are already explicitly represented, this more faithfully represents
    the desired molecule in the rdkit ecosystem. The molecular species
    is even now stable over sanitization:

    >>> radical = Molecule.from_smiles("[O][H]")
    >>> rd_hydroxyl_rad = radical.to_rdkit()
    >>> Chem.SanitizeMol(rd_hydroxyl_rad) # Modifies in place
    >>> Chem.MolToSmiles(rd_hydroxyl_rad)
    [H][O]

    Visualization even includes the radical dot!

    * Fix release history lost in previous merge conflict

    * ipython -> IPython

    * Apply suggestions from code review

    * Note TODOs

    * Default boolean argument to a boolean value

    * Update behaviour change in changelog

    Co-authored-by: Matthew W. Thompson <mattwthompson@protonmail.com>
    Co-authored-by: Jeff Wagner <jwagnerjpl@gmail.com>

commit f5b5558
Author: Matt Thompson <mattwthompson@protonmail.com>
Date:   Wed Sep 1 15:58:26 2021 -0500

    Add @requires_pkg on Interchange tests (#1054)

commit da37f07
Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date:   Mon Aug 30 16:43:57 2021 -0500

    [pre-commit.ci] pre-commit autoupdate (#1060)

    updates:
    - [github.com/psf/black: 21.7b0 → 21.8b0](psf/black@21.7b0...21.8b0)

    Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

commit a837709
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Aug 25 11:14:29 2021 -0500

    Bump codecov/codecov-action from 2.0.2 to 2.0.3 (#1055)

    Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2.0.2 to 2.0.3.
    - [Release notes](https://github.com/codecov/codecov-action/releases)
    - [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
    - [Commits](codecov/codecov-action@v2.0.2...v2.0.3)

    ---
    updated-dependencies:
    - dependency-name: codecov/codecov-action
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make atom names less likely to collide with conventional atom type names
2 participants