Trees | Index | Help |
---|
Package Bio :: Package Graphics :: Module DisplayRepresentation :: Class ChromosomeCounts |
|
Represent a chromosome with count information.
This is used to display information about counts along a chromosome. The segments are expected to have different count information, which will be displayed using a color scheme.
I envision using this class when you think that certain regions of the chromosome will be especially abundant in the counts, and you want to pick those out.Method Summary | |
---|---|
Initialize a representation of chromosome counts. | |
Add counts to the given segment name. | |
Add a label to a specfic segment. | |
Add the collected segment information to a chromosome for drawing. | |
Retrieve the color and label info about the segments. | |
Divide the counts for a segment by some kind of scale value. | |
Set the scale for a specific chromosome segment. |
Method Details |
---|
__init__(self,
segment_names,
color_scheme={(7, 20): Color(1,0,0), (5, 5): Color(1,1,0), (6, 6): Col...)
|
add_count(self, segment_name, count=1)Add counts to the given segment name. Arguments: o segment_name - The name of the segment we should add counts to. If the name is not present, a KeyError will be raised. o count - The counts to add the current segment. This defaults to a single count. |
add_label(self, segment_name, label)Add a label to a specfic segment. Raises a KeyError is the specified segment name is not found. |
fill_chromosome(self, chromosome)Add the collected segment information to a chromosome for drawing. Arguments: o chromosome - A Chromosome graphics object that we can add chromosome segments to. This creates ChromosomeSegment (and TelomereSegment) objects to fill in the chromosome. The information is derived from the label and count information, with counts transformed to the specified color map. Returns the chromosome with all of the segments added. |
get_segment_info(self)Retrieve the color and label info about the segments. Returns a list consiting of two tuples specifying the counts and label name for each segment. The list is ordered according to the original listing of names. Labels are set as None if no label was specified. |
scale_segment_value(self, segment_name, scale_value=None)Divide the counts for a segment by some kind of scale value. This is useful if segments aren't represented by raw counts, but are instead counts divided by some number. |
set_scale(self, segment_name, scale)Set the scale for a specific chromosome segment. By default all segments have the same scale -- this allows scaling by the size of the segment. Raises a KeyError is the specified segment name is not found. |
Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Thu Mar 31 20:15:39 2005 | http://epydoc.sf.net |