On Wed, Aug 28, 2013 at 2:29 PM, Michał Nowotka <[email protected]> wrote:
> Thanks Greg, can you explain what is GetConformer?
>
> In [3]: m = Chem.MolFromSmiles('Cc1ccccc1')
> In [4]: CoordsAreAllZero(m)
>
> ---------------------------------------------------------------------------
> ValueError Traceback (most recent call last)
> /home/mnowotka/Documents/ci/curation_interface/trunk/src/curation_interface/<ipython-input-4-2d89c7fee0d4>
> in <module>()
> ----> 1 CoordsAreAllZero(m)
>
> /home/mnowotka/Documents/ci/curation_interface/trunk/src/curation_interface/<ipython-input-2-6b9ec261d3ef>
> in CoordsAreAllZero(m, confId)
> 1 def CoordsAreAllZero(m,confId=-1):
> ----> 2 conf = m.GetConformer(confId)
> 3 for i in range(m.GetNumAtoms()):
> 4 if list(conf.GetAtomPosition(i))!=[0.0,0.0,0.0]:
> 5 return False
>
> ValueError: Bad Conformer Id
>
>
The rdkit stores atomic positions in Conformer objects, not directly on the
molecule itself. This is so there is flexibility to have molecules with no
conformers or multiple conformers. Molecules built from SMILES have no
conformers; you need to create one by either adding 2D coordinates or 3D
coordinates.
In [2]: m = Chem.MolFromSmiles('c1cccn1C(C)(C)C')
In [3]: m.GetNumConformers()
Out[3]: 0
In [4]: from rdkit.Chem import AllChem
In [5]: AllChem.Compute2DCoords(m)
Out[5]: 0
In [6]: m.GetNumConformers()
Out[6]: 1
-greg
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss