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

Class AbstractDrawer

source code

object --+
         |
        AbstractDrawer
Known Subclasses:

AbstractDrawer

Provides:

Methods:

o __init__(self, parent, pagesize='A3', orientation='landscape',
         x=0.05, y=0.05, xl=None, xr=None, yt=None, yb=None,
         start=None, end=None, tracklines=0) Called on instantiation

o set_page_size(self, pagesize, orientation)    Set the page size to the
                                            passed size and orientation

o set_margins(self, x, y, xl, xr, yt, yb)   Set the drawable area of the
                                            page

o set_bounds(self, start, end)  Set the bounds for the elements to be
                                drawn

o is_in_bounds(self, value)     Returns a boolean for whether the position
                                is actually to be drawn

o __len__(self)     Returns the length of sequence that will be drawn

Attributes:

o tracklines    Boolean for whether to draw lines dilineating tracks

o pagesize      Tuple describing the size of the page in pixels

o x0            Float X co-ord for leftmost point of drawable area

o xlim          Float X co-ord for rightmost point of drawable area

o y0            Float Y co-ord for lowest point of drawable area

o ylim          Float Y co-ord for topmost point of drawable area

o pagewidth     Float pixel width of drawable area

o pageheight    Float pixel height of drawable area

o xcenter       Float X co-ord of center of drawable area

o ycenter       Float Y co-ord of center of drawable area

o start         Int, base to start drawing from

o end           Int, base to stop drawing at

o length        Size of sequence to be drawn

o cross_track_links List of tuples each with four entries (track A,
                    feature A, track B, feature B) to be linked.

Instance Methods [hide private]
 
__init__(self, parent, pagesize='A3', orientation='landscape', x=0.05, y=0.05, xl=None, xr=None, yt=None, yb=None, start=None, end=None, tracklines=0)
o parent Diagram object containing the data that the drawer draws
source code
 
set_page_size(self, pagesize, orientation)
o pagesize Size of the output image, a tuple of pixels (width, height, or a string in the reportlab.lib.pagesizes set of ISO sizes.
source code
 
set_margins(self, x, y, xl, xr, yt, yb)
o x Float(0->1), Absolute X margin as % of page
source code
 
set_bounds(self, start, end)
o start The first base (or feature mark) to draw from
source code
 
is_in_bounds(self, value)
o value A base position
source code
 
__len__(self)
Returns the length of the region to be drawn
source code
 
_current_track_start_end(self) source code

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, pagesize='A3', orientation='landscape', x=0.05, y=0.05, xl=None, xr=None, yt=None, yb=None, start=None, end=None, tracklines=0)
(Constructor)

source code 
o parent    Diagram object containing the data that the drawer
            draws

o pagesize  String describing the ISO size of the image, or a tuple
            of pixels

o orientation   String describing the required orientation of the
                final drawing ('landscape' or 'portrait')

o x         Float (0->1) describing the relative size of the X
            margins to the page

o y         Float (0->1) describing the relative size of the Y
            margins to the page

o xl        Float (0->1) describing the relative size of the left X
            margin to the page (overrides x)

o xl        Float (0->1) describing the relative size of the left X
            margin to the page (overrides x)

o xr        Float (0->1) describing the relative size of the right X
            margin to the page (overrides x)

o yt        Float (0->1) describing the relative size of the top Y
            margin to the page (overrides y)

o yb        Float (0->1) describing the relative size of the lower Y
            margin to the page (overrides y)

o start     Int, the position to begin drawing the diagram at

o end       Int, the position to stop drawing the diagram at

o tracklines    Boolean flag to show (or not) lines delineating tracks
                on the diagram

o 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_page_size(self, pagesize, orientation)

source code 
o pagesize      Size of the output image, a tuple of pixels (width,
                height, or a string in the reportlab.lib.pagesizes
                set of ISO sizes.

o orientation   String: 'landscape' or 'portrait'

Set the size of the drawing

set_margins(self, x, y, xl, xr, yt, yb)

source code 
o x         Float(0->1), Absolute X margin as % of page

o y         Float(0->1), Absolute Y margin as % of page

o xl        Float(0->1), Left X margin as % of page

o xr        Float(0->1), Right X margin as % of page

o yt        Float(0->1), Top Y margin as % of page

o yb        Float(0->1), Bottom Y margin as % of page

Set the page margins as proportions of the page 0->1, and also
set the page limits x0, y0 and xlim, ylim, and page center
xorigin, yorigin, as well as overall page width and height

set_bounds(self, start, end)

source code 
o start     The first base (or feature mark) to draw from

o end       The last base (or feature mark) to draw to

Sets start and end points for the drawing as a whole

is_in_bounds(self, value)

source code 
o value   A base position

Returns 1 if the value is within the region selected for drawing