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

Pre-condition Violation: attempt to add self-bond #22

Open
robertdavidburbidgephd opened this issue Sep 9, 2020 · 1 comment
Open

Comments

@robertdavidburbidgephd
Copy link

robertdavidburbidgephd commented Sep 9, 2020

With the following code:

from rdchiral import main as rdc
reaction = rdc.rdchiralReaction('[C:1]-[N;H0;D3;+0:2](-[C:3])-[O;H0;D2;+0:6]-[C:5]=[O;D1;H0:4]>>[C:1]-[NH;D2;+0:2]-[C:3].[O;D1;H0:4]=[C:5]-[O;H0;D2;+0:6]-[O;H0;D2;+0:6]-[C:5]=[O;D1;H0:4]')
rct = rdc.rdchiralReactants('O=C(ON1C(=O)CCC1=O)c1ccc2c(c1)OCO2')
reactants = rdc.rdchiralRun(reaction, rct)

I get the following error:

Traceback (most recent call last):
File "test.py", line 6, in
reactants = rdc.rdchiralRun(reaction, rct)
File "xx/lib/python3.6/site-packages/rdchiral/main.py", line 242, in rdchiralRun
merged_map_to_id[bj], b.GetBondType())
RuntimeError: Pre-condition Violation
attempt to add self-bond
Violation occurred on line 300 in file Code/GraphMol/RWMol.cpp
Failed Expression: atomIdx1 != atomIdx2
RDKIT: 2020.03.3
BOOST: 1_67

The SMARTS was generated with RDChiral from the reverse of various reaction SMILES from Reaxys, e.g.:

[NH:1]([CH2:6][CH2:7][O:8][CH3:9])[CH2:2][CH2:3][O:4][CH3:5].[c:10]1([C:16]([O:18][O:18][C:16]([c:10]2[cH:15][cH:14][cH:13][cH:12][cH:11]2)=[O:17])=[O:17])[cH:15][cH:14][cH:13][cH:12][cH:11]1>>[C:16]([c:10]1[cH:15][cH:14][cH:13][cH:12][cH:11]1)([O:18][N:1]([CH2:6][CH2:7][O:8][CH3:9])[CH2:2][CH2:3][O:4][CH3:5])=[O:17]

In my data there are 122 reaction SMILES that when reversed lead to the above SMARTS.

@ljn917
Copy link
Contributor

ljn917 commented Sep 9, 2020 via email

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

No branches or pull requests

2 participants