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.assertItemsEqual(sg1(qmes), keep_everything_scorer(qmes)) self.assertItemsEqual(sg2(qmes), \ ['ece:Z4181','ece:Z4182','ece:Z4183','cvi:CV2421','ecs:ECs3717']) self.assertItemsEqual(sg3(qmes), \ ['ece:Z4181','ece:Z4182','ece:Z4183']) self.assertItemsEqual(sg4(qmes), \ ['ece:Z4182']) self.assertItemsEqual(sg5(qmes), [])
def test_keep_everything_scorer(self): """keep_everything_scorer should keep all ids found.""" k = keep_everything_scorer(wrap_qmes(QMEBlast9(self.rec2))) self.assertItemsEqual(k, \ ['ece:Z4181','ecs:ECs3717','spt:SPA2730','cvi:CV2421','ece:Z4182'])