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.
|
|
__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) |
|
|
|
|
|
|
|
| _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__
|