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

Enumerate input molecule with tautomers #1780

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mattwthompson
Copy link
Member

Suggestion #2 in #1464 (comment)

Copy link

codecov bot commented Nov 28, 2023

Codecov Report

Merging #1780 (e933385) into main (779565b) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Additional details and impacted files

@mattwthompson mattwthompson marked this pull request as ready for review November 30, 2023 15:59
Copy link
Collaborator

@Yoshanuikabundi Yoshanuikabundi left a comment

Choose a reason for hiding this comment

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

I think the same issue as in enumerate_protomers (#1779) pops up here (see suggestions), though I haven't actually found a molecule that doesn't return itself. Also need to remove the +1 from max states in OpenEye and update a docstring here or there.

Does tautomer have a different meaning in cheminformatics than in ochem? I couldn't come up with any keto-enol tautomerisation with this, which I thought was, like, THE tautomerisation.

Notebook I messed around in for posterity: tautomers.zip

@@ -945,16 +949,13 @@ def enumerate_tautomers(
tautomer_options.SetCarbonHybridization(False)
Copy link
Collaborator

Choose a reason for hiding this comment

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

- tautomer_options.SetMaxTautomersGenerated(max_states + 1)
+ tautomer_options.SetMaxTautomersGenerated(max_states)

No longer need to generate an extra state so we can drop the input.

self,
molecule: "Molecule",
max_states: int = 20,
) -> list["Molecule"]:
"""
Enumerate the possible tautomers of the current molecule
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Enumerate the possible tautomers of the current molecule
Enumerate some possible tautomers of the current molecule

molecules: List[openff.toolkit.topology.Molecule]
A list of openff.toolkit.topology.Molecule instances excluding the input molecule.
molecules: list[openff.toolkit.Molecule]
A list of openff.toolkit.Molecule instances excluding the input molecule.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
A list of openff.toolkit.Molecule instances excluding the input molecule.
A list of openff.toolkit.Molecule instances, including the input molecule unless it is pruned by the ``max_states`` argument.

) -> List["Molecule"]:
self,
molecule: "Molecule",
max_states: int = 20,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we could go bigger than 20 if we wanted!

molecules: List[openff.toolkit.topology.Molecule]
A list of openff.toolkit.topology.Molecule instances not including the input molecule.
molecules: list[openff.toolkit.Molecule]
A list of openff.toolkit.Molecule instances including the input molecule.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
A list of openff.toolkit.Molecule instances including the input molecule.
A list of openff.toolkit.Molecule instances including the input molecule unless it has been pruned by the ``max_states`` argument.

self,
molecule: "Molecule",
max_states: int = 20,
) -> list["Molecule"]:
"""
Enumerate the possible tautomers of the current molecule.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Enumerate the possible tautomers of the current molecule.
Enumerate some possible tautomers of the current molecule.

@@ -12,6 +12,8 @@ Releases follow the `major.minor.micro` scheme recommended by [PEP440](https://w

### Behavior changes

- [PR #17XX](https://github.com/openforcefield/openff-toolkit/pull/17XX): `Molecule.enumerate_tautomers` now includes the input molecule in the returned list.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- [PR #17XX](https://github.com/openforcefield/openff-toolkit/pull/17XX): `Molecule.enumerate_tautomers` now includes the input molecule in the returned list.
- [PR #1780](https://github.com/openforcefield/openff-toolkit/pull/1780): `Molecule.enumerate_tautomers` now includes the input molecule in the returned list.

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.

2 participants