def testTheoryProbSF(self): assert round(0.66666,3) == round(self.prob_metric.get_metric("a.51.1", "GO:0043227"),3), "wrong probability" assert round(0.5,3) == round(self.prob_metric.get_metric(get_not_id("GO:0043227"),"a.51.1"),3), "wrong probability" assert round(0.0,3) == round(self.prob_metric.get_metric("a.51.1", "GO:0001530"),3), "wrong probability" assert round(1.0,3) == round(self.prob_metric.get_metric(get_not_id("a.51.1"), "all"),3), "wrong probability" assert round(0.25,3) == round(self.prob_metric.get_metric("all", get_not_id("a.51.1")),3), "wrong probability" assert round(1.0,3) == round(self.prob_metric.get_metric("a.51.1","a.51.1"),3), "wrong probability"
def testTheoryProbTerm(self): assert round(1.0,3) == round(self.prob_metric.get_metric("all", "all"),3), "wrong probability" assert round(0.0,3) == round(self.prob_metric.get_metric("all", get_not_id("all")),3), "wrong probability" print "all: ", self.prob_metric.get_metric("all",None) print "all|all: ", self.prob_metric.get_metric("all","all") print "all|notall: ", self.prob_metric.get_metric(get_not_id("all"),"all") assert round(0.0,3) == round(self.prob_metric.get_metric(get_not_id("all"),"all"),3), "wrong probability" assert round(0.25,3) == round(self.prob_metric.get_metric("all", "GO:0043170"),3) , "wrong probability" assert round(0.3333,3) == round(self.prob_metric.get_metric("GO:0008324", "GO:0043170"),3), "wrong probability" assert round(0.0,3) == round(self.prob_metric.get_metric("GO:0000133", "GO:0000135"),3), "wrong probability"
def testBGProbSF(self): #kdrew: P( a.51.1 ) print "P(a.51.1): ", self.prob_metric.get_metric("a.51.1",None) assert (3)/(4+TINY_NUM) == self.prob_metric.get_metric("a.51.1",None), "wrong probability" #kdrew: P( not a.51.1 ) print "not a.51.1: ", self.prob_metric.get_metric(get_not_id("a.51.1"),None) assert 1.0 - (3)/(4+TINY_NUM) == self.prob_metric.get_metric(get_not_id("a.51.1"),None), "wrong probability" #kdrew: P( a.51.1 ) assert (3)/(4+TINY_NUM) == self.prob_metric.get_metric(SuperfamilyEntry(sf_id = "a.51.1"),None), "wrong probability" #kdrew: P( not a.51.1 ) assert 1.0 - (3)/(4+TINY_NUM) == self.prob_metric.get_metric(SuperfamilyEntry(SuperfamilyEntry(sf_id = "a.51.1").get_not_id()),None), "wrong probability"