0

I simply copied and pasted these code from rdkit (https://www.rdkit.org/docs/GettingStartedInPython.html#generating-images-of-fingerprint-bits) I was expecting to generate graphs. However, I got a long string.

from rdkit import Chem 
from rdkit.Chem import AllChem
from rdkit.Chem import Draw
mol = Chem.MolFromSmiles('c1ccccc1CC1CC1')
bi = {}
fp = AllChem.GetMorganFingerprintAsBitVect(mol, radius=2, bitInfo=bi)
mfp2_svg = Draw.DrawMorganBit(mol, 872, bi)
rdkbi = {}
rdkfp = Chem.RDKFingerprint(mol, maxPath=5, bitInfo=rdkbi)
rdk_svg = Draw.DrawRDKitBit(mol, 1553, rdkbi)

Does anyone know how to solve this problem? Thanks a lot in advanced.

I am now using python 3.6 and latest rdkit version (2018.09.1.0) on Windows

LaurentY
  • 7,495
  • 3
  • 37
  • 55
Shuan
  • 1
  • 3

1 Answers1

0

To see depiction in IPython or Jupyter notebooks just add

from rdkit.Chem.Draw import IPythonConsole

The RDKit 'GettingStarted' did not use Ipython for the sample scripts, so the import of the IPythonConsole is never declared, allthough it is not new.

Look in the RDKit Blog or search for notebooks the web and you see it is a standard.

rapelpy
  • 1,684
  • 1
  • 11
  • 14