Пример #1
0
 def _make_activity_graph(self):
     self.activity_graph = networkx.DiGraph()
     for a1, a2 in itertools.combinations(self.activity_types, 2):
         if bio_ontology.isa('INDRA_ACTIVITIES', a1, 'INDRA_ACTIVITIES',
                             a2):
             self.activity_graph.add_edge(a2, a1)
         if bio_ontology.isa('INDRA_ACTIVITIES', a2, 'INDRA_ACTIVITIES',
                             a1):
             self.activity_graph.add_edge(a1, a2)
Пример #2
0
 def isa_cmp(a, b):
     """Compare two entries based on isa relationships for sorting."""
     if not a.startswith('CHEBI:'):
         a = 'CHEBI:%s' % a
     if not b.startswith('CHEBI:'):
         b = 'CHEBI:%s' % b
     if bio_ontology.isa('CHEBI', a, 'CHEBI', b):
         return -1
     if bio_ontology.isa('CHEBI', b, 'CHEBI', a):
         return 1
     return 0
Пример #3
0
def test_erk_isa():
    assert bio_ontology.isa('HGNC', '6871', 'FPLX', 'MAPK')
    assert not bio_ontology.isa('HGNC', '6871', 'FPLX', 'JNK')
Пример #4
0
def test_isa_activity_not():
    assert not bio_ontology.isa('INDRA_ACTIVITIES', 'kinase',
                                'INDRA_ACTIVITIES', 'phosphatase')
Пример #5
0
def test_isa_entity():
    assert bio_ontology.isa('HGNC', '1097', 'FPLX', 'RAF')
Пример #6
0
def test_isa_mod_not():
    assert not bio_ontology.isa('INDRA_MODS', 'phosphorylation', 'INDRA_MODS',
                                'ubiquitination')
Пример #7
0
def test_isa_activity():
    assert bio_ontology.isa('INDRA_ACTIVITIES', 'kinase', 'INDRA_ACTIVITIES',
                            'activity')
Пример #8
0
def test_isa_mod():
    assert bio_ontology.isa('INDRA_MODS', 'phosphorylation', 'INDRA_MODS',
                            'modification')
Пример #9
0
def test_isa_entity3():
    assert not bio_ontology.isa('FPLX', 'RAF', 'HGNC', '1097')
Пример #10
0
def test_chebi_isa():
    assert bio_ontology.isa('CHEBI', 'CHEBI:87307', 'CHEBI', 'CHEBI:36962')
Пример #11
0
def test_isa_entity2():
    assert not bio_ontology.isa('HGNC', '1097', 'HGNC', '646')
Пример #12
0
def test_eccode_isa():
    parents = set(bio_ontology.get_parents('ECCODE', '1.1.1.1'))
    assert parents == {('ECCODE', '1.1.1'), ('ECCODE', '1.1'),
                       ('ECCODE', '1')}, parents
    assert bio_ontology.isa('ECCODE', '1.1.1.1', 'ECCODE', '1.1.1')