Beispiel #1
0
 def test_make_subject_match_scorer(self):
     """make_subject_match_scorer should keep ids matching n queries"""
     qm1 = make_subject_match_scorer(1)
     qm3 = make_subject_match_scorer(3)
     qm5 = make_subject_match_scorer(5)
     qmes = wrap_qmes(QMEBlast9(self.rec3))
     self.assertEqualItems(qm1(qmes),
                           ['ece:Z4181', 'ece:Z4182', 'ece:Z4183'])
     self.assertEqualItems(qm3(qmes), ['ece:Z4181', 'ece:Z4183'])
     self.assertEqualItems(qm5(qmes), [])
Beispiel #2
0
 def test_QMEBlast9(self):
     """QMEBlast9 should return expected lines from all iterations"""
     self.assertFloatEqual(QMEBlast9(self.rec3), [\
             ('ece:Z4181','ece:Z4181',3e-47),
             ('ece:Z4181','ecs:ECs3717',3e-47),
             ('ece:Z4181','spt:SPA2730', 1e-5),
             ('ece:Z4181','ecs:ECs3717',3e-54),  #WARNING: allows duplicates
             ('ece:Z4181','cvi:CV2421',2e-8),
             ('ece:Z4182','ece:Z4182',3e-47),
             ('ece:Z4182','cvi:CV2422',2e-6),
             ])
Beispiel #3
0
 def test_make_shotgun_scorer(self):
     """make_shotgun_scorer should keep ids matching n queries"""
     sg1 = make_shotgun_scorer(1)
     sg2 = make_shotgun_scorer(2)
     sg3 = make_shotgun_scorer(3)
     sg4 = make_shotgun_scorer(4)
     sg5 = make_shotgun_scorer(5)
     qmes = wrap_qmes(QMEBlast9(self.rec3))
     self.assertEqualItems(sg1(qmes), keep_everything_scorer(qmes))
     self.assertEqualItems(sg2(qmes), \
         ['ece:Z4181','ece:Z4182','ece:Z4183','cvi:CV2421','ecs:ECs3717'])
     self.assertEqualItems(sg3(qmes), \
         ['ece:Z4181','ece:Z4182','ece:Z4183'])
     self.assertEqualItems(sg4(qmes), \
         ['ece:Z4182'])
     self.assertEqualItems(sg5(qmes), [])
Beispiel #4
0
 def test_keep_everything_scorer(self):
     """keep_everything_scorer should keep all ids found."""
     k = keep_everything_scorer(wrap_qmes(QMEBlast9(self.rec2)))
     self.assertEqualItems(k, \
         ['ece:Z4181','ecs:ECs3717','spt:SPA2730','cvi:CV2421','ece:Z4182'])