Пример #1
0
def test_translocation():
    st1 = Translocation(Agent('FOXO3A'))
    st2 = Translocation(Agent('FOXO3A'), 'cytoplasm')
    st3 = Translocation(Agent('FOXO3A'), None, 'nucleus')
    st4 = Translocation(Agent('FOXO3A'), 'cytoplasm', 'nucleus')
    e = ea.EnglishAssembler()
    e.add_statements([st1])
    s = e.make_model()
    assert s == 'FOXO3A translocates.'
    assert _substring_by_coords(s, e.stmt_agents[0][0].coords) == 'FOXO3A'
    e = ea.EnglishAssembler()
    e.add_statements([st2])
    s = e.make_model()
    assert s == 'FOXO3A translocates from the cytoplasm.'
    assert _substring_by_coords(s, e.stmt_agents[0][0].coords) == 'FOXO3A'
    e = ea.EnglishAssembler()
    e.add_statements([st3])
    s = e.make_model()
    assert s == 'FOXO3A translocates to the nucleus.'
    assert _substring_by_coords(s, e.stmt_agents[0][0].coords) == 'FOXO3A'
    e = ea.EnglishAssembler()
    e.add_statements([st4])
    s = e.make_model()
    assert s == 'FOXO3A translocates from the cytoplasm to the nucleus.'
    assert _substring_by_coords(s, e.stmt_agents[0][0].coords) == 'FOXO3A'
Пример #2
0
def test_agent_activity_stmt():
    braf = Agent('BRAF', activity=ActivityCondition('activity', True))
    mek = Agent('MAP2K1')
    st = Activation(braf, mek)
    e = ea.EnglishAssembler()
    e.add_statements([st])
    s = e.make_model()
    print(s)
    assert s == 'Active BRAF activates MAP2K1.'
Пример #3
0
def test_agent_activity_stmt():
    braf = Agent('BRAF', activity=ActivityCondition('activity', True))
    mek = Agent('MAP2K1')
    st = Activation(braf, mek)
    e = ea.EnglishAssembler()
    e.add_statements([st])
    s = e.make_model()
    print(s)
    assert s == 'Active BRAF activates MAP2K1.'
    assert _substring_by_coords(s, e.stmt_agents[0][0].coords) == 'BRAF'
    assert _substring_by_coords(s, e.stmt_agents[0][1].coords) == 'MAP2K1'
Пример #4
0
def test_translocation():
    st1 = Translocation(Agent('FOXO3A'))
    st2 = Translocation(Agent('FOXO3A'), 'cytoplasm')
    st3 = Translocation(Agent('FOXO3A'), None, 'nucleus')
    st4 = Translocation(Agent('FOXO3A'), 'cytoplasm', 'nucleus')
    e = ea.EnglishAssembler()
    e.add_statements([st1])
    s = e.make_model()
    assert s == 'FOXO3A translocates.'
    e = ea.EnglishAssembler()
    e.add_statements([st2])
    s = e.make_model()
    assert s == 'FOXO3A translocates from the cytoplasm.'
    e = ea.EnglishAssembler()
    e.add_statements([st3])
    s = e.make_model()
    assert s == 'FOXO3A translocates to the nucleus.'
    e = ea.EnglishAssembler()
    e.add_statements([st4])
    s = e.make_model()
    assert s == 'FOXO3A translocates from the cytoplasm to the nucleus.'
Пример #5
0
def test_assemble_more():
    a = Agent('MAP2K1')
    b = Agent('PP2A')
    st1 = Dephosphorylation(b, a, 'serine', 222)
    b = Agent('BRAF')
    c = Agent('RAF1')
    st2 = Complex([a, b, c])
    e = ea.EnglishAssembler()
    e.add_statements([st1, st2])
    s = e.make_model()
    print(s)
    assert s == \
        'PP2A dephosphorylates MAP2K1 on S222. MAP2K1 binds BRAF and RAF1.'
Пример #6
0
def test_assemble_more():
    a = Agent('MAP2K1')
    b = Agent('PP2A')
    st1 = Dephosphorylation(b, a, 'serine', 222)
    b = Agent('BRAF')
    c = Agent('RAF1')
    st2 = Complex([a, b, c])
    e = ea.EnglishAssembler()
    e.add_statements([st1, st2])
    s = e.make_model()
    print(s)
    assert s == \
        'PP2A dephosphorylates MAP2K1 on S222. MAP2K1 binds BRAF and RAF1.'
    assert _substring_by_coords(s, e.stmt_agents[0][0].coords) == 'PP2A'
    assert _substring_by_coords(s, e.stmt_agents[0][1].coords) == 'MAP2K1'
    assert _substring_by_coords(s, e.stmt_agents[1][0].coords) == 'MAP2K1'
    assert _substring_by_coords(s, e.stmt_agents[1][1].coords) == 'BRAF'
    assert _substring_by_coords(s, e.stmt_agents[1][2].coords) == 'RAF1'
Пример #7
0
def _stmt_to_text(st):
    e = ea.EnglishAssembler()
    e.add_statements([st])
    s = e.make_model()
    print(s)
    return s