Пример #1
0
def test_association():
    st = [Association([Event(Concept('a')), Event(Concept('b'))])]
    ga = GraphAssembler()
    ga.add_statements(st)
    ga.make_model()
    assert len(ga.graph.nodes()) == 2
    assert len(ga.graph.edges()) == 1
Пример #2
0
def test_inactivation():
    st = [Inhibition(Agent('DUSP4'), Agent('MAPK1'))]
    ga = GraphAssembler()
    ga.add_statements(st)
    ga.make_model()
    assert len(ga.graph.nodes()) == 2
    assert len(ga.graph.edges()) == 1
Пример #3
0
def test_influence():
    st = [Influence(Event(Concept('a')), Event(Concept('b')))]
    ga = GraphAssembler()
    ga.add_statements(st)
    ga.make_model()
    assert len(ga.graph.nodes()) == 2
    assert len(ga.graph.edges()) == 1
Пример #4
0
def test_complex():
    st = [Complex([Agent('BRAF'), Agent('RAF1'), Agent('YWAH')])]
    ga = GraphAssembler()
    ga.add_statements(st)
    ga.make_model()
    assert len(ga.graph.nodes()) == 3
    assert len(ga.graph.edges()) == 3
Пример #5
0
def test_phosphorylation():
    st = [Phosphorylation(Agent('MAP2K1'), Agent('MAPK1'))]
    ga = GraphAssembler()
    ga.add_statements(st)
    ga.make_model()
    assert len(ga.graph.nodes()) == 2
    assert len(ga.graph.edges()) == 1
Пример #6
0
def test_dephosphorylation_noenz():
    st = [Dephosphorylation(None, Agent('MAPK1'))]
    ga = GraphAssembler()
    ga.add_statements(st)
    ga.make_model()
    assert len(ga.graph.nodes()) == 0
    assert len(ga.graph.edges()) == 0
Пример #7
0
def test_influence():
    st = [Influence(Concept('a'), Concept('b'))]
    ga = GraphAssembler()
    ga.add_statements(st)
    ga.make_model()
    assert len(ga.graph.nodes()) == 2
    assert len(ga.graph.edges()) == 1
Пример #8
0
def test_get_string():
    st = [Phosphorylation(Agent('MAP2K1'), Agent('MAPK1'))]
    ga = GraphAssembler()
    ga.add_statements(st)
    ga.make_model()
    graph_str = ga.get_string()
    assert graph_str
Пример #9
0
def test_association():
    st = [Association([Event(Concept('a')), Event(Concept('b'))])]
    ga = GraphAssembler()
    ga.add_statements(st)
    ga.make_model()
    assert len(ga.graph.nodes()) == 2
    assert len(ga.graph.edges()) == 1
Пример #10
0
def test_complex():
    st = [Complex([Agent('BRAF'), Agent('RAF1'), Agent('YWAH')])]
    ga = GraphAssembler()
    ga.add_statements(st)
    ga.make_model()
    assert len(ga.graph.nodes()) == 3
    assert len(ga.graph.edges()) == 3
Пример #11
0
def test_get_string():
    st = [Phosphorylation(Agent('MAP2K1'), Agent('MAPK1'))]
    ga = GraphAssembler()
    ga.add_statements(st)
    ga.make_model()
    graph_str = ga.get_string()
    assert graph_str
Пример #12
0
def test_inactivation():
    st = [Inhibition(Agent('DUSP4'), Agent('MAPK1'))]
    ga = GraphAssembler()
    ga.add_statements(st)
    ga.make_model()
    assert len(ga.graph.nodes()) == 2
    assert len(ga.graph.edges()) == 1
Пример #13
0
def test_dephosphorylation_noenz():
    st = [Dephosphorylation(None, Agent('MAPK1'))]
    ga = GraphAssembler()
    ga.add_statements(st)
    ga.make_model()
    assert len(ga.graph.nodes()) == 0
    assert len(ga.graph.edges()) == 0
Пример #14
0
def test_dephosphorylation():
    st = [Dephosphorylation(Agent('DUSP4'), Agent('MAPK1'))]
    ga = GraphAssembler()
    ga.add_statements(st)
    ga.make_model()
    assert len(ga.graph.nodes()) == 2
    assert len(ga.graph.edges()) == 1
Пример #15
0
def test_phosphorylation():
    st = [Phosphorylation(Agent('MAP2K1'), Agent('MAPK1'))]
    ga = GraphAssembler()
    ga.add_statements(st)
    model = ga.make_model()
    assert 'MAP2K1' in model
    assert len(ga.graph.nodes()) == 2
    assert len(ga.graph.edges()) == 1
Пример #16
0
def test_influence():
    # Add an extra standalone event just to make sure it doesn't error
    st = [Influence(Event(Concept('a')), Event(Concept('b'))),
          Event(Concept('a'))]
    ga = GraphAssembler()
    ga.add_statements(st)
    ga.make_model()
    assert len(ga.graph.nodes()) == 2
    assert len(ga.graph.edges()) == 1
Пример #17
0
def test_save_pdf():
    st = [Phosphorylation(Agent('MAP2K1'), Agent('MAPK1'))]
    ga = GraphAssembler()
    ga.add_statements(st)
    ga.make_model()
    ga.save_pdf('/dev/null')
Пример #18
0
def test_save_pdf():
    st = [Phosphorylation(Agent('MAP2K1'), Agent('MAPK1'))]
    ga = GraphAssembler()
    ga.add_statements(st)
    ga.make_model()
    ga.save_pdf('/dev/null')