Esempio n. 1
0
    def test_seed_by_neighbors(self):
        node = self.manager.get_node_by_dict(shp2)
        edges = self.manager.query_neighbors([node])
        self.assertEqual(2, len(edges))

        graph = graph_from_edges(edges)

        self.assertEqual(4,
                         graph.number_of_nodes(),
                         msg='Nodes: {}'.format(graph.nodes()))

        self.assertTrue(graph.has_node_with_data(cd33_phosphorylated))
        self.assertTrue(graph.has_node_with_data(cd33))
        self.assertTrue(graph.has_node_with_data(syk))
        self.assertTrue(graph.has_node_with_data(shp2))

        self.assertEqual(3, graph.number_of_edges())
Esempio n. 2
0
    def test_seed_by_neighbors(self):
        """Test seeding a graph by neighbors of a list of nodes."""
        node = self.manager.get_node_by_dsl(shp2)
        edges = self.manager.query_neighbors([node])
        self.assertEqual(2, len(edges))

        graph = graph_from_edges(edges)

        self.assertEqual(4,
                         graph.number_of_nodes(),
                         msg='Nodes: {}'.format(graph.nodes()))

        self.assertIn(cd33_phosphorylated, graph)
        self.assertIn(cd33, graph)
        self.assertIn(syk, graph)
        self.assertIn(shp2, graph)

        self.assertEqual(3, graph.number_of_edges())
Esempio n. 3
0
    def test_seed_by_neighbors(self):
        """Test seeding a graph by neighbors of a list of nodes."""
        shp2_model = self.manager.get_node_by_dsl(shp2)
        self.assertIsNotNone(shp2_model)

        edges = self.manager.query_neighbors([shp2_model])
        self.assertEqual(2, len(edges))

        graph = graph_from_edges(edges)
        self.assertEqual(3, graph.number_of_edges())

        self.assertEqual(4, graph.number_of_nodes())

        self.assertIn(cd33_phosphorylated, graph)
        self.assertIn(cd33, graph)
        self.assertIn(syk, graph)
        self.assertIn(shp2, graph)

        self.assertEqual(3, graph.number_of_edges())
Esempio n. 4
0
    def test_seed_by_induction(self):
        shp2_model = self.manager.get_node_by_dict(shp2)
        syk_model = self.manager.get_node_by_dict(syk)
        trem2_model = self.manager.get_node_by_dict(trem2)

        edges = self.manager.query_induction(
            [shp2_model, syk_model, trem2_model])
        self.assertEqual(2, len(edges))

        graph = graph_from_edges(edges)

        self.assertEqual(3,
                         graph.number_of_nodes(),
                         msg='Nodes: {}'.format(graph.nodes()))

        self.assertTrue(graph.has_node_with_data(trem2))
        self.assertTrue(graph.has_node_with_data(syk))
        self.assertTrue(graph.has_node_with_data(shp2))

        self.assertEqual(2, graph.number_of_edges())
Esempio n. 5
0
    def test_seed_by_induction(self):
        """Test seeding by inducing over a list of nodes."""
        shp2_model = self.manager.get_node_by_dsl(shp2)
        syk_model = self.manager.get_node_by_dsl(syk)
        trem2_model = self.manager.get_node_by_dsl(trem2)

        edges = self.manager.query_induction(
            [shp2_model, syk_model, trem2_model])
        self.assertEqual(2, len(edges))

        graph = graph_from_edges(edges)

        self.assertEqual(3,
                         graph.number_of_nodes(),
                         msg='Nodes: {}'.format(graph.nodes()))

        self.assertIn(trem2, graph)
        self.assertIn(syk, graph)
        self.assertIn(shp2, graph)

        self.assertEqual(2, graph.number_of_edges())