Open
Conversation
… is_implicit) and unit test for uncharge_mol
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v1.0/dev #99 +/- ##
============================================
+ Coverage 60.62% 60.93% +0.30%
============================================
Files 67 67
Lines 4874 4969 +95
Branches 1199 1227 +28
============================================
+ Hits 2955 3028 +73
- Misses 1779 1790 +11
- Partials 140 151 +11 ☔ View full report in Codecov by Sentry. |
Collaborator
Author
|
Based on the codecov, may need to add additional tests to properly test |
Owner
|
@jonwzheng, thank you for this addition. I will work on reviewing this PR shortly. |
Owner
|
Just run into this repo https://github.com/durrantlab/dimorphite_dl about protonation. Maybe worth to incorporate in the future due to its light-weight. It may be also helpful for your work @jonwzheng (just FYI, no action needed). |
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.
Motivation or Problem
This PR adds several helper functions related to protonation & ionization.
Description of Changes
New "big" functions:
uncharge_mol(mol, method): Input = charged molecule (ion or zwitterion), output = uncharged form. Provides two algorithms for doing uncharging, default is to try both in case the other fails, starting with the rdkit algorithm.is_symmetric_to_substructure(mol, substructure): Check whether a mol is symmetric to a provided substructure, i.e. return "True" for comparing ethylene glycol to "OH" substructureHelper functions:
protonate_at_site(mol, site): Add a proton to a mol at a given idx and adjust formal chargesdeprotonate_at_site(mol, site): Remove a proton of a mol at a given idx and adjust formal chargesis_implicit(mol): Infer whether a molecule is an implicit or explicit mol objectfind_symmetry_classes(mol): provides a set of symmetry classes for atoms in a mol object, based on code by Greg Landrum.Testing
I included pytest modules for
uncharge_molandis_symmetric_to_substructureOther notes
The two uncharging methods have different behaviors regarding explicit hydrogens.
vs.
Is the desired behavior to re-number?
They still return the same smiles if you use
mol_to_smilesthough.