本文整理汇总了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