Hi Anthony,

For some reason that I still need to look into, there is something in this
case that's making the distance geometry embedding unhappy. I just pushed a
change to github that allows additional arguments to be provided for the
embedding when you call AllChem.ConstrainedEmbed.
I was able to get a reasonable embedding using the following arguments:
nm=AllChem.ConstrainedEmbed(mol1,mol2,ignoreSmoothingFailures=True,useRandomCoords=True,useTethers=True)

I will take a look into the problems with the default embedding and see if
I can figure out what's going on, but this should at least provide a
workaround.

-greg



On Mon, Mar 10, 2014 at 3:19 PM, Anthony Bradley <
anthony.brad...@worc.ox.ac.uk> wrote:

>  Dear all,
>
>
>
> I'm having a bit of trouble with the constrained embed functionality.
>
>
>
> I have a core molecule (m2) with 3D co-ordinates and a molecule I would
> like to superpose (m1).
>
>
>
> Running constrained embed on these returns a value error because it is not
> possible to embed m1 with the coord map (in the constrained embed function
> in AllChem.py). It is possible to embed the molecule without the coordmap.
>
>
>
> I include a working not-working example below.
>
>
>
> I might be missing some fundamental reason why this function cannot be run
> on this pair of molecules.
>
>
>
> If not has anyone seen this problem before or no of a way to fix it?
>
>
>
> Best wishes,
>
>
>
> Anthony
>
>
>
> from rdkit.Chem import AllChem
>
> from rdkit import Chem
>
> m1="""
>
>     RDKit
>
>
>
> 23 26  0  0  0  0  0  0  0  0999 V2000
>
>     0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.0000    0.0000    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
>
>   1  2  1  0
>
>   2  3  1  0
>
>   3  4  2  0
>
>   4  5  1  0
>
>   5  6  2  0
>
>   6  7  1  0
>
>   7  8  2  0
>
>   7  9  1  0
>
>   9 10  2  0
>
> 10 11  1  0
>
> 11 12  1  0
>
> 12 13  1  0
>
> 13 14  2  0
>
> 14 15  1  0
>
> 15 16  1  0
>
> 16 17  1  0
>
> 17 18  1  0
>
> 18 19  1  0
>
> 19 20  2  0
>
>   9 21  1  0
>
> 21 22  2  0
>
> 21 23  1  0
>
>   8  3  1  0
>
> 15 11  2  0
>
> 23  6  1  0
>
> 19 14  1  0
>
> M  END"""
>
> m2 = """
>
>      RDKit          3D
>
>
>
> 14 15  0  0  0  0  0  0  0  0999 V2000
>
>     2.3310   27.3220    8.7020 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     3.2500   27.0650    8.0540 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     1.5120   28.4620    8.4140 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.3320   28.8100    9.1340 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>    -0.2250   28.1050   10.2030 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>    -1.5490   28.7880   10.7670 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>    -2.1290   28.2150   11.7490 O   0  0  0  0  0  0  0  0  0  0  0  0
>
>    -1.7430   27.1830   12.2850 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>    -2.0160   29.9510   10.1940 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>    -1.3640   30.5820    9.1080 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>    -0.1630   29.9910    8.5750 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     0.6500   30.4210    7.5360 N   0  0  0  0  0  0  0  0  0  0  0  0
>
>     1.6120   29.5320    7.4620 C   0  0  0  0  0  0  0  0  0  0  0  0
>
>     2.4850   29.6660    6.6370 O   0  0  0  0  0  0  0  0  0  0  0  0
>
>   1  2  1  0
>
>   1  3  2  3
>
>   3  4  1  0
>
>   3 13  1  0
>
>   4  5  2  0
>
>   4 11  1  0
>
>   5  6  1  0
>
>   6  7  1  0
>
>   6  9  2  0
>
>   7  8  1  0
>
>   9 10  1  0
>
> 10 11  2  0
>
> 11 12  1  0
>
> 12 13  1  0
>
> 13 14  2  0
>
> M  END"""
>
> mol1= Chem.MolFromMolBlock(m1)
>
> mol2= Chem.MolFromMolBlock(m2)
>
> AllChem.ConstrainedEmbed(mol1,mol2)
>
>
>
> Returns this error:
>
>
>
> C:\RDKit_2011_03_2\rdkit\Chem\AllChem.pyc in ConstrainedEmbed(mol, core,
> useTethers, coreConfId, randomseed)
>
>     295   ci = EmbedMolecule(mol,coordMap=coordMap,randomSeed=randomseed)
>
>     296   if ci<0:
>
> --> 297     raise ValueError,'Could not embed molecule.'
>
>     298
>
>     299   algMap=[(j,i) for i,j in enumerate(match)]
>
>
>
> ValueError: Could not embed molecule.
>
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/13534_NeoTech
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to