Add explicit hydrogens when loading in SMILES#1172
Merged
Conversation
Previously, if a user decided to use `parmed.rdkit.load_smiles` to generate a `parmed` structure, no explicit hydrogens are added to the structure, this can be an issue if trying to generate hydrocarbon systems. This PR leverages the built-in `rdkit` ability to generate explicit hydrogens for an rdkit mol using `rdkit.Chem.AddHs` by passing a boolean flag `hydrogens=True` to use this method. Since this could break others' workflows, the default value is `False` to comply with current functionality.
swails
reviewed
May 12, 2021
swails
left a comment
Contributor
There was a problem hiding this comment.
Thank you! This is a nice addition!
I actually think the functionality you added should be made the default and people that use it will have to deal with the backwards incompatibility (there are several in the upcoming 4.0 release).
Co-authored-by: Jason Swails <jason@entos.ai>
Co-authored-by: Jason Swails <jason@entos.ai>
Contributor
Author
|
@swails , I went through and made the necessary changes discussed above and the units tests are passing locally for me. There was very little modification of the codebase to support these changes 🎉 . Let me know if there is anything else needed on my end! It seems like for builds to run it needs approval from a maintainer: https://github.com/ParmEd/ParmEd/actions/runs/836655356 |
Contributor
|
Thanks! I approved and will merge when the tests pass. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, if a user decided to use
parmed.rdkit.load_smilestogenerate a
parmedstructure, no explicit hydrogens are added to thestructure, this can be an issue if trying to generate hydrocarbon
systems.
This PR leverages the built-in
rdkitmethodrdkit.Chem.AddHsto generate explicithydrogens for an rdkit mol. An additional boolean flag:
hydrogens=Truehas been added to this method. Since this could break others' workflows, the default value isFalseto comply with current functionality.