-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add protonation functions #99
base: v1.0/dev
Are you sure you want to change the base?
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. |
Based on the codecov, may need to add additional tests to properly test |
@jonwzheng, thank you for this addition. I will work on reviewing this PR shortly. |
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). |
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_mol
andis_symmetric_to_substructure
Other 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_smiles
though.