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

MolStandardize: some operations throwing on non-standardized molecules #5318

Closed
greglandrum opened this issue May 22, 2022 · 0 comments · Fixed by #5319
Closed

MolStandardize: some operations throwing on non-standardized molecules #5318

greglandrum opened this issue May 22, 2022 · 0 comments · Fixed by #5319
Labels
Milestone

Comments

@greglandrum
Copy link
Member

Describe the bug
We should be able to run all MolStandardize operations on molecules which have not been sanitized, but we can't:

In [43]: m = Chem.MolFromSmiles("C[S+2]([O-])([O-])C([O-])C(=O)O", sanitize=False)

In [44]: uc.uncharge(m)
[06:15:53] 

****
Pre-condition Violation
getNumImplicitHs() called without preceding call to calcImplicitValence()
Violation occurred on line 297 in file /home/conda/feedstock_root/build_artifacts/rdkit_1648748485582/work/Code/GraphMol/Atom.cpp
Failed Expression: d_implicitValence > -1
****

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Input In [44], in <module>
----> 1 uc.uncharge(m)

RuntimeError: Pre-condition Violation
	getNumImplicitHs() called without preceding call to calcImplicitValence()
	Violation occurred on line 297 in file Code/GraphMol/Atom.cpp
	Failed Expression: d_implicitValence > -1
	RDKIT: 2022.03.1
	BOOST: 1_74


In [45]: rdMolStandardize.Reionize(m)
[06:19:09] 

****
Pre-condition Violation
getNumImplicitHs() called without preceding call to calcImplicitValence()
Violation occurred on line 297 in file /home/conda/feedstock_root/build_artifacts/rdkit_1648748485582/work/Code/GraphMol/Atom.cpp
Failed Expression: d_implicitValence > -1
****

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Input In [45], in <module>
----> 1 rdMolStandardize.Reionize(m)

RuntimeError: Pre-condition Violation
	getNumImplicitHs() called without preceding call to calcImplicitValence()
	Violation occurred on line 297 in file Code/GraphMol/Atom.cpp
	Failed Expression: d_implicitValence > -1
	RDKIT: 2022.03.1
	BOOST: 1_74

Configuration (please complete the following information):

  • RDKit version: 2022.03 and master
  • OS: all
@greglandrum greglandrum added this to the 2022_03_3 milestone May 22, 2022
greglandrum added a commit to greglandrum/rdkit that referenced this issue May 22, 2022
@greglandrum greglandrum linked a pull request May 23, 2022 that will close this issue
greglandrum added a commit that referenced this issue May 30, 2022
* Fixes #5317

* Fixes #5318

* Fixes #5320

* Update Code/GraphMol/MolStandardize/Charge.cpp

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>
greglandrum added a commit that referenced this issue Jun 2, 2022
* Fixes #5317

* Fixes #5318

* Fixes #5320

* Update Code/GraphMol/MolStandardize/Charge.cpp

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant