Bio.Graphics.KGML_vis module

Classes and functions to visualise a KGML Pathway Map.

The KGML definition is as of release KGML v0.7.1 (http://www.kegg.jp/kegg/xml/docs/)

Classes:

Bio.Graphics.KGML_vis.darken(color, factor=0.7)

Return darkened color as a ReportLab RGB color.

Take a passed color and returns a Reportlab color that is darker by the factor indicated in the parameter.

Bio.Graphics.KGML_vis.color_to_reportlab(color)

Return the passed color in Reportlab Color format.

We allow colors to be specified as hex values, tuples, or Reportlab Color objects, and with or without an alpha channel. This function acts as a Rosetta stone for conversion of those formats to a Reportlab Color object, with alpha value.

Any other color specification is returned directly

Bio.Graphics.KGML_vis.get_temp_imagefilename(url)

Return filename of temporary file containing downloaded image.

Create a new temporary file to hold the image file at the passed URL and return the filename.

class Bio.Graphics.KGML_vis.KGMLCanvas(pathway, import_imagemap=False, label_compounds=True, label_orthologs=True, label_reaction_entries=True, label_maps=True, show_maps=False, fontname='Helvetica', fontsize=6, draw_relations=True, show_orthologs=True, show_compounds=True, show_genes=True, show_reaction_entries=True, margins=(0.02, 0.02))

Bases: object

Reportlab Canvas-based representation of a KGML pathway map.

__init__(self, pathway, import_imagemap=False, label_compounds=True, label_orthologs=True, label_reaction_entries=True, label_maps=True, show_maps=False, fontname='Helvetica', fontsize=6, draw_relations=True, show_orthologs=True, show_compounds=True, show_genes=True, show_reaction_entries=True, margins=(0.02, 0.02))

Initialize the class.

draw(self, filename)

Add the map elements to the drawing.