Package Bio :: Package Graphics :: Package GenomeDiagram :: Module _CircularDrawer :: Class CircularDrawer
[hide private]
[frames] | no frames]

Class CircularDrawer

source code

                    object --+    
                             |    
_AbstractDrawer.AbstractDrawer --+
                                 |
                                CircularDrawer

Object for drawing circular diagrams.

Attributes:
Instance Methods [hide private]
 
__init__(self, parent=None, pagesize='A3', orientation='landscape', x=0.05, y=0.05, xl=None, xr=None, yt=None, yb=None, start=None, end=None, tracklines=0, track_size=0.75, circular=1, circle_core=0.0, cross_track_links=None)
Create CircularDrawer object.
source code
 
set_track_heights(self)
Initialize track heights.
source code
 
draw(self)
Draw a circular diagram of the stored data.
source code
 
draw_track(self, track)
Return list of track elements and list of track labels.
source code
 
draw_feature_set(self, set)
Return list of feature elements and list of labels for them.
source code
 
draw_feature(self, feature)
Return list of feature elements and list of labels for them.
source code
 
get_feature_sigil(self, feature, locstart, locend, **kwargs)
Return graphics for feature, and any required label for it.
source code
 
draw_cross_link(self, cross_link)
Draw a cross-link between features.
source code
 
draw_graph_set(self, set)
Return list of graph elements and list of their labels.
source code
 
draw_line_graph(self, graph)
Return line graph as list of drawable elements.
source code
 
draw_bar_graph(self, graph)
Return list of drawable elements for a bar graph.
source code
 
draw_heat_graph(self, graph)
Return list of drawable elements for the heat graph.
source code
 
draw_scale(self, track)
Return list of elements in the scale and list of their labels.
source code
 
draw_tick(self, tickpos, ctr, ticklen, track, draw_label)
Return drawing element for a tick on the scale.
source code
 
draw_test_tracks(self)
Draw blue test tracks with grene line down their center.
source code
 
draw_greytrack(self, track)
Drawing element for grey background to passed Track object.
source code
 
canvas_angle(self, base)
Given base-pair position, return (angle, cosine, sin).
source code
 
_draw_sigil_box(self, bottom, center, top, startangle, endangle, strand, **kwargs)
Draw BOX sigil.
source code
 
_draw_arc(self, inner_radius, outer_radius, startangle, endangle, color, border=None, colour=None, **kwargs)
Return closed path describing an arc box.
source code
 
_draw_arc_line(self, path, start_radius, end_radius, start_angle, end_angle, move=False)
Add a list of points to a path object.
source code
 
_draw_arc_poly(self, inner_radius, outer_radius, inner_startangle, inner_endangle, outer_startangle, outer_endangle, color, border=None, flip=False, **kwargs)
Return polygon path describing an arc.
source code
 
_draw_sigil_cut_corner_box(self, bottom, center, top, startangle, endangle, strand, color, border=None, corner=0.5, **kwargs)
Draw OCTO sigil, box with corners cut off.
source code
 
_draw_sigil_arrow(self, bottom, center, top, startangle, endangle, strand, **kwargs)
Draw ARROW sigil.
source code
 
_draw_sigil_big_arrow(self, bottom, center, top, startangle, endangle, strand, **kwargs)
Draw BIGARROW sigil, like ARROW but straddles the axis.
source code
 
_draw_arc_arrow(self, inner_radius, outer_radius, startangle, endangle, color, border=None, shaft_height_ratio=0.4, head_length_ratio=0.5, orientation='right', colour=None, **kwargs)
Draw an arrow along an arc.
source code
 
_draw_sigil_jaggy(self, bottom, center, top, startangle, endangle, strand, color, border=None, **kwargs)
Draw JAGGY sigil.
source code

Inherited from _AbstractDrawer.AbstractDrawer: __len__, is_in_bounds, set_bounds, set_margins, set_page_size

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, parent=None, pagesize='A3', orientation='landscape', x=0.05, y=0.05, xl=None, xr=None, yt=None, yb=None, start=None, end=None, tracklines=0, track_size=0.75, circular=1, circle_core=0.0, cross_track_links=None)
(Constructor)

source code 

Create CircularDrawer object.

Arguments:
  • parent Diagram object containing the data that the drawer draws
  • pagesize String describing the ISO size of the image, or a tuple of pixels
  • orientation String describing the required orientation of the final drawing ('landscape' or 'portrait')
  • x Float (0->1) describing the relative size of the X margins to the page
  • y Float (0->1) describing the relative size of the Y margins to the page
  • xl Float (0->1) describing the relative size of the left X margin to the page (overrides x)
  • xl Float (0->1) describing the relative size of the left X margin to the page (overrides x)
  • xr Float (0->1) describing the relative size of the right X margin to the page (overrides x)
  • yt Float (0->1) describing the relative size of the top Y margin to the page (overrides y)
  • yb Float (0->1) describing the relative size of the lower Y margin to the page (overrides y)
  • start Int, the position to begin drawing the diagram at
  • end Int, the position to stop drawing the diagram at
  • tracklines Boolean flag to show (or not) lines delineating tracks on the diagram
  • track_size The proportion of the available track height that should be taken up in drawing
  • circular Boolean flaw to show whether the passed sequence is circular or not
  • circle_core The proportion of the available radius to leave empty at the center of a circular diagram (0 to 1).
  • cross_track_links List of tuples each with four entries (track A, feature A, track B, feature B) to be linked.
Overrides: object.__init__

set_track_heights(self)

source code 

Initialize track heights.

Since tracks may not be of identical heights, the bottom and top radius for each track is stored in a dictionary - self.track_radii, keyed by track number

get_feature_sigil(self, feature, locstart, locend, **kwargs)

source code 

Return graphics for feature, and any required label for it.

Arguments:
  • feature Feature object
  • locstart The start position of the feature
  • locend The end position of the feature

draw_graph_set(self, set)

source code 

Return list of graph elements and list of their labels.

Arguments:
  • set GraphSet object

draw_line_graph(self, graph)

source code 

Return line graph as list of drawable elements.

Arguments:
  • graph GraphData object

draw_bar_graph(self, graph)

source code 

Return list of drawable elements for a bar graph.

Arguments:
  • graph Graph object

draw_heat_graph(self, graph)

source code 

Return list of drawable elements for the heat graph.

Arguments:
  • graph Graph object

draw_scale(self, track)

source code 

Return list of elements in the scale and list of their labels.

Arguments:
  • track Track object

draw_tick(self, tickpos, ctr, ticklen, track, draw_label)

source code 

Return drawing element for a tick on the scale.

Arguments:
  • tickpos Int, position of the tick on the sequence
  • ctr Float, Y co-ord of the center of the track
  • ticklen How long to draw the tick
  • track Track, the track the tick is drawn on
  • draw_label Boolean, write the tick label?

_draw_arc(self, inner_radius, outer_radius, startangle, endangle, color, border=None, colour=None, **kwargs)

source code 

Return closed path describing an arc box.

Arguments:
  • inner_radius Float distance of inside of arc from drawing center
  • outer_radius Float distance of outside of arc from drawing center
  • startangle Float angle subtended by start of arc at drawing center (in radians)
  • endangle Float angle subtended by end of arc at drawing center (in radians)
  • color colors.Color object for arc (overridden by backwards compatible argument with UK spelling, colour).

Returns a closed path object describing an arced box corresponding to the passed values. For very small angles, a simple four sided polygon is used.

_draw_arc_line(self, path, start_radius, end_radius, start_angle, end_angle, move=False)

source code 

Add a list of points to a path object.

Assumes angles given are in degrees!

Represents what would be a straight line on a linear diagram.

_draw_sigil_jaggy(self, bottom, center, top, startangle, endangle, strand, color, border=None, **kwargs)

source code 

Draw JAGGY sigil.

Although we may in future expose the head/tail jaggy lengths, for now both the left and right edges are drawn jagged.