Logo Search packages:      
Sourcecode: python-biopython version File versions

def Bio::Graphics::DisplayRepresentation::ChromosomeCounts::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.

Definition at line 126 of file DisplayRepresentation.py.

00126                                          :
        """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.
        """
        for seg_num in range(len(self._names)):
            is_end_segment = 0
            # make the top and bottom telomeres
            if seg_num == 0:
                cur_segment = TelomereSegment()
                is_end_segment = 1
            elif seg_num == len(self._names) - 1:
                cur_segment = TelomereSegment(1)
                is_end_segment = 1
            # otherwise, they are just regular segments
            else:
                cur_segment = ChromosomeSegment()

            seg_name = self._names[seg_num]
            if self._count_info[seg_name] > 0:
                color = self._color_from_count(self._count_info[seg_name])
                cur_segment.fill_color = color
            
            if self._label_info[seg_name] is not None:
                cur_segment.label = self._label_info[seg_name]

            # give end segments extra size so they look right
            if is_end_segment:
                cur_segment.scale = 3
            else:
                cur_segment.scale = self._scale_info[seg_name]

            chromosome.add(cur_segment)

        return chromosome

    def _color_from_count(self, count):


Generated by  Doxygen 1.6.0   Back to index