rdkit: Can't Embed a molecule
- RDKit Version: ‘2019.09.3’
- Operating system: Windows, Mac
- Python version: 3.7
- installed rdkit with conda install -c conda-forge rdkit
Description:
It seems rdkit can’t embed some molecules. Tried with enforceChirality = False, ignoreSmoothingFailures = False. Those didn’t work. Could you help, please?
Example SMILES:
C=CC1=C(N)Oc2cc1c(-c1cc(C©O)cc(=O)cc1C1NCC(=O)N1)c(OC)c2OC
C=CC1=C(N)Oc2cc1c(C1=CC(C(O)CN)=CC(O)C=C1C1NCC(=O)N1)c(OC)c2OC
>>> from rdkit import Chem
>>> from rdkit.Chem import AllChem
>>> smiles = 'C=CC1=C(N)Oc2cc1c(-c1cc(C(C)O)cc(=O)cc1C1NCC(=O)N1)c(OC)c2OC'
>>> mol = Chem.MolFromSmiles(smiles)
>>> mol = Chem.AddHs(mol)
>>> embed_success = AllChem.EmbedMolecule(mol)
>>> embed_success
-1
>>> AllChem.MMFFOptimizeMolecule(mol, maxIters=500)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Bad Conformer Id
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (6 by maintainers)
@MherMatevosyan sorry for the slow reply on this one. Finishing up the most recent RDKit release has kept me overly busy.
As you’re seeing, when
AllChem.EmbedMolecule()returns -1 it means that the embedding failed; the code was unable to generate a conformer. Often when this happens the best solution is to try starting from random coordinates, but this doesn’t help with your molecule:When this fails, I generally then take a close look at the molecule. Here’s what you have:
That includes this substructure, which I believe is the source of the problem:
I think it’s going to be difficult to find a 3D structure of that ring system that is even close to being physically reasonable. Because the RDKit’s conformer generator uses rules that attempt to generate physically reasonable structures, they fail here.
We might be able to figure out how to get a conformer for things like this, but I want to check first: do you believe that these are physically reasonable molecules?