コード例 #1
0
def test_simple_assembly():
    st1 = Activation(Agent('a'), Agent('b'))
    st2 = Inhibition(Agent('a'), Agent('c'))
    sa = SifAssembler([st1, st2])
    sa.make_model()
    assert len(sa.graph.nodes()) == 3
    assert len(sa.graph.edges()) == 2
    bn = sa.print_boolean_net()
コード例 #2
0
    model = boolean2.Model(text=bn_str, mode='async')
    for i in range(nsim):
        model.initialize()
        model.iterate(steps=nsteps)
        coll.collect(states=model.states, nodes=model.nodes)
    avgs = coll.get_averages(normalize=True)
    return avgs


if __name__ == '__main__':
    # Build Boolean net for basic pathway
    st = ac.load_statements('ras_pathway.pkl')
    sa = SifAssembler(st)
    sa.make_model(use_name_as_key=True)
    sa.save_model('ras_pathway.sif')
    bn_str = sa.print_boolean_net('ras_pathway_bn.txt')

    # Build Boolean net for extended pathway
    st_ext = ac.load_statements('ras_pathway_extension.pkl')
    sa = SifAssembler(st + st_ext)
    sa.make_model(use_name_as_key=True)
    sa.save_model('ras_pathway_extension.sif')
    bn_str = sa.print_boolean_net('ras_pathway_extension_bn.txt')

    # Condition 1
    off = []
    on = ['GROWTH-FACTOR']
    avgs = get_sim_avgs(bn_str, off=off, on=on)
    jun_basic_noinh = avgs['JUN']

    # Condition 2
コード例 #3
0
ファイル: run_ras_boolnet.py プロジェクト: johnbachman/indra
    model = boolean2.Model(text=bn_str, mode='async')
    for i in range(nsim):
        model.initialize()
        model.iterate(steps=nsteps)
        coll.collect(states=model.states, nodes=model.nodes)
    avgs = coll.get_averages(normalize=True)
    return avgs


if __name__ == '__main__':
    # Build Boolean net for basic pathway
    st = ac.load_statements('ras_pathway.pkl')
    sa = SifAssembler(st)
    sa.make_model(use_name_as_key=True)
    sa.save_model('ras_pathway.sif')
    bn_str = sa.print_boolean_net('ras_pathway_bn.txt')

    # Build Boolean net for extended pathway
    st_ext = ac.load_statements('ras_pathway_extension.pkl')
    sa = SifAssembler(st + st_ext)
    sa.make_model(use_name_as_key=True)
    sa.save_model('ras_pathway_extension.sif')
    bn_str = sa.print_boolean_net('ras_pathway_extension_bn.txt')

    # Condition 1
    off = []
    on = ['GROWTH-FACTOR']
    avgs = get_sim_avgs(bn_str, off=off, on=on)
    jun_basic_noinh = avgs['JUN']

    # Condition 2