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

def Bio::Graphics::BasicChromosome::Organism::draw (   self,
  output_file,
  title 
)

Draw out the information for the Organism.

Arguments:

o output_file -- The name of a file specifying where the pdf
document drawn should be saved.

o title -- The output title of the produced document.

Definition at line 110 of file BasicChromosome.py.

00110                                       :
        """Draw out the information for the Organism.

        Arguments:

        o output_file -- The name of a file specifying where the pdf
        document drawn should be saved.

        o title -- The output title of the produced document.
        """
        width, height = self.page_size
        cur_drawing = Drawing(width, height)

        self._draw_title(cur_drawing, title, width, height)

        cur_x_pos = inch * .5
        if len(self._sub_components) > 0:
            x_pos_change = (width - inch) / len(self._sub_components)
        # no sub_components
        else:
            pass
        
        for sub_component in self._sub_components:
            # set the drawing location of the chromosome
            sub_component.start_x_position = cur_x_pos
            sub_component.end_x_position = cur_x_pos + .9 * x_pos_change
            sub_component.start_y_position = height - 1.5 * inch
            sub_component.end_y_position = 3 * inch

            # do the drawing
            sub_component.draw(cur_drawing)

            # update the locations for the next chromosome
            cur_x_pos += x_pos_change

        self._draw_legend(cur_drawing, 2.5 * inch, width)

        if self.output_format == 'pdf':
            out_canvas = canvas.Canvas(output_file, pagesize = self.page_size)
            renderPDF.draw(cur_drawing, out_canvas, 0, 0)
            out_canvas.showPage()
            out_canvas.save()
        elif self.output_format == 'eps':
            renderPS.drawToFile(cur_drawing, output_file)
        else:
            raise ValueError("Invalid output format %s" % self.output_format)

    def _draw_title(self, cur_drawing, title, width, height):


Generated by  Doxygen 1.6.0   Back to index