<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> import re <EOL> from pysb import * <EOL> import pysb . bng <EOL> import pysb . examples . earm_1_0 <EOL> Model ( base = pysb . examples . earm_1_0 . model ) <EOL> Annotation ( model , '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> Bcl2c . rename ( '<STR_LIT>' ) <EOL> Bcl2c_0 . rename ( '<STR_LIT>' ) <EOL> inhibit_tBid_by_Bcl2c . rename ( '<STR_LIT>' ) <EOL> Parameter ( '<STR_LIT>' , <NUM_LIT> ) <EOL> Rule ( '<STR_LIT>' , DISC ( b = None ) >> L ( b = None ) + pR ( b = None ) , kf31 ) <EOL> pR_0 . value = <NUM_LIT:1000> <EOL> flip_0 . value = <NUM_LIT> <EOL> pC8_0 . value = <NUM_LIT> <EOL> Bid_0 . value = <NUM_LIT> <EOL> Bax_0 . value = <NUM_LIT> <EOL> Bcl2_0 . value = <NUM_LIT> <EOL> v = <NUM_LIT> <EOL> kr1 . value = <NUM_LIT> <EOL> kc1 . value = <NUM_LIT> <EOL> kf3 . value = <NUM_LIT> <EOL> kf6 . value = <NUM_LIT> <EOL> kf7 . value = <NUM_LIT> <EOL> kr9 . value = <NUM_LIT> <EOL> kc9 . value = <NUM_LIT:20> <EOL> kr13 . value = <NUM_LIT:1> <EOL> kf14 . value = <NUM_LIT> / v <EOL> kf15 . value = <NUM_LIT> * <NUM_LIT:2> / v <EOL> kf16 . value = <NUM_LIT> / v <EOL> kf17 . value = <NUM_LIT> * <NUM_LIT:2> / v <EOL> kf18 . value = <NUM_LIT> / v <EOL> kf19 . value = <NUM_LIT> / v <EOL> kf20 . value = <NUM_LIT> / v <EOL> kf21 . value = <NUM_LIT> / v <EOL> kf22 . value = <NUM_LIT:1> <EOL> kf26 . value = <NUM_LIT:1> <EOL> pysb . bng . generate_equations ( model ) <EOL> all_species = list ( model . species ) <EOL> model . reset_equations ( ) <EOL> def synthesize ( name , species , ks ) : <EOL> """<STR_LIT>""" <EOL> Rule ( name , None >> species , ks ) <EOL> def degrade ( name , species , kdeg ) : <EOL> """<STR_LIT>""" <EOL> Rule ( name , species >> None , kdeg ) <EOL> kdeg_generic = <NUM_LIT> <EOL> Parameter ( '<STR_LIT>' , <NUM_LIT> ) <EOL> Parameter ( '<STR_LIT>' , <NUM_LIT> ) <EOL> Parameter ( '<STR_LIT>' , <NUM_LIT:0> ) <EOL> syn_base = <NUM_LIT> <EOL> Parameter ( '<STR_LIT>' , <NUM_LIT:0> ) <EOL> Rule ( '<STR_LIT>' , AMito ( b = None ) >> Mito ( b = None ) , kdeg_AMito ) <EOL> for species in all_species : <EOL> species_name = '<STR_LIT:_>' . join ( mp . monomer . name for mp in species . monomer_patterns ) <EOL> ks_name = '<STR_LIT>' + species_name <EOL> kdeg_name = '<STR_LIT>' + species_name <EOL> syn_rule_name = species_name + '<STR_LIT>' <EOL> deg_rule_name = species_name + '<STR_LIT>' <EOL> ic_name = species_name + '<STR_LIT>' <EOL> ks = model . parameters . get ( ks_name ) <EOL> kdeg = model . parameters . get ( kdeg_name ) <EOL> syn_rule = model . rules . get ( syn_rule_name ) <EOL> deg_rule = model . rules . get ( deg_rule_name ) <EOL> ic = model . parameters . get ( ic_name ) <EOL> if kdeg is None : <EOL> kdeg = Parameter ( kdeg_name , kdeg_generic ) <EOL> if ks is None : <EOL> ks_value = <NUM_LIT:0> <EOL> if ic is not None : <EOL> ks_value = syn_base * kdeg . value * ic . value <EOL> ks = Parameter ( ks_name , ks_value ) <EOL> if syn_rule is None : <EOL> synthesize ( syn_rule_name , species , ks ) <EOL> if deg_rule is None : <EOL> degrade ( deg_rule_name , species , kdeg ) <EOL> def show_species ( ) : <EOL> """<STR_LIT>""" <EOL> print ( '<STR_LIT>' % <EOL> ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> print ( '<STR_LIT:->' * ( <NUM_LIT:5> + <NUM_LIT:12> + <NUM_LIT:1> + <NUM_LIT:8> + <NUM_LIT:1> + <NUM_LIT:20> + <NUM_LIT:1> + <NUM_LIT:10> ) ) <EOL> for i , species in enumerate ( all_species , <NUM_LIT:1> ) : <EOL> mp_names = [ mp . monomer . name for mp in species . monomer_patterns ] <EOL> name = '<STR_LIT:_>' . join ( mp_names ) <EOL> display_name = '<STR_LIT::>' . join ( mp_names ) <EOL> ks = model . parameters . get ( '<STR_LIT>' + name ) <EOL> kdeg = model . parameters . get ( '<STR_LIT>' + name ) <EOL> ic = model . parameters . get ( name + '<STR_LIT>' ) <EOL> if ic is not None : <EOL> ic_value = ic . value <EOL> else : <EOL> ic_value = <NUM_LIT:0> <EOL> if ks . value != <NUM_LIT:0> and kdeg . value != <NUM_LIT:0> : <EOL> ic_calc = round ( ks . value / kdeg . value / syn_base ) <EOL> ks_expr = '<STR_LIT>' % ( syn_base , ic_calc ) <EOL> else : <EOL> ks_expr = '<STR_LIT:0>' <EOL> values = ( i , display_name , ic_value , ks_expr , kdeg . value ) <EOL> print ( '<STR_LIT>' % values ) <EOL> def show_rates ( ) : <EOL> """<STR_LIT>""" <EOL> print ( ( "<STR_LIT>" * <NUM_LIT:3> ) % ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> print ( '<STR_LIT:->' * ( <NUM_LIT:9> + <NUM_LIT:11> + <NUM_LIT:7> ) * <NUM_LIT:3> ) <EOL> for i in list ( range ( <NUM_LIT:1> , <NUM_LIT> ) ) + [ <NUM_LIT> ] : <EOL> for t in ( '<STR_LIT:f>' , '<STR_LIT:r>' , '<STR_LIT:c>' ) : <EOL> n = '<STR_LIT>' % ( t , i ) <EOL> p = model . parameters . get ( n ) <EOL> if p is not None : <EOL> print ( "<STR_LIT>" % ( p . name , p . value ) , end = '<STR_LIT:U+0020>' ) <EOL> print ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> print ( __doc__ , "<STR_LIT:\n>" , model ) <EOL> print ( """<STR_LIT>""" ) <EOL> show_species ( ) <EOL> print ( "<STR_LIT:\n>" ) <EOL> print ( """<STR_LIT>""" % v ) <EOL> show_rates ( ) <EOL> print ( """<STR_LIT>""" ) </s>
