connorcoley / rdchiral

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

Rule not applied when I think it should be. #18

Open willfinnigan opened 4 years ago

willfinnigan commented 4 years ago

Hi,

Nice project.

I've got quite a simple rule I'd like to apply which has no chirality specified.

[#6:4][#8:6][#6:2](=[O:3])[#6:1] >> [#6:4][#6:2](=[O:3])[#6:1]

Screenshot 2020-03-02 at 18 54 01

This works fine in most cases, but not for this ring:

C[C@@H]1CCOC(=O)CC1

Screenshot 2020-03-02 at 18 54 06

However, rings one carbon bigger or one carbon smaller work fine.

Is it something to do with it being a symmetrical product? The standard rdkit method works ok.

Thanks for any help!!

Best, Will

willfinnigan commented 4 years ago
from rdchiral.main import rdchiralReaction, rdchiralReactants, rdchiralRun

rxn = rdchiralReaction('[#6:4][#8:6][#6:2](=[O:3])[#6:1]>>[#6:4][#6:2](=[O:3])[#6:1]')
reactants = rdchiralReactants('C[C@@H]1CCOC(=O)CC1')
outcomes = rdchiralRun(rxn, reactants)

print(outcomes)
thomasstruble commented 4 years ago

You are correct, the outcomes from rdkit has stereochemistry when the symmetry of the product makes the molecule achiral. The lines in the code that deals with this are: https://github.com/connorcoley/rdchiral/blob/3b9ae0e02d1ec99eea1b953d5870091af664de4f/rdchiral/main.py#L498-L511

connorcoley commented 4 years ago

Hi Will -- Thanks for creating this issue. Viewed in the context of retrosynthesis, this looks like the desired behavior. We wouldn't be able to synthesize C[C@@H]1CCOC(=O)CC1 through that ring expansion; we could only make a racemic mixture since we are starting from the achiral precursor.

If you're interested in changing this behavior, you could consider modifying the lines @thomasstruble referred you to. However, we always handle ambiguity in a manner that makes sense for retrosynthesis throughout the code, so I'd caution you against making just that single change

willfinnigan commented 4 years ago

Ah that makes sense! (sorry, biologist here)

However, enzymatically this appears to be possible. https://onlinelibrary.wiley.com/doi/epdf/10.1002/cctc.201300604

I'll have a play with the change @thomasstruble suggested.

Thanks both for getting back. Hopefully see you in Bristol next week.