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

def test_GraphicsChromosome::OrganismGraphicTest::test_random_organism (   self )
Generate an organism with random chromosome info.

Definition at line 202 of file test_GraphicsChromosome.py.

        """Generate an organism with random chromosome info.
        random_file = os.path.join("Graphics", "random_organism.pdf")
        pdf_organism = BasicChromosome.Organism()

        all_segs = []
        all_chrs = []
        num_chrs = random.randrange(1, 15)
        for chr_name in range(num_chrs):
            cur_chromosome, num_segs = load_random_chromosome(str(chr_name))

        # scale all of the chromosomes by the maximum number of segments
        max_segs = max(all_segs)
        for chr in all_chrs:
            chr.scale_num = max_segs

        pdf_organism.draw(random_file, "Randomly generated Organism")

Generated by  Doxygen 1.6.0   Back to index