[Rdkit-discuss] Problem with ConstrainedEmbed()

2011-05-20 Thread James Davidson
Dear All,

I am currently having some problems using the AllChem.ConstrainedEmbed() -
which I have previously used successfully in version 2010_09_1 (Windows py26
binary).  The following example demonstrates the issue:

 from rdkit import Chem
 from rdkit.Chem import AllChem
 template = Chem.MolFromSmiles(c1cnn(Cc2c2)c1)
 mol = Chem.MolFromSmiles(c1ccc(Cn2ncc(-c3c3)c2)cc1)

Now I give the template some 3D coordinates:

 AllChem.EmbedMolecule(template)
 AllChem.UFFOptimizeMolecule(template)

and finally, try to force an overlay of 'mol' onto 'template'

 AllChem.ConstrainedEmbed(mol, template, True)

Traceback (most recent call last):
  File pyshell#7, line 1, in module
AllChem.ConstrainedEmbed(mol, template, True)
  File C:\RDKit_2010_12_1\rdkit\Chem\AllChem.py, line 294, in
ConstrainedEmbed
rms = AlignMol(mol,core,atomMap=algMap)
RuntimeError: Range Error


I am not getting a ValueError - so I think this shows the substructure match
is ok, but wasn't sure where to go to dig into the AlignMol() function...

As the error message above shows, this is running 2010_12_1.  I have just
tried with 2011_03_1beta1 and 2011_03_2 and get the same thing.  In
2010_09_1 the ConstrainedEmbed() passes back an RDKit molecule fine.

Kind regards

James
--
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Problem with ConstrainedEmbed()

2011-05-20 Thread Greg Landrum
Dear James,

On Fri, May 20, 2011 at 4:54 PM, James Davidson jepdavid...@gmail.com wrote:
 Dear All,

 I am currently having some problems using the AllChem.ConstrainedEmbed() -
 which I have previously used successfully in version 2010_09_1 (Windows py26
 binary).  The following example demonstrates the issue:
 from rdkit import Chem
 from rdkit.Chem import AllChem
 template = Chem.MolFromSmiles(c1cnn(Cc2c2)c1)
 mol = Chem.MolFromSmiles(c1ccc(Cn2ncc(-c3c3)c2)cc1)
 Now I give the template some 3D coordinates:
 AllChem.EmbedMolecule(template)
 AllChem.UFFOptimizeMolecule(template)
 and finally, try to force an overlay of 'mol' onto 'template'
 AllChem.ConstrainedEmbed(mol, template, True)
 Traceback (most recent call last):
   File pyshell#7, line 1, in module
     AllChem.ConstrainedEmbed(mol, template, True)
   File C:\RDKit_2010_12_1\rdkit\Chem\AllChem.py, line 294, in
 ConstrainedEmbed
     rms = AlignMol(mol,core,atomMap=algMap)
 RuntimeError: Range Error


Yep, there's a bug here. Something changed and apparently this bit of
code isn't being tested.
I'll check in a real fix and some tests, but the quick fix is to
modify the area around line 294 of AllChem.py from:
# rotate the embedded conformation onto the core:
rms = AlignMol(mol,core,atomMap=algMap)
to:
# rotate the embedded conformation onto the core:
algMap = [(y,x) for (x,y) in algMap]
rms = AlignMol(mol,core,atomMap=algMap)

Thanks for reporting this,
-greg

--
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss