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


Python PysbAssembler.model方法代码示例

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


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

示例1: assemble_model

# 需要导入模块: from indra.assemblers import PysbAssembler [as 别名]
# 或者: from indra.assemblers.PysbAssembler import model [as 别名]
def assemble_model(model_name, reread=False):
    xml_fname = model_name + '.xml'
    if not reread:
        print('Processing %s' % xml_fname)
        if os.path.exists(xml_fname):
            with open(xml_fname, 'rb') as fh:
                tp = trips.process_xml(fh.read())
        else:
            reread = True
    if reread:
        fname = model_name + '.txt'
        print('Reading %s' % fname)
        with open(fname, 'rb') as fh:
            tp = trips.process_text(fh.read(), xml_fname)

    print('Assembling statements:')
    for i, st in enumerate(tp.statements):
        print('%d: %s' % (i, st))
    print('----------------------')

    pa = PysbAssembler()
    pa.add_statements(tp.statements)
    model = pa.make_model()
    model.name = model_name

    p53 = model.monomers['TP53']
    obs = Observable(b'p53_active', p53(activity='active'))
    model.add_component(obs)
    if not model_name.endswith('var'):
        model.parameters['kf_aa_act_1'].value = 5e-06
    model.parameters['kf_pt_act_1'].value = 1e-05

    if model_name == 'p53_ATM':
        model.add_component(Parameter('ATMa_0', 1))
        atm = model.monomers['ATM']
        model.initial(atm(activity='active'),
                      model.parameters['ATMa_0'])
        model.parameters['kf_pa_act_1'].value = 1e-04
        obs = Observable(b'atm_active', atm(activity='active'))
        model.add_component(obs)

    if model_name == 'p53_ATR':
        model.add_component(Parameter('ATRa_0', 1))
        atr = model.monomers['ATR']
        model.initial(atr(activity='active'),
                      model.parameters['ATRa_0'])
        obs = Observable(b'atr_active', atr(activity='active'))
        model.add_component(obs)

    if model_name == 'p53_ATM_var':
        #model.add_component(Parameter('ATMa_0', 1))
        #atm = model.monomers['ATM']
        #model.initial(atm(activity='active'),
        #              model.parameters['ATMa_0'])
        model.add_component(Parameter('ATMa_0', 1))
        atm = model.monomers['ATM']
        model.initial(atm(phospho='p'),
                      model.parameters['ATMa_0'])
        model.parameters['kf_pa_dephosphorylation_1'].value = 1e-04
        model.parameters['MDM2_0'].value = 0
        model.parameters['kf_m_deg_1'].value = 8e-01
        model.parameters['kf_tm_synth_1'].value = 0.2
        model.parameters['kf_aa_phosphorylation_1'].value = 5e-06
        obs = Observable(b'atm_active', atm(phospho='p'))
        model.add_component(obs)

    pa.model = model
    pa.save_model('%s.py' % model_name)
    return model
开发者ID:jmuhlich,项目名称:indra,代码行数:71,代码来源:run_p53_model.py


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