Trees | Indices | Help |
|
---|
|
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
tkRoot = None hash(x) |
|||
tkLabel = None hash(x) |
|||
tkPI = None hash(x) |
Imports: os, iteritems, MolDrawing, DrawingOptions
|
Returns a PIL image containing a drawing of the molecule ARGUMENTS: - kekulize: run kekulization routine on input `mol` (default True) - size: final image size, in pixel (default (300,300)) - wedgeBonds: draw wedge (stereo) bonds (default True) - highlightAtoms: list of atoms to highlight (default []) - highlightMap: dictionary of (atom, color) pairs (default None) - highlightBonds: list of bonds to highlight (default []) - highlightColor: RGB color as tuple (default [1, 0, 0]) NOTE: use 'matplotlib.colors.to_rgb()' to convert string and HTML color codes into the RGB tuple representation, eg. from matplotlib.colors import ColorConverter img = Draw.MolToImage(m, highlightAtoms=[1,2], highlightColor=ColorConverter().to_rgb('aqua')) img.save("molecule.png") RETURNS: a PIL Image object |
Generates a drawing of a molecule and writes it to a file |
Generates a picture of a molecule and displays it in a Tkinter window |
Generates a drawing of a molecule on a matplotlib canvas |
useful things to do with these: fig.axes[0].imshow(z,cmap=cm.gray,interpolation='bilinear',origin='lower',extent=(0,1,0,1)) fig.axes[0].contour(x,y,z,20,colors='k') fig=Draw.MolToMPL(m); contribs=Crippen.rdMolDescriptors._CalcCrippenContribs(m) logps,mrs=zip(*contribs) x,y,z=Draw.calcAtomGaussians(m,0.03,step=0.01,weights=logps) fig.axes[0].imshow(z,cmap=cm.jet,interpolation='bilinear',origin='lower',extent=(0,1,0,1)) fig.axes[0].contour(x,y,z,20,colors='k',alpha=0.5) fig.savefig('coumlogps.colored.png',bbox_inches='tight') |
Generates a drawing of a molecule on a Qt QPixmap |
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Apr 23 18:49:15 2016 | http://epydoc.sourceforge.net |