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

MolFromMolBlock should correctly assign stereochemistry to 3D molecules #5327

Closed
greglandrum opened this issue May 25, 2022 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@greglandrum
Copy link
Member

Describe the bug
Here's a demo:

In [15]: print(mb)

     RDKit          3D

  0  0  0  0  0  0  0  0  0  0999 V3000
M  V30 BEGIN CTAB
M  V30 COUNTS 5 4 0 0 0
M  V30 BEGIN ATOM
M  V30 1 C 0.900794 -0.086835 0.009340 0
M  V30 2 C -0.552652 0.319534 0.077502 0
M  V30 3 F -0.861497 0.413307 1.437370 0
M  V30 4 Cl -0.784572 1.925710 -0.672698 0
M  V30 5 O -1.402227 -0.583223 -0.509512 0
M  V30 END ATOM
M  V30 BEGIN BOND
M  V30 1 1 1 2
M  V30 2 1 2 3
M  V30 3 1 2 4
M  V30 4 1 2 5
M  V30 END BOND
M  V30 END CTAB
M  END

In [16]: nm = Chem.MolFromMolBlock(mb)

In [17]: nm.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: 4 exp: 4 imp: 0 hyb: 4 arom?: 0 chi: 0
	2 9 F chg: 0  deg: 1 exp: 1 imp: 0 hyb: 4 arom?: 0 chi: 0
	3 17 Cl chg: 0  deg: 1 exp: 1 imp: 0 hyb: 4 arom?: 0 chi: 0
	4 8 O chg: 0  deg: 1 exp: 1 imp: 1 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
	2 1->3 order: 1 conj?: 0 aromatic?: 0
	3 1->4 order: 1 conj?: 0 aromatic?: 0

if we call AssignStereochemistryFrom3D() then the chiral center is recognized:

In [18]: Chem.AssignStereochemistryFrom3D(nm)

In [19]: nm.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: 4 exp: 4 imp: 0 hyb: 4 arom?: 0 chi: 1
	2 9 F chg: 0  deg: 1 exp: 1 imp: 0 hyb: 4 arom?: 0 chi: 0
	3 17 Cl chg: 0  deg: 1 exp: 1 imp: 0 hyb: 4 arom?: 0 chi: 0
	4 8 O chg: 0  deg: 1 exp: 1 imp: 1 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
	2 1->3 order: 1 conj?: 0 aromatic?: 0
	3 1->4 order: 1 conj?: 0 aromatic?: 0

There is logic in the mol block parser to assign stereochemistry to 3D conformers: https://github.com/rdkit/rdkit/blob/master/Code/GraphMol/FileParsers/MolFileParser.cpp#L3153
but this ends up not being called if there are no wedged bonds. That doesn't make sense... we shouldn't require wedged bonds in the case of a 3D conformer.

Configuration (please complete the following information):

  • RDKit version: all
  • OS: all
@greglandrum greglandrum self-assigned this May 25, 2022
@greglandrum greglandrum added this to the 2022_03_3 milestone May 25, 2022
greglandrum added a commit to greglandrum/rdkit that referenced this issue May 25, 2022
Fixes rdkit#5327

probably a good idea to add a bit more testing here
greglandrum added a commit that referenced this issue Jun 2, 2022
* Fixes #5328
Fixes #5327

probably a good idea to add a bit more testing here

* more tests!
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