Bio.Graphics.Distribution module

Display information distributed across a Chromosome-like object.

These classes are meant to show the distribution of some kind of information as it changes across any kind of segment. It was designed with chromosome distributions in mind, but could also work for chromosome regions, BAC clones or anything similar.

Reportlab is used for producing the graphical output.

class Bio.Graphics.Distribution.DistributionPage(output_format='pdf')

Bases: object

Display a grouping of distributions on a page.

This organizes Distributions, and will display them nicely on a single page.

__init__(output_format='pdf')

Initialize the class.

draw(output_file, title)

Draw out the distribution information.

Arguments:
  • output_file - The name of the file to output the information to, or a handle to write to.

  • title - A title to display on the graphic.

class Bio.Graphics.Distribution.BarChartDistribution(display_info=None)

Bases: object

Display the distribution of values as a bunch of bars.

__init__(display_info=None)

Initialize a Bar Chart display of distribution info.

Attributes:
  • display_info - the information to be displayed in the distribution. This should be ordered as a list of lists, where each internal list is a data set to display in the bar chart.

draw(cur_drawing, start_x, start_y, end_x, end_y)

Draw a bar chart with the info in the specified range.

class Bio.Graphics.Distribution.LineDistribution

Bases: object

Display the distribution of values as connected lines.

This distribution displays the change in values across the object as lines. This also allows multiple distributions to be displayed on a single graph.

__init__()

Initialize the class.

draw(cur_drawing, start_x, start_y, end_x, end_y)

Draw a line distribution into the current drawing.