当前位置: 首页>>代码示例>>Python>>正文


Python PysbAssembler.set_context方法代码示例

本文整理汇总了Python中indra.assemblers.PysbAssembler.set_context方法的典型用法代码示例。如果您正苦于以下问题:Python PysbAssembler.set_context方法的具体用法?Python PysbAssembler.set_context怎么用?Python PysbAssembler.set_context使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在indra.assemblers.PysbAssembler的用法示例。


在下文中一共展示了PysbAssembler.set_context方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_set_context_monomer_notfound

# 需要导入模块: from indra.assemblers import PysbAssembler [as 别名]
# 或者: from indra.assemblers.PysbAssembler import set_context [as 别名]
def test_set_context_monomer_notfound():
    st = Phosphorylation(Agent("MAP2K1"), Agent("XYZ"))
    pa = PysbAssembler()
    pa.add_statements([st])
    pa.make_model()
    assert pa.model.parameters["MAP2K1_0"].value < 1000
    assert pa.model.parameters["XYZ_0"].value < 1000
    pa.set_context("A375_SKIN")
    assert pa.model.parameters["MAP2K1_0"].value > 10000
    assert pa.model.parameters["XYZ_0"].value < 1000
开发者ID:jmuhlich,项目名称:indra,代码行数:12,代码来源:test_pysb_assembler.py

示例2: assemble_pysb

# 需要导入模块: from indra.assemblers import PysbAssembler [as 别名]
# 或者: from indra.assemblers.PysbAssembler import set_context [as 别名]
def assemble_pysb(stmts, data_genes, out_file):
    """Return an assembled PySB model."""
    stmts = ac.filter_direct(stmts)
    stmts = ac.filter_belief(stmts, 0.95)
    stmts = ac.filter_top_level(stmts)
    stmts = ac.filter_gene_list(stmts, data_genes, 'all')
    stmts = ac.reduce_activities(stmts)
    pa = PysbAssembler()
    pa.add_statements(stmts)
    model = pa.make_model()
    # Add observables
    o = Observable('MAPK1p', model.monomers['MAPK1'](T185='p', Y187='p'))
    model.add_component(o)
    o = Observable('MAPK3p', model.monomers['MAPK3'](T202='p', Y204='p'))
    model.add_component(o)
    o = Observable('GSK3Ap', model.monomers['GSK3A'](S21='p'))
    model.add_component(o)
    o = Observable('GSK3Bp', model.monomers['GSK3B'](S9='p'))
    model.add_component(o)
    o = Observable('RPS6p', model.monomers['RPS6'](S235='p'))
    model.add_component(o)
    o = Observable('EIF4EBP1p', model.monomers['EIF4EBP1'](S65='p'))
    model.add_component(o)
    o = Observable('JUNp', model.monomers['JUN'](S73='p'))
    model.add_component(o)
    o = Observable('FOXO3p', model.monomers['FOXO3'](S315='p'))
    model.add_component(o)
    o = Observable('AKT1p', model.monomers['AKT1'](S473='p'))
    model.add_component(o)
    o = Observable('AKT2p', model.monomers['AKT2'](S474='p'))
    model.add_component(o)
    o = Observable('AKT3p', model.monomers['AKT3'](S='p'))
    model.add_component(o)
    o = Observable('ELK1', model.monomers['ELK1'](S383='p'))
    model.add_component(o)
    # Set context
    pa.set_context('SKMEL28_SKIN')
    pa.save_model(out_file)

    ke = KappaExporter(model)
    with open('%s.ka' % base_file, 'wb') as fh:
        base_file, _ = os.path.splitext(out_file)
        fh.write(ke.export().encode('utf-8'))

    return model
开发者ID:jmuhlich,项目名称:indra,代码行数:47,代码来源:assemble_pysb.py

示例3: test_set_context_celltype_notfound

# 需要导入模块: from indra.assemblers import PysbAssembler [as 别名]
# 或者: from indra.assemblers.PysbAssembler import set_context [as 别名]
def test_set_context_celltype_notfound():
    st = Phosphorylation(Agent("MAP2K1"), Agent("MAPK3"))
    pa = PysbAssembler()
    pa.add_statements([st])
    pa.make_model()
    pa.set_context("XYZ")
开发者ID:jmuhlich,项目名称:indra,代码行数:8,代码来源:test_pysb_assembler.py


注:本文中的indra.assemblers.PysbAssembler.set_context方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。