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

Uncharger not properly setting explicit/implicit H count #2749

Closed
greglandrum opened this issue Oct 30, 2019 · 0 comments
Closed

Uncharger not properly setting explicit/implicit H count #2749

greglandrum opened this issue Oct 30, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@greglandrum
Copy link
Member

This is one that should have been merged before the release, but I forgot to create the issue an finish the PR. :-(

Here's the reproducible:

In [2]: from rdkit import Chem                                                                                                                                                  

In [3]: import rdkit                                                                                                                                                            

In [4]: rdkit.__version__                                                                                                                                                       
Out[4]: '2019.09.1'

In [6]: from rdkit.Chem.MolStandardize import rdMolStandardize                                                                                                                  

In [7]: uc = rdMolStandardize.Uncharger()                                                                                                                                       

In [9]: outm = uc.uncharge(Chem.MolFromSmiles('CC[NH-]'))                                                                                                                       
[15:53:00] Running Uncharger
[15:53:00] Removed negative charge.

In [10]: outm.Debug()                                                                                                                                                           
Atoms:
	0 6 C chg: 0  deg: 1 exp: 1 imp: 3 hyb: 4 arom?: 0 chi: 0
	1 6 C chg: 0  deg: 2 exp: 2 imp: 2 hyb: 4 arom?: 0 chi: 0
	2 7 N chg: 0  deg: 1 exp: 2 imp: 0 hyb: 4 arom?: 0 chi: 0
Bonds:
	0 0->1 order: 1 conj?: 0 aromatic?: 0
	1 1->2 order: 1 conj?: 0 aromatic?: 0

In [11]: print(Chem.MolToMolBlock(outm))                                                                                                                                        

     RDKit          2D

  3  2  0  0  0  0  0  0  0  0999 V2000
    0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.2990    0.7500    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    2.5981   -0.0000    0.0000 N   0  0  0  0  0  2  0  0  0  0  0  0
  1  2  1  0
  2  3  1  0
M  END

The explicit valence on the N should be 3 and there should be no valence flag set in the mol block.

@greglandrum greglandrum added this to the 2019_09_2 milestone Oct 30, 2019
@greglandrum greglandrum self-assigned this Oct 30, 2019
greglandrum added a commit to greglandrum/rdkit that referenced this issue Oct 30, 2019
greglandrum added a commit that referenced this issue Dec 3, 2019
greglandrum added a commit that referenced this issue Dec 3, 2019
* Switch to using numTotalHs() instead of numExplicitHs()

* Fixes #2749

* changes in response to review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant