Back to index

python-biopython  1.60
Public Member Functions | Private Attributes
Bio.Graphics.BasicChromosome._ChromosomeComponent Class Reference
Inheritance diagram for Bio.Graphics.BasicChromosome._ChromosomeComponent:
Inheritance graph
[legend]
Collaboration diagram for Bio.Graphics.BasicChromosome._ChromosomeComponent:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def add
def remove
def draw

Private Attributes

 _sub_components

Detailed Description

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

This class should not be instantiated directly, but should be used
from derived classes.

Definition at line 46 of file BasicChromosome.py.


Constructor & Destructor Documentation

Initialize a chromosome component.

Attributes:

o _sub_components -- Any components which are contained under
this parent component. This attribute should be accessed through
the add() and remove() functions.

Reimplemented in Bio.Graphics.BasicChromosome.ChromosomeSegment.

Definition at line 52 of file BasicChromosome.py.

00052 
00053     def __init__(self):
00054         """Initialize a chromosome component.
00055 
00056         Attributes:
00057 
00058         o _sub_components -- Any components which are contained under
00059         this parent component. This attribute should be accessed through
00060         the add() and remove() functions.
00061         """
00062         self._sub_components = []

Here is the caller graph for this function:


Member Function Documentation

Add a sub_component to the list of components under this item.

Definition at line 63 of file BasicChromosome.py.

00063 
00064     def add(self, component):
00065         """Add a sub_component to the list of components under this item.
00066         """
00067         assert isinstance(component, _ChromosomeComponent), \
00068                "Expected a _ChromosomeComponent object, got %s" % component
00069         
00070         self._sub_components.append(component)

Here is the caller graph for this function:

Draw the specified component.

Definition at line 83 of file BasicChromosome.py.

00083 
00084     def draw(self):
00085         """Draw the specified component.
00086         """
        raise AssertionError("Subclasses must implement.")
Remove the specified component from the subcomponents.

Raises a ValueError if the component is not registered as a
sub_component.

Definition at line 71 of file BasicChromosome.py.

00071 
00072     def remove(self, component):
00073         """Remove the specified component from the subcomponents.
00074 
00075         Raises a ValueError if the component is not registered as a
00076         sub_component.
00077         """
00078         try:
00079             self._sub_components.remove(component)
00080         except ValueError:
00081             raise ValueError("Component %s not found in sub_components." %
00082                              component)


Member Data Documentation

Definition at line 61 of file BasicChromosome.py.


The documentation for this class was generated from the following file: