[Rdkit-discuss] constrained embed: aromatic atom in core

2020-09-16 Thread Rafael da Fonseca Lameiro
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


[Rdkit-discuss] Build matching 3D structure

2020-07-27 Thread Rafael da Fonseca Lameiro
Hello
I'm having a hard time trying to build a 3D structure for a new molecule
(new) based on a reference molecule (ref).
In this case, ref is a substructure of new, and I want the coordinates of
their matching atoms to be exactly the same.
I have tried using:
  Chem.rdDepictor.GenerateDepictionMatching3DStructure (only works if both
molecules are the same)

rdkit.Chem.AllChem.ConstrainedEmbed (I get ValueError: molecule doesn't
match the core)

AllChem.AlignMol (I need to input a 3D structure for new, which doesn't
match ref)

I thought about generating a ton of conformers for new using
AllChem.EmbedMultipleConfs and then use the one with the best alignment to
ref, but I figured there should be a better way to do this. I would
appreciate any suggestions.
On a side note, is there a way to convert Chem.rdchem.Conformer objects to
Chem.rdchem.Mol?

Thank you for the help

Rafael
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss