예제 #1
0
def test_get_upstream():
    m = MRA()
    egfr = sts.Agent('EGFR', db_refs={'HGNC': '3236', 'TEXT': 'EGFR'})
    kras = sts.Agent('KRAS', db_refs={'HGNC': '6407', 'TEXT': 'KRAS'})
    stmts = [sts.Activation(egfr, kras)]
    model_id = m.new_model(stmts)
    upstream = m.get_upstream(kras, model_id)
    assert(len(upstream) == 1)
    assert(upstream[0].name == 'EGFR')
예제 #2
0
def test_respond_model_get_upstream():
    mm = MRA_Module(testing=True)
    egfr = sts.Agent('EGFR', db_refs={'HGNC': '3236', 'TEXT': 'EGFR'})
    kras = sts.Agent('KRAS', db_refs={'HGNC': '6407', 'TEXT': 'KRAS'})
    stmts = [sts.Activation(egfr, kras)]
    model_id = mm.mra.new_model(stmts)
    kras_term = ekb_from_agent(kras)
    msg = KQMLList('MODEL-GET-UPSTREAM')
    msg.sets('target', kras_term)
    msg.set('model-id', str(model_id))
    reply = mm.respond_model_get_upstream(msg)
    ups = reply.get('upstream')
    assert(len(ups) == 1)
예제 #3
0
 def create_build(self):
     self.bioagent.mra.explain = \
         sts.Activation(sts.Agent('KRAS', db_refs={'HGNC': '6407'}),
                        sts.Agent('JUN', db_refs={'HGNC': '6204'}))
     return _get_build_model_request('KRAS activates MEK.')