Example #1
0
    def test_update_counter_from_dictionaries(self):
#        start with empty dictionary
        new_Blast = RunBlast(records=self.record_index, e_value=self.e_threshold,
            wdir=self.Blast_dir, outfile="BlastOut")

        expected = dict({"GO:01": 1,
                         "GO:03": 2,
                         "GO:04": 2,
                         "GO:05": 1, })
        new_dict = new_Blast.init_dict(self.template_set_small, 0)
        new_Blast.update_counter_from_dictionaries(new_dict, self.template_set_small)
#        print(new_dict)
        self.assertEqual(expected, new_dict)


        expected = dict({"GO:01": 3,
                         "GO:02": 1,
                         "GO:03": 2,
                         "GO:04": 2,
                         "GO:05": 2,
                         "GO:06": 1,
                         "GO:07": 1})
        new_dict = new_Blast.init_dict(self.template_set, 0)
        new_Blast.update_counter_from_dictionaries(new_dict, self.template_set)

        self.assertEqual(expected, new_dict)
Example #2
0
    def test_init_dict(self):  # allterms, default_value=0)
        expected = dict({"GO:01": 0,
                         "GO:03": 0,
                         "GO:04": 0,
                         "GO:05": 0,
                         })

        new_dict = RunBlast(records=self.record_index, e_value=self.e_threshold,
            wdir=self.Blast_dir, outfile="BlastOut")
        default_dict = new_dict.init_dict(self.template_set_small, 0)
        self.assertEqual(expected, default_dict)