Package Bio :: Package Graphics :: Module BasicChromosome :: Class Chromosome
[hide private]
[frames] | no frames]

Class Chromosome

source code

         reportlab.graphics.widgetbase.PropHolder --+        
                                                    |        
reportlab.graphics.shapes._DrawTimeResizeable --+   |        
                                                |   |        
               reportlab.graphics.shapes.UserNode --+        
                                                    |        
                 reportlab.graphics.widgetbase.Widget --+    
                                                        |    
                                     _ChromosomeComponent --+
                                                            |
                                                           Chromosome

Class for drawing a chromosome of an organism.

This organizes the drawing of a single organisms chromosome. This
class can be instantiated directly, but the draw method makes the
most sense to be called in the context of an organism.

Instance Methods [hide private]
 
__init__(self, chromosome_name)
Initialize a Chromosome for drawing.
source code
 
subcomponent_size(self)
Return the scaled size of all subcomponents of this component.
source code
 
draw(self, cur_drawing)
Draw a chromosome on the specified template.
source code
 
_draw_label(self, cur_drawing, label_name)
Draw a label for the chromosome.
source code
 
_draw_labels(self, cur_drawing, left_labels, right_labels)
Layout and draw sub-feature labels for the chromosome.
source code

Inherited from _ChromosomeComponent: add, remove

Inherited from reportlab.graphics.widgetbase.Widget: demo, getBounds, provideNode

Inherited from reportlab.graphics.widgetbase.Widget (private): _setKeywords

Inherited from reportlab.graphics.widgetbase.PropHolder: __setattr__, dumpProperties, getProperties, setProperties, verify

Inherited from reportlab.graphics.shapes._DrawTimeResizeable (private): _drawTimeResize

Class Variables [hide private]

Inherited from reportlab.graphics.widgetbase.PropHolder (private): _attrMap

Method Details [hide private]

__init__(self, chromosome_name)
(Constructor)

source code 
Initialize a Chromosome for drawing.

Arguments:

o chromosome_name - The label for the chromosome.

Attributes:

o start_x_position, end_x_position - The x positions on the page
where the chromosome should be drawn. This allows multiple
chromosomes to be drawn on a single page.

o start_y_position, end_y_position - The y positions on the page
where the chromosome should be contained.

Configuration Attributes:

o title_size - The size of the chromosome title.

o scale_num - A number of scale the drawing by. This is useful if
you want to draw multiple chromosomes of different sizes at the
same scale. If this is not set, then the chromosome drawing will
be scaled by the number of segements in the chromosome (so each
chromosome will be the exact same final size).

Overrides: _ChromosomeComponent.__init__

draw(self, cur_drawing)

source code 
Draw a chromosome on the specified template.

Ideally, the x_position and y_*_position attributes should be
set prior to drawing -- otherwise we're going to have some problems.

Overrides: reportlab.graphics.widgetbase.Widget.draw

_draw_labels(self, cur_drawing, left_labels, right_labels)

source code 
Layout and draw sub-feature labels for the chromosome.

Tries to place each label at the same vertical position as the
feature it applies to, but will adjust the positions to avoid or
at least reduce label overlap.

Draws the label text and a coloured line linking it to the
location (i.e. feature) it applies to.