connorcoley / rdchiral

Wrapper for RDKit's RunReactants to improve stereochemistry handling
MIT License
151 stars 50 forks source link

How to write template of chiral alchol to ketone. #44

Closed shomjm closed 1 year ago

shomjm commented 1 year ago

I want to write template of chiral alchol to ketone. In the case of not chiral alchol, template "[Oh:1][C:2]([C:3])[C:4]>>[O:1]=[C:2]([C:3])[C:4]" worked well for reactant "OC(C)CC": then it gave ['CCC(C)=O']. But in the case of chiral alchol, template "[Oh:1][C@H:2]([C:3])[C:4]>>[O:1]=[C:2]([C:3])[C:4]" didn't work for reactant "O[C@H](C)CC": then it gave []. How I write template for chiral alchol?

connorcoley commented 1 year ago

This is because your chiral template specifies that the carbon with atom map 2 has a hydrogen in the reactants side and, when copied over to the product, is left implicit. This leads to a valence issue, which you can see if you install rdchiral from source with python setup.py install and set PLEVEL = 99 in the header of utils.py:

[O:1]=[CH:2]([CH3:3])[CH2:4][CH3:5], Explicit valence for atom # 1 C, 5, is greater than permitted

You can fix this by correcting your chiral template to the following:

"[OH:1][C@H:2]([C:3])[C:4]>>[O:1]=[CH0:2]([C:3])[C:4]"

shomjm commented 1 year ago

Thank you for your reply. Your template include "CH0" worked well!