Table of Contents

Module: BasicChromosome Bio/Graphics/

Draw representations of organism chromosomes with added information.

These classes are meant to model the drawing of pictures of chromosomes. This can be useful for lots of things, including displaying markers on a chromosome (ie. for genetic mapping) and showing syteny between two chromosomes.

The structure of these classes is intended to be a Composite, so that it will be easy to plug in and switch different parts without breaking the general drawing capabilities of the system. The relationship between classes is that everything derives from _ChromosomeComponent, which specifies the overall interface. The parts then are related so that an Organism contains Chromosomes, and these Chromosomes contain ChromosomeSegments. This representation differents from the canonical composite structure in that we don't really have leaf nodes here -- all components can potentially hold sub-components.

Most of the time the ChromosomeSegment class is what you'll want to customize for specific drawing tasks.

For providing drawing capabilities, these classes use reportlab:

This provides nice output in pdf, which it should be possible to convert to a wide variety of other formats.

There is also the start of support for other formats (such as eps), but it doesn't seem to be quite working right for me yet...

Imported modules   
import os
from import renderPDF, renderPS
from import Drawing, String, Line, Rect, Wedge
from import Widget
from reportlab.lib import colors
from reportlab.lib.pagesizes import letter
from reportlab.lib.units import inch
from reportlab.pdfgen import canvas

Class for drawing a chromosome of an organism.


Draw a segment of a chromosome.


Top level class for drawing chromosomes.


A segment that is located at the end of a linear chromosome.


Base class specifying the interface for a component of the system.

Table of Contents

This document was automatically generated on Mon Jul 1 12:03:12 2002 by HappyDoc version 2.0.1