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

Error breaking StereoBonds in reactions #3147

Closed
mc-robinson opened this issue May 8, 2020 · 5 comments · Fixed by #3196
Closed

Error breaking StereoBonds in reactions #3147

mc-robinson opened this issue May 8, 2020 · 5 comments · Fixed by #3196
Labels
Milestone

Comments

@mc-robinson
Copy link

Version '2019.09.3'

I am just noting this strange behavior where the intramolecular reaction does not seem to be allowed when disconnecting a bond to an atom that is part of a separate double bond.

Example to reproduce

mol = Chem.MolFromSmiles('Cc1ccc(C(=O)/C=C/c2cnc3ccccc3n2)cc1')
rxn = AllChem.ReactionFromSmarts('[c:1][C:2](=[O])[C:3]>>([*:1][C:2]#[N].[*:3][Mg][Cl])')
p = rxn.RunReactants((Chem.AddHs(mol),))

gives

RuntimeError: Pre-condition Violation
	bgnIdx not connected to begin atom of bond
	Violation occurred on line 283 in file Code/GraphMol/Bond.cpp
	Failed Expression: getOwningMol().getBondBetweenAtoms(getBeginAtomIdx(), bgnIdx) != nullptr
	RDKIT: 2019.09.3
	BOOST: 1_67

Though removing the outer parentheses to give rxn = AllChem.ReactionFromSmarts('[c:1][C:2](=[O])[C:3]>>[*:1][C:2]#[N].[*:3][Mg][Cl]') makes the reaction work perfectly fine. I am somewhat confused by this and appreciate any help with the issue. Thanks!

@autodataming
Copy link
Contributor

图片

@mc-robinson
Copy link
Author

Interesting, thanks. So the main difference seems to be the version?

@autodataming
Copy link
Contributor

Interesting, thanks. So the main difference seems to be the version?

You could try to run the code in the different version.

@bp-kelley
Copy link
Contributor

This does look like a bug, but it isn't with the components, it appears to be with chirality:

This fails:

mol = Chem.MolFromSmiles('C(=O)/C=C/C')
rxn = AllChem.ReactionFromSmarts('[C:2](=[O])[C:3]>>[C:2]#[N][*:3]')
rxn.RunReactants([mol])

This passes:

mol = Chem.MolFromSmiles('C(=O)C=CC')
rxn = AllChem.ReactionFromSmarts('[C:2](=[O])[C:3]>>[C:2]#[N][*:3]')
rxn.RunReactants([mol])

@bp-kelley
Copy link
Contributor

@greglandrum Chirality issues should get auto assigned to you :)

@greglandrum greglandrum linked a pull request Jun 2, 2020 that will close this issue
@greglandrum greglandrum added this to the 2020_03_3 milestone Jun 2, 2020
@greglandrum greglandrum removed their assignment Jun 2, 2020
@greglandrum greglandrum changed the title Strange error when running a reaction back to a single component grouping Error breaking StereoBonds in reactions Jun 2, 2020
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.

4 participants