On Oct 29, 2011, at 2:29 PM, Greg Landrum wrote:
> A colleague pointed me to the new version of IPython, which includes a
> really useful interactive qt-based graphical console.
> 
> Since it's easy to do so and the results are actually useful, I added
> a bit of RDKit integration to this:
> http://code.google.com/p/rdkit/wiki/IPythonIntegration


Okay, I've decided to give this a go on my Mac. It appears I'm missing
something because I don't get an image from the following.

import rdkit.Chem.Draw.IPythonConsole
from rdkit import Chem
Chem.MolFromSmiles("C")


It looks like it's perhaps to do with my lack of PIL. I installed
Pillow ('Pillow is the "friendly" PIL fork.') but that didn't work.
I then installed PIL 1.1.7 and that did a bit better, in that
it inserted an image with this URL. 

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAACWCAIAAADCEh9HAAACCElEQVR4nO3UwQ3AIBDAsNL9dz52IA+EZE+QV9bMfACc+m8HALzNRgESGwVIbBQgsVGAxEYBEhsFSGwUILFRgMRGARIbBUhsFCCxUYDERgESGwVIbBQgsVGAxEYBEhsFSGwUILFRgMRGARIbBUhsFCCxUYDERgESGwVIbBQgsVGAxEYBEhsFSGwUILFRgMRGARIbBUhsFCCxUYDERgESGwVIbBQgsVGAxEYBEhsFSGwUILFRgMRGARIbBUhsFCCxUYDERgESGwVIbBQgsVGAxEYBEhsFSGwUILFRgMRGARIbBUhsFCCxUYDERgESGwVIbBQgsVGAxEYBEhsFSGwUILFRgMRGARIbBUhsFCCxUYDERgESGwVIbBQgsVGAxEYBEhsFSGwUILFRgMRGARIbBUhsFCCxUYDERgESGwVIbBQgsVGAxEYBEhsFSGwUILFRgMRGARIbBUhsFCCxUYDERgESGwVIbBQgsVGAxEYBEhsFSGwUILFRgMRGARIbBUhsFCCxUYDERgESGwVIbBQgsVGAxEYBEhsFSGwUILFRgMRGARIbBUhsFCCxUYDERgESGwVIbBQgsVGAxEYBEhsFSGwUILFRgMRGARIbBUhsFCCxUYDERgESGwVIbBQgsVGAxEYBEhsFSGwUILFRgMRGARIbBUhsFCCxUYDERgESGwVIbBQgsVGAZAMTDQQpVReZYAAAAABJRU5ErkJggg==

However, it was completely blank.

The PIL installation says:

--- TKINTER support available
*** JPEG support not available
--- ZLIB (PNG/ZIP) support available
*** FREETYPE2 support not available
*** LITTLECMS support not available

Also, I did

from rdkit.Chem import Draw
Draw.MolToImageFile(mol,'test.png')

and got the same blank result, when I did the code in the
IPython browser.

But on the command-line,

[xebulon:~] dalke% python
Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from rdkit.Chem import Draw
>>> from rdkit import Chem
>>> Chem.MolFromSmiles("c1ccccc1O")
<rdkit.Chem.rdchem.Mol object at 0x10faaf980>
>>> mol = _
>>> Draw.MolToImageFile(mol, "test.png")
>>> 

This gives a "test.png" with visible graphics.

Also, the ipython notebook and the command-line versions are
using the same Python:

In [4]:  import sys
         sys.version
Out[4]:
'2.7.1 (r271:86832, Jul 31 2011, 19:30:53) \n[GCC 4.2.1 (Based on Apple Inc. 
build 5658) (LLVM build 2335.15.00)]'



Any clues?


                                Andrew
                                [email protected]



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to