biopython v1.71.0 Bio.Graphics.BasicChromosome.ChromosomeSegment

Draw a segment of a chromosome.

This class provides the important configurable functionality of drawing a Chromosome. Each segment has some customization available here, or can be subclassed to define additional functionality. Most of the interesting drawing stuff is likely to happen at the ChromosomeSegment level.

Link to this section Summary

Functions

Initialize a ChromosomeSegment

Add a label to the chromosome segment

Draw the current chromosome segment

Draw any subcomponents of the chromosome segment

Draw any subcomponents of the chromosome segment over the main part

Draw a chromosome segment

Link to this section Functions

Initialize a ChromosomeSegment.

Attributes:

  • start_x_position, end_x_position - Defines the x range we have to draw things in.
  • start_y_position, end_y_position - Defines the y range we have to draw things in.

Configuration Attributes:

  • scale - A scaling value for the component. By default this is set at 1 (ie — has the same scale as everything else). Higher values give more size to the component, smaller values give less.
  • fill_color - A color to fill in the segment with. Colors are available in reportlab.lib.colors
  • label - A label to place on the chromosome segment. This should be a text string specifying what is to be included in the label.
  • label_size - The size of the label.
  • chr_percent - The percentage of area that the chromosome segment takes up.

Add a label to the chromosome segment.

The label will be applied to the right of the segment.

This may be overlapped by any sub-feature labels on other segments!

Link to this function _draw_segment()

Draw the current chromosome segment.

Link to this function _draw_subcomponents()

Draw any subcomponents of the chromosome segment.

This should be overridden in derived classes if there are subcomponents to be drawn.

Link to this function _overdraw_subcomponents()

Draw any subcomponents of the chromosome segment over the main part.

This should be overridden in derived classes if there are subcomponents to be drawn.

Draw a chromosome segment.

Before drawing, the range we are drawing in needs to be set.