def test_mixed_2(self):
        """Tests both subject and object activity with location information as well."""
        self.graph.add_directly_increases(
            Protein(namespace='HGNC', name='HDAC4'),
            Protein(namespace='HGNC', name='MEF2A'),
            citation='10487761',
            evidence=
            """"In the nucleus, HDAC4 associates with the myocyte enhancer factor MEF2A. Binding of HDAC4 to
        MEF2A results in the repression of MEF2A transcriptional activation, a function that requires the
        deacetylase domain of HDAC4.""",
            annotations={'Species': '9606'},
            source_modifier=activity('cat',
                                     location=Entity(namespace='GO',
                                                     name='nucleus')),
            target_modifier=activity('tscript',
                                     location=Entity(namespace='GO',
                                                     name='nucleus')))

        make_dummy_namespaces(self.manager, self.graph)
        make_dummy_annotations(self.manager, self.graph)

        network = self.manager.insert_graph(self.graph)
        self.assertEqual(2, network.nodes.count())
        self.assertEqual(1, network.edges.count())

        edge = network.edges.first()
    def test_mixed_1(self):
        """Test mixed having location and something else."""
        self.graph.add_increases(
            Protein(namespace='HGNC', name='CDC42'),
            Protein(namespace='HGNC', name='PAK2'),
            evidence=
            """Summary: PAK proteins, a family of serine/threonine p21-activating kinases, include PAK1, PAK2,
         PAK3 and PAK4. PAK proteins are critical effectors that link Rho GTPases to cytoskeleton reorganization
         and nuclear signaling. They serve as targets for the small GTP binding proteins Cdc42 and Rac and have
         been implicated in a wide range of biological activities. PAK4 interacts specifically with the GTP-bound
         form of Cdc42Hs and weakly activates the JNK family of MAP kinases. PAK4 is a mediator of filopodia
         formation and may play a role in the reorganization of the actin cytoskeleton. Multiple alternatively
         spliced transcript variants encoding distinct isoforms have been found for this gene.""",
            citation={
                NAMESPACE: "Online Resource",
                IDENTIFIER: "PAK4 Hs ENTREZ Gene Summary"
            },
            annotations={'Species': '9606'},
            source_modifier=activity('gtp'),
            target_modifier=activity('kin'),
        )

        make_dummy_namespaces(self.manager, self.graph)
        make_dummy_annotations(self.manager, self.graph)

        network = self.manager.insert_graph(self.graph)
        self.assertEqual(2, network.nodes.count())
        self.assertEqual(1, network.edges.count())

        edge = network.edges.first()
    def setUp(self):
        super(TestQuery, self).setUp()

        graph = BELGraph(name='test', version='0.0.0')
        graph.annotation_list['TEST'] = {'a', 'b', 'c'}

        graph.add_increases(fos,
                            jun,
                            evidence=test_evidence_text,
                            citation=test_citation_dict,
                            annotations={'TEST': 'a'})

        make_dummy_namespaces(self.manager, graph)
        make_dummy_annotations(self.manager, graph)

        with mock_bel_resources:
            self.manager.insert_graph(graph)
Beispiel #4
0
    def test_simple(self, mock):
        """This test checks that the network can be added and dropped"""
        graph = BELGraph(name='test', version='0.0.0')
        graph.add_increases(yfg1,
                            yfg2,
                            evidence=test_evidence_text,
                            citation=test_citation_dict,
                            annotations={
                                'Disease': {
                                    'Disease1': True
                                },
                                'Cell': {
                                    'Cell1': True
                                }
                            })

        make_dummy_namespaces(self.manager, graph)
        make_dummy_annotations(self.manager, graph)

        network = self.manager.insert_graph(graph, store_parts=True)

        self.manager.drop_network_by_id(network.id)