Package Bio :: Package Graphics :: Package GenomeDiagram :: Module _AbstractDrawer
[hide private]
[frames] | no frames]

Module _AbstractDrawer

source code

AbstractDrawer module (considered to be a private module, the API may change!)

Provides:

o AbstractDrawer -    Superclass for methods common to *Drawer objects

o page_sizes -          Method that returns a ReportLab pagesize when passed
                        a valid ISO size

o draw_box -            Method that returns a closed path object when passed
                        the proper co-ordinates.  For HORIZONTAL boxes only.

o angle2trig -          Method that returns a tuple of values that are the
                        vector for rotating a point through a passed angle,
                        about an origin

o intermediate_points - Method that returns a list of values intermediate
                        between the points in a passed dataset

For drawing capabilities, this module uses reportlab to draw and write
the diagram:

http://www.reportlab.com

For dealing with biological information, the package expects BioPython
objects:

http://www.biopython.org

Classes [hide private]
  AbstractDrawer
AbstractDrawer
Functions [hide private]
 
page_sizes(size)
o size A string representing a standard page size
source code
 
_stroke_and_fill_colors(color, border)
Helper function handle border and fill colors (PRIVATE).
source code
 
draw_box(point1, point2, color=Color(.564706,.933333,.564706,1), border=None, colour=None, **kwargs)
draw_box(self, (x1, y1), (x2, y2), (x3, y3), (x4, y4), color=colors.lightgreen)
source code
 
draw_cut_corner_box(point1, point2, corner=0.5, color=Color(.564706,.933333,.564706,1), border=None, **kwargs)
Draw a box with the corners cut off.
source code
 
draw_polygon(list_of_points, color=Color(.564706,.933333,.564706,1), border=None, colour=None, **kwargs)
draw_polygon(self, (x1, y1), (x2, y2), (x3, y3), (x4, y4) colour=colors.lightgreen)
source code
 
draw_arrow(point1, point2, color=Color(.564706,.933333,.564706,1), border=None, shaft_height_ratio=0.4, head_length_ratio=0.5, orientation='right', colour=None, **kwargs)
Returns a closed path object representing an arrow enclosed by the box with corners at {point1=(x1,y1), point2=(x2,y2)}, a shaft height given by shaft_height_ratio (relative to box height), a head length given by head_length_ratio (also relative to box height), and an orientation that may be 'left' or 'right'.
source code
 
angle2trig(angle)
o theta Angle in degrees, counter clockwise from horizontal
source code
 
intermediate_points(start, end, graph_data)
o graph_data
source code
Variables [hide private]
  __package__ = 'Bio.Graphics.GenomeDiagram'
Function Details [hide private]

page_sizes(size)

source code 
o size        A string representing a standard page size

Returns a ReportLab pagesize when passed a valid size string

draw_box(point1, point2, color=Color(.564706,.933333,.564706,1), border=None, colour=None, **kwargs)

source code 
draw_box(self, (x1, y1), (x2, y2), (x3, y3), (x4, y4),
      color=colors.lightgreen)

o point1, point2 Co-ordinates for opposite corners of the box
                 (x,y tuples)

o color /colour       The color for the box
                      (colour takes priority over color)

o border              Border color for the box

Returns a closed path object, beginning at (x1,y1) going round
the four points in order, and filling with the passed color.

draw_polygon(list_of_points, color=Color(.564706,.933333,.564706,1), border=None, colour=None, **kwargs)

source code 
draw_polygon(self, (x1, y1), (x2, y2), (x3, y3), (x4, y4)
      colour=colors.lightgreen)

o list_of_point = list of (x,y) tuples for the corner coordinates

o colour              The colour for the box

Returns a closed path object, beginning at (x1,y1) going round
the four points in order, and filling with the passed colour.

angle2trig(angle)

source code 
o theta     Angle in degrees, counter clockwise from horizontal

Returns a representation of the passed angle in a format suitable
for ReportLab rotations (i.e. cos(theta), sin(theta), -sin(theta),
cos(theta) tuple)

intermediate_points(start, end, graph_data)

source code 
o graph_data

o start

o end

Returns a list of (start, end, value) tuples describing the passed
graph data as 'bins' between position midpoints.