Package schrodinger :: Package analysis :: Module reaction :: Class RouteRenderer
[hide private]
[frames] | no frames]

Class RouteRenderer

object --+
         |
        RouteRenderer

A class for rendering a Route as an image.

Note: this class only support "specific routes", for which all nodes have a 'mol' attribute. Generic routes, in which nodes might have only a reagent class, are not supported yet.

Instance Methods [hide private]
 
__init__(self, mol_size=(180, 120), plus_size=20, arrow_length=50, arrowhead_size=5, label_padding=5, label_font=('helvetica', 8), plus_font=('helvetica', 24))
Configure the RouteRenderer with various optional parameters controlling the layout of the route.
PIL.Image
render(self, route)
Render a Route into a PIL Image object.
 
renderToFile(self, route, filename)
Render a Route and save the image to a file.
 
_getCanvas(self, precursor_imgs)
 
_paste(self, canvas, img_to_paste, pos)
 
_drawTargetMol(self, canvas, mol)
 
_arrangePrecursors(self, canvas, precursor_imgs)
 
_drawArrow(self, canvas)
 
_drawLabel(self, canvas, label)
 
_drawPlusSign(self, canvas, x, y)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, mol_size=(180, 120), plus_size=20, arrow_length=50, arrowhead_size=5, label_padding=5, label_font=('helvetica', 8), plus_font=('helvetica', 24))
(Constructor)

 

Configure the RouteRenderer with various optional parameters controlling the layout of the route. All sizes are in pixels.

Parameters:
  • mol_size - (width, height) of the starting materials.
  • plus_size - width (including padding) taken by the plus signs.
Overrides: object.__init__

render(self, route)

 

Render a Route into a PIL Image object.

Parameters:
  • route (Route)
Returns: PIL.Image

renderToFile(self, route, filename)

 

Render a Route and save the image to a file.

Parameters:
  • route (Route)
  • filename (str)