Hi all, I was applying the code from the ConstrainedEmbed tutorial
<http://rdkit.blogspot.com/2013/12/using-allchemconstrainedembed.html> and
found a problem when trying to embed a molecule with an aromatic atom that
is not in the core. As an example, 1-aminopropan-2-one and 2-acetylpyridine:
[image: image.png]


from rdkit import Chem
from rdkit.Chem import AllChem, rdFMCS

m1 = Chem.MolFromSmiles("CC(CN)=O")
m2 = Chem.MolFromSmiles("CC(C1=CC=CC=N1)=O")
AllChem.EmbedMolecule(m1, useRandomCoords=True)

mols = [m1, m2]
res = rdFMCS.FindMCS(mols, threshold=0.8, completeRingsOnly=False)
p = Chem.MolFromSmarts(res.smartsString)

print(m1.HasSubstructMatch(p))  # True
print(m2.HasSubstructMatch(p))  # True

core1 =
AllChem.DeleteSubstructs(AllChem.ReplaceSidechains(Chem.RemoveHs(m1), p),
Chem.MolFromSmiles('*'))
core1.UpdatePropertyCache()

print(m1.HasSubstructMatch(core1))  # True
print(m2.HasSubstructMatch(core1))  # False

Of course, when I try:

m3 = Chem.AddHs(m2, addCoords=True)
Chem.AllChem.ConstrainedEmbed(m3, core1, ignoreSmoothingFailures=True,
useTethers=True)

I get ValueError("molecule doesn't match the core")

For some reason, after p is converted to core1, it stops matching the
aromatic N. If the N in m2 is not aromatic, the program works.
In some cases, I was able to match m2 to the core, but the core is missing
the N atom.
Any thoughts on how to solve this? I am actually reading the scaffold m1
from a .mol file, so I need that aromatic N there. Maybe there is a way to
add information on m1 that states that its N should be aromatic.

Thank you in advance
-- 
Rafael da Fonseca Lameiro
MSc Organic and Biological Chemistry
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to