Beispiel #1
0
    def test_has_polarity(self):
        g = BELGraph()
        a, b, c = (protein(n(), n()) for _ in range(3))
        key1 = g.add_increases(a, b, n(), n())
        self.assertTrue(has_polarity(g, a, b, key1))

        key2 = g.add_association(b, c, n(), n())
        self.assertFalse(has_polarity(g, b, c, key2))
Beispiel #2
0
    def test_has_polarity(self):
        g = BELGraph()
        a, b, c = (protein(n(), n()) for _ in range(3))
        g.add_increases(a, b, n(), n(), key=0)
        self.assertTrue(has_polarity(g, a.as_tuple(), b.as_tuple(), 0))

        g.add_association(b, c, n(), n(), key=0)
        self.assertFalse(has_polarity(g, b.as_tuple(), c.as_tuple(), 0))
Beispiel #3
0
    def test_has_polarity(self):
        g = BELGraph()

        g.add_edge(1, 2, key=0, relation=INCREASES)
        self.assertTrue(has_polarity(g, 1, 2, 0))

        g.add_edge(2, 3, key=0, relation=ASSOCIATION)
        self.assertFalse(has_polarity(g, 2, 3, 0))
Beispiel #4
0
    def test_has_polarity_dict(self):
        for relation in POLAR_RELATIONS:
            self.assertTrue(has_polarity({RELATION: relation}))

        self.assertFalse(has_polarity({RELATION: ASSOCIATION}))