Ejemplo n.º 1
0
    def test_pipeline_2(self):
        graph = egf_graph.copy()

        network = self.manager.insert_graph(graph)
        network_id = network.id

        query = Query(network_ids=[network_id])
        query.append_seeding_neighbors(vcp)
        query.append_pipeline(get_subgraph_by_annotation_value, 'Species', '9606')

        result = query.run(self.manager)
        self.assertIsNotNone(result, msg='Query returned none')

        self.assertEqual(3, result.number_of_nodes())
Ejemplo n.º 2
0
    def test_seeding_with_pipeline(self):
        test_network_1 = self.manager.insert_graph(sialic_acid_graph.copy())

        query = Query(network_ids=[test_network_1.id])
        query.append_seeding_neighbors([trem2, dap12, shp2])
        query.append_pipeline(expand_nodes_neighborhoods, [trem2, dap12, shp2])
        result = query.run(self.manager)
        self.assertIsNotNone(result, msg='Query returned none')
        self.assertIsInstance(result, BELGraph)

        self.assertIn(trem2, result)
        self.assertIn(dap12, result)
        self.assertIn(shp2, result)
        self.assertIn(syk, result)
        self.assertIn(cd33_phosphorylated, result)

        self.assertEqual(5, result.number_of_nodes())
        self.assertEqual(4, result.number_of_edges())
Ejemplo n.º 3
0
    def test_query_multiple_networks(self):
        sialic_acid_graph_id = self.manager.insert_graph(sialic_acid_graph.copy()).id
        egf_graph_id = self.manager.insert_graph(egf_graph.copy()).id

        query = Query()
        query.append_network(sialic_acid_graph_id)
        query.append_network(egf_graph_id)
        query.append_seeding_neighbors([syk])
        query.append_pipeline(enrich_protein_and_rna_origins)

        result = query.run(self.manager)
        self.assertIsNotNone(result, msg='Query returned none')

        self.assertIn(shp1, result)
        self.assertIn(shp2, result)
        self.assertIn(trem2, result)
        self.assertIn(dap12, result)

        self.assertEqual(15, result.number_of_nodes())
        self.assertEqual(14, result.number_of_edges())