def test_sample_contig2(self):
     s_set = SampleSetting("genomes",1000,\
                               1200,1200,\
                               False)
     dir = os.path.dirname(__file__)
     dna_file = os.path.join(dir,"fixtures/8M_genome.fna")
     genome_seq = list(SeqIO.parse(dna_file, "fasta"))
     genome = dna.DNA(id="test01", seq=str(genome_seq[0].seq))
     contig = sample_contig(genome,s_set,1)
     assert_equal(len(contig.full_seq),1200)
     assert_equal(contig.id, 'test01 contig')
예제 #2
0
    def test_genome(self, genome_index):
        score_objs = []
        i = 0
        genome = self.group.genomes[genome_index]
        while i < self.count_per_g[genome_index]:
            c = sample_contig(genome, self.x_st, self.id_gen.id())
            c.calculate_signature()
            new_par = par_subtraction(copy(genome.signature),c) 

            score_obj = score_contig(c, new_par, genome, genome_index, self)
            score_objs.append(score_obj)
            i+=1
        return score_objs