Biochemically detailed model of LTP and LTD in a cortical spine (Maki-Marttunen et al 2020)

 Download zip file 
Help downloading and running models
Accession:260971
"Signalling pathways leading to post-synaptic plasticity have been examined in many types of experimental studies, but a unified picture on how multiple biochemical pathways collectively shape neocortical plasticity is missing. We built a biochemically detailed model of post-synaptic plasticity describing CaMKII, PKA, and PKC pathways and their contribution to synaptic potentiation or depression. We developed a statistical AMPA-receptor-tetramer model, which permits the estimation of the AMPA-receptor-mediated maximal synaptic conductance based on numbers of GluR1s and GluR2s predicted by the biochemical signalling model. We show that our model reproduces neuromodulator-gated spike-timing-dependent plasticity as observed in the visual cortex and can be fit to data from many cortical areas, uncovering the biochemical contributions of the pathways pinpointed by the underlying experimental studies. Our model explains the dependence of different forms of plasticity on the availability of different proteins and can be used for the study of mental disorder-associated impairments of cortical plasticity."
Reference:
1 . Mäki-Marttunen T, Iannella N, Edwards AG, Einevoll GT, Blackwell KT (2020) A unified computational model for cortical post-synaptic plasticity. Elife [PubMed]
Model Information (Click on a link to find other models with that property)
Model Type: Synapse;
Brain Region(s)/Organism: Neocortex;
Cell Type(s): Neocortex spiking regular (RS) neuron;
Channel(s): I Calcium;
Gap Junctions:
Receptor(s):
Gene(s):
Transmitter(s): Glutamate; Norephinephrine; Acetylcholine;
Simulation Environment: NEURON; NeuroRD;
Model Concept(s): Long-term Synaptic Plasticity;
Implementer(s): Maki-Marttunen, Tuomo [tuomomm at uio.no];
Search NeuronDB for information about:  I Calcium; Acetylcholine; Norephinephrine; Glutamate;
/
synaptic
NEURON
fitfiles
README.html
#drawfig3.py#
calcconds.py
calcconds_dimerdimer.py
drawfig11.py
drawfig2.py
drawfig3.py
drawfig3_1.py
drawfig4.py
drawfig5.py
drawfig9abc.py
emoo.py
fit_cAMP_withdiss_1d.py
fits_goodparams.mat
fits_goodparams_manyb.mat
fitter_fewer.py
fitter_fewer_check.py
fitter_fewer_check_given.py *
fitter_fewer1withCK_check_given.py *
fitter_manyb_check_given.py
mesh_general.out *
model_nrn_altered_noU.py
model_nrn_altered_noU_extfilename_lowmem_recall.py
model_nrn_altered_noU_noninterp.py
model_nrn_altered_noU_simpleflux_extfilename_lowmem.py
model_nrn_oldCaM_altered_noU.py
model_nrn_oldCaM_altered_noU_extfilename_lowmem_recall.py
model_nrn_oldPKA_altered_noU.py
model_nrn_paired_contnm_var.py
model_nrn_paired_contnm_var_noninterp.py
model_nrn_testPKA_withdiss.py
model_nrn_testPKA_withdiss_williamson_varyrates.py
mytools.py
protocols_many.py
protocols_many_78withoutCK.py
protocols_many_78withoutCK_1withCK.py
reactionGraph.mat
runfig11.sh
runfig2.sh
runfig3_1.sh
runfig3-4.sh
runfig5.sh
runfig9.sh
simsteadystate_flexible.py
simsteadystate_li2020.py
simsteadystate_oldCaM_li2020.py
                            
from neuron import h, rxd
from pylab import *
from matplotlib import pyplot
import scipy.io
import time
import re
import mytools
import protocols_many

h.load_file('stdrun.hoc')

dend = h.Section(name='dend')
dend.L=1
dend.diam=0.79788
cyt = rxd.Region([dend], name='cyt', nrn_region='i')

mesh_input_file = open('mesh_general.out','r')
mesh_firstline = mesh_input_file.readline()
mesh_secondline = mesh_input_file.readline()
mesh_values = mesh_secondline.split()
my_volume = float(mesh_values[-2])*1e-15 #litres
mesh_input_file.close()

Duration = 1000
tolerance = 1e-6
Ca_input_onset = 800
Ca_input_N     = 100
Ca_input_freq  = 100
Ca_input_dur   = 0.005
Ca_input_flux  = 600.0
L_input_flux   = 2.0
Glu_input_flux = 50.0
ACh_input_flux = 2.0
Ntrains        = 1
trainT = 3000
initfile = ''
addition = ''
blocked = []
blockeds = []
block_factor = 1.0
alteredk = []
alteredks = []
altered_factor = 1.0
tolstochange = 'Gs,Calbin,CalbinC,PMCA,PMCACa,PP2B,Gi,GiaGDP,Gibg,Gsbg,GsaGDP,CaOut,CaOutLeak,Leak,PDE1,Ng,NgCaM,CaM,CaMCa2,CaMCa4,fixedbuffer,fixedbufferCa,DGL,CaDGL'.split(',')
tolschange = [float(x) for x in '3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,2,2,1,1'.split(',')]
filename = 'nrn_oldCaM_tstop'+str(Duration)+'_tol'+str(tolerance)+addition+'_onset'+str(Ca_input_onset)+'_n'+str(Ca_input_N)+'_freq'+str(Ca_input_freq)+'_dur'+str(Ca_input_dur)+'_flux'+str(Ca_input_flux)+'_Lflux'+str(L_input_flux)+'_Gluflux'+str(Glu_input_flux)+'_AChflux'+str(ACh_input_flux)+'_Ntrains'+str(Ntrains)+'_trainT'+str(trainT)

if len(sys.argv) > 1:
  Duration = int(sys.argv[1])
if len(sys.argv) > 2:
  tolerance = float(sys.argv[2])
if len(sys.argv) > 3:
  Ca_input_onset = float(sys.argv[3])
if len(sys.argv) > 4:
  Ca_input_N     = int(sys.argv[4])
if len(sys.argv) > 5:
  Ca_input_freq  = float(sys.argv[5])
if len(sys.argv) > 6:
  Ca_input_dur   = float(sys.argv[6])
if len(sys.argv) > 7:
  Ca_input_flux  = float(sys.argv[7])
if len(sys.argv) > 8:
  L_input_flux   = float(sys.argv[8])
if len(sys.argv) > 9:
  Glu_input_flux = float(sys.argv[9])
if len(sys.argv) > 10:
  ACh_input_flux = float(sys.argv[10])
if len(sys.argv) > 11:
  Ntrains  = int(float(sys.argv[11]))
if len(sys.argv) > 12:
  trainT  = float(sys.argv[12])
if len(sys.argv) > 13:
  initfile = sys.argv[13]
if len(sys.argv) > 14:
  filename = sys.argv[14]
if len(sys.argv) > 15:
  blocked = sys.argv[15]
  blockeds = blocked.split('-')
if len(sys.argv) > 16:
  block_factor = sys.argv[16]
  block_factors = [float(x) for x in block_factor.split('-')]
if type(blocked) is not list:
  addition = '_'+blocked+'x'+str(block_factor)
if len(sys.argv) > 17:
  alteredk = sys.argv[17]
  alteredks = [int(x) for x in alteredk.split('-')]
if len(sys.argv) > 18:
  alteredk_factor = sys.argv[18]
  alteredk_factors = [float(x) for x in alteredk_factor.split('-')]
if type(alteredk) is not list:
  addition = addition+'_k'+alteredk+'x'+str(alteredk_factor)
if len(sys.argv) > 19:
  toltochange = 'Gs,Calbin,CalbinC,PMCA,PMCACa,PP2B,Gi,GiaGDP,Gibg,Gsbg,GsaGDP,CaOut,CaOutLeak,Leak,PDE1,Ng,NgCaM,CaM,CaMCa2,CaMCa4,fixedbuffer,fixedbufferCa,DGL,CaDGL,'+sys.argv[19]
  tolstochange = toltochange.split(',')
if len(sys.argv) > 20:
  tolchange = '3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,2,2,1,1,'+sys.argv[20]
  tolschange = [float(x) for x in tolchange.split(',')]

initvalues = [0.0, 1.9, 0.0, 0.002, 0.15, 0.015, 2.5, 0.0005, 0.0, 0.022, 0.54, 0.0, 0.0, 1e-05, 0.0016, 0.013, 0.0026, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00043, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.00037, 0.0, 0.0, 0.012, 0.0, 0.0, 0.00098, 0.02, 0.0, 0.06, 0.0, 0.0, 0.0023, 0.0, 0.0, 0.0, 0.023, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0064, 0.0, 0.0, 0.0, 0.0022, 0.0, 0.0, 0.0016, 0.0, 0.0, 0.0, 0.0, 0.00018, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 9e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00067, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0008, 0.0, 0.0, 0.0, 1.0, 0.0014, 0.0, 0.0, 0.00025, 0.0, 0.0, 0.0, 0.024, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00029, 0.0004, 0.015, 0.0, 0.0, 0.0, 9e-05, 0.0003, 0.0, 0.0, 0.0016, 0.00025, 9e-05, 0.0, 0.0, 0.0006, 1.4e-05, 0.0, 0.0, 0.0, 0.0, 0.000256, 0.0, 0.0, 0.0, 0.0, 0.0005, 0.0, 0.00045, 0.0, 0.0, 0.0, 0.001, 0.0, 0.0, 0.0]

species = ['Ca', 'CaOut', 'CaOutLeak', 'Leak', 'Calbin', 'CalbinC', 'LOut', 'Epac1', 'Epac1cAMP', 'PMCA', 'NCX', 'PMCACa', 'NCXCa', 'L', 'R', 'Gs', 'Gi', 'LR', 'LRGs', 'PKAcLR', 'PKAcpLR', 'PKAcppLR', 'PKAcpppLR', 'pLR', 'ppLR', 'pppLR', 'ppppLR', 'ppppLRGi', 'ppppLRGibg', 'PKAcR', 'PKAcpR', 'PKAcppR', 'PKAcpppR', 'pR', 'ppR', 'pppR', 'ppppR', 'ppppRGi', 'ppppRGibg', 'GsR', 'GsaGTP', 'GsaGDP', 'GiaGTP', 'GiaGDP', 'Gibg', 'Gsbg', 'LRGsbg', 'AC1', 'AC1GsaGTP', 'AC1GsaGTPCaMCa4', 'AC1GsaGTPCaMCa4ATP', 'AC1GiaGTP', 'AC1GiaGTPCaMCa4', 'AC1GiaGTPCaMCa4ATP', 'AC1GsaGTPGiaGTP', 'AC1GsaGTPGiaGTPCaMCa4', 'AC1GsGiCaMCa4ATP', 'ATP', 'cAMP', 'AC1CaMCa4', 'AC1CaMCa4ATP', 'AC8', 'AC8CaMCa4', 'AC8CaMCa4ATP', 'PDE1', 'PDE1CaMCa4', 'PDE1CaMCa4cAMP', 'AMP', 'Ng', 'NgCaM', 'CaM', 'CaMCa2', 'CaMCa4', 'PP2B', 'PP2BCaM', 'PP2BCaMCa2', 'PP2BCaMCa4', 'CK', 'CKCaMCa4', 'CKpCaMCa4', 'CKp', 'Complex', 'pComplex', 'CKpPP1', 'CKpCaMCa4PP1', 'PKA', 'PKAcAMP4', 'PKAr', 'PKAc', 'I1', 'I1PKAc', 'Ip35', 'PP1', 'Ip35PP1', 'Ip35PP2BCaMCa4', 'Ip35PP1PP2BCaMCa4', 'PP1PP2BCaMCa4', 'GluR1', 'GluR1_S845', 'GluR1_S831', 'GluR1_S845_S831', 'GluR1_PKAc', 'GluR1_CKCam', 'GluR1_CKpCam', 'GluR1_CKp', 'GluR1_PKCt', 'GluR1_PKCp', 'GluR1_S845_CKCam', 'GluR1_S845_CKpCam', 'GluR1_S845_CKp', 'GluR1_S845_PKCt', 'GluR1_S845_PKCp', 'GluR1_S831_PKAc', 'GluR1_S845_PP1', 'GluR1_S845_S831_PP1', 'GluR1_S831_PP1', 'GluR1_S845_PP2B', 'GluR1_S845_S831_PP2B', 'GluR1_memb', 'GluR1_memb_S845', 'GluR1_memb_S831', 'GluR1_memb_S845_S831', 'GluR1_memb_PKAc', 'GluR1_memb_CKCam', 'GluR1_memb_CKpCam', 'GluR1_memb_CKp', 'GluR1_memb_PKCt', 'GluR1_memb_PKCp', 'GluR1_memb_S845_CKCam', 'GluR1_memb_S845_CKpCam', 'GluR1_memb_S845_CKp', 'GluR1_memb_S845_PKCt', 'GluR1_memb_S845_PKCp', 'GluR1_memb_S831_PKAc', 'GluR1_memb_S845_PP1', 'GluR1_memb_S845_S831_PP1', 'GluR1_memb_S831_PP1', 'GluR1_memb_S845_PP2B', 'GluR1_memb_S845_S831_PP2B', 'PDE4', 'PDE4cAMP', 'PKAcPDE4', 'pPDE4', 'pPDE4cAMP', 'PKAc_PDE4_cAMP', 'fixedbuffer', 'fixedbufferCa', 'Glu', 'MGluR', 'MGluR_Glu', 'MGluR_Glu_desens', 'MGluR_Gqabg_Glu', 'GluOut', 'Gqabg', 'GqaGTP', 'GqaGDP', 'PLC', 'PLCCa', 'PLCCaGqaGTP', 'PLCGqaGTP', 'Pip2', 'PLCCaPip2', 'PLCCaGqaGTPPip2', 'Ip3', 'PLCCaDAG', 'PLCCaGqaGTPDAG', 'PIkinase', 'Ip3degPIk', 'PKC', 'PKCCa', 'PKCt', 'PKCp', 'DAG', 'DAGK', 'DAGKdag', 'PA', 'DGL', 'CaDGL', 'DAGCaDGL', '2AG', '2AGdegrad', 'Ip3degrad', 'GluR2', 'GluR2_PKCt', 'GluR2_PKCp', 'GluR2_S880', 'GluR2_S880_PP2A', 'GluR2_memb', 'GluR2_memb_PKCt', 'GluR2_memb_PKCp', 'GluR2_memb_S880', 'GluR2_memb_S880_PP2A', 'PP2A', 'ACh', 'M1R', 'AChM1R', 'M1RGq', 'AChM1RGq', 'PLA2', 'CaPLA2', 'CaPLA2Pip2', 'AA']

print "my_volume = "+str(my_volume)+" l ?= "+str(dend.L*(dend.diam/2)**2*3.14159265358)+" um3"
if len(initfile) > 3 and initfile != 'None':
  DATA_init = scipy.io.loadmat(initfile)
  for mykey in DATA_init.keys():
    if mykey[0:2] != '__':
      DATA_init[mykey] = DATA_init[mykey][0]
  for ispec in range(0,len(species)):
    initvalues[ispec] = DATA_init[species][-1]
tolscales = [1.0 for i in range(0,len(species))]
for ispec in range(0,len(species)):
  for iblock in range(0,len(blockeds)):
    if re.match(blockeds[iblock]+'$',species[ispec]):
      initvalues[ispec] = block_factors[iblock]*initvalues[ispec]
  for itol in range(0,len(tolstochange)):
    if tolstochange[itol] == species[ispec]:
      tolscales[ispec] = tolscales[ispec]*10**(-tolschange[itol])
specs = []
for ispec in range(0,len(species)):
  specs.append(rxd.Species(cyt, name='spec'+str(ispec), charge=0, initial=initvalues[ispec], atolscale=tolscales[ispec]))
  if tolscales[ispec] != 1.0:
    print 'spec'+str(ispec)+' ('+species[ispec]+') atolscale = '+str(tolscales[ispec])
Ca_flux_rate = rxd.Parameter(cyt, initial=0)
L_flux_rate = rxd.Parameter(cyt, initial=0)
Glu_flux_rate = rxd.Parameter(cyt, initial=0)
ACh_flux_rate = rxd.Parameter(cyt, initial=0)
ks = [1.0]*409
ks[0]   = 50.0         # Ca + PMCA <-> PMCACa (forward)
ks[1]   = 0.007        # Ca + PMCA <-> PMCACa (backward)
ks[2]   = 0.0035       # PMCACa --> PMCA + CaOut (forward)
ks[3]   = 16.8         # Ca + NCX <-> NCXCa (forward)
ks[4]   = 0.0112       # Ca + NCX <-> NCXCa (backward)
ks[5]   = 0.0056       # NCXCa --> NCX + CaOut (forward)
ks[6]   = 1.5          # CaOut + Leak <-> CaOutLeak (forward)
ks[7]   = 0.0011       # CaOut + Leak <-> CaOutLeak (backward)
ks[8]   = 0.0011       # CaOutLeak --> Ca + Leak (forward)
ks[9]   = 28.0         # Ca + Calbin <-> CalbinC (forward)
ks[10]  = 0.0196       # Ca + Calbin <-> CalbinC (backward)
ks[11]  = 0.0005       # L <-> LOut (forward)
ks[12]  = 2e-09        # L <-> LOut (backward)
ks[13]  = 5.555        # L + R <-> LR (forward)
ks[14]  = 0.005        # L + R <-> LR (backward)
ks[15]  = 0.6          # LR + Gs <-> LRGs (forward)
ks[16]  = 1e-06        # LR + Gs <-> LRGs (backward)
ks[17]  = 0.04         # Gs + R <-> GsR (forward)
ks[18]  = 3e-07        # Gs + R <-> GsR (backward)
ks[19]  = 2.5          # GsR + L <-> LRGs (forward)
ks[20]  = 0.0005       # GsR + L <-> LRGs (backward)
ks[21]  = 0.02         # LRGs --> LRGsbg + GsaGTP (forward)
ks[22]  = 0.08         # LRGsbg --> LR + Gsbg (forward)
ks[23]  = 0.8          # LR + PKAc <-> PKAcLR (forward)
ks[24]  = 0.00448      # LR + PKAc <-> PKAcLR (backward)
ks[25]  = 0.001        # PKAcLR --> pLR + PKAc (forward)
ks[26]  = 0.8          # pLR + PKAc <-> PKAcpLR (forward)
ks[27]  = 0.00448      # pLR + PKAc <-> PKAcpLR (backward)
ks[28]  = 0.001        # PKAcpLR --> ppLR + PKAc (forward)
ks[29]  = 17.12        # ppLR + PKAc <-> PKAcppLR (forward)
ks[30]  = 0.00448      # ppLR + PKAc <-> PKAcppLR (backward)
ks[31]  = 0.001        # PKAcppLR --> pppLR + PKAc (forward)
ks[32]  = 1712.0       # pppLR + PKAc <-> PKAcpppLR (forward)
ks[33]  = 0.00448      # pppLR + PKAc <-> PKAcpppLR (backward)
ks[34]  = 0.001        # PKAcpppLR --> ppppLR + PKAc (forward)
ks[35]  = 150.0        # ppppLR + Gi <-> ppppLRGi (forward)
ks[36]  = 0.00025      # ppppLR + Gi <-> ppppLRGi (backward)
ks[37]  = 0.000125     # ppppLRGi --> ppppLRGibg + GiaGTP (forward)
ks[38]  = 0.001        # ppppLRGibg --> ppppLR + Gibg (forward)
ks[39]  = 2.5e-06      # pLR --> LR (forward)
ks[40]  = 2.5e-06      # ppLR --> pLR (forward)
ks[41]  = 2.5e-06      # pppLR --> ppLR (forward)
ks[42]  = 2.5e-06      # ppppLR --> pppLR (forward)
ks[43]  = 0.04         # R + PKAc <-> PKAcR (forward)
ks[44]  = 0.00448      # R + PKAc <-> PKAcR (backward)
ks[45]  = 0.001        # PKAcR --> pR + PKAc (forward)
ks[46]  = 0.4          # pR + PKAc <-> PKAcpR (forward)
ks[47]  = 0.00448      # pR + PKAc <-> PKAcpR (backward)
ks[48]  = 0.001        # PKAcpR --> ppR + PKAc (forward)
ks[49]  = 4.0          # ppR + PKAc <-> PKAcppR (forward)
ks[50]  = 0.00448      # ppR + PKAc <-> PKAcppR (backward)
ks[51]  = 0.001        # PKAcppR --> pppR + PKAc (forward)
ks[52]  = 400.0        # pppR + PKAc <-> PKAcpppR (forward)
ks[53]  = 0.00448      # pppR + PKAc <-> PKAcpppR (backward)
ks[54]  = 0.001        # PKAcpppR --> ppppR + PKAc (forward)
ks[55]  = 75.0         # ppppR + Gi <-> ppppRGi (forward)
ks[56]  = 0.000125     # ppppR + Gi <-> ppppRGi (backward)
ks[57]  = 6.25e-05     # ppppRGi --> ppppRGibg + GiaGTP (forward)
ks[58]  = 0.001        # ppppRGibg --> ppppR + Gibg (forward)
ks[59]  = 2.5e-06      # pR --> R (forward)
ks[60]  = 2.5e-06      # ppR --> pR (forward)
ks[61]  = 2.5e-06      # pppR --> ppR (forward)
ks[62]  = 2.5e-06      # ppppR --> pppR (forward)
ks[63]  = 0.01         # GsaGTP --> GsaGDP (forward)
ks[64]  = 100000.0     # GsaGDP + Gsbg --> Gs (forward)
ks[65]  = 0.000125     # GiaGTP --> GiaGDP (forward)
ks[66]  = 1250.0       # GiaGDP + Gibg --> Gi (forward)
ks[67]  = 38.5         # GsaGTP + AC1 <-> AC1GsaGTP (forward)
ks[68]  = 0.01         # GsaGTP + AC1 <-> AC1GsaGTP (backward)
ks[69]  = 6.0          # AC1GsaGTP + CaMCa4 <-> AC1GsaGTPCaMCa4 (forward)
ks[70]  = 0.0009       # AC1GsaGTP + CaMCa4 <-> AC1GsaGTPCaMCa4 (backward)
ks[71]  = 10.0         # AC1GsaGTPCaMCa4 + ATP <-> AC1GsaGTPCaMCa4ATP (forward)
ks[72]  = 2.273        # AC1GsaGTPCaMCa4 + ATP <-> AC1GsaGTPCaMCa4ATP (backward)
ks[73]  = 0.02842      # AC1GsaGTPCaMCa4ATP --> cAMP + AC1GsaGTPCaMCa4 (forward)
ks[74]  = 62.5         # GiaGTP + AC1GsaGTP <-> AC1GsaGTPGiaGTP (forward)
ks[75]  = 0.01         # GiaGTP + AC1GsaGTP <-> AC1GsaGTPGiaGTP (backward)
ks[76]  = 6.0          # AC1GsaGTPGiaGTP + CaMCa4 <-> AC1GsaGTPGiaGTPCaMCa4 (forward)
ks[77]  = 0.0009       # AC1GsaGTPGiaGTP + CaMCa4 <-> AC1GsaGTPGiaGTPCaMCa4 (backward)
ks[78]  = 10.0         # AC1GsaGTPGiaGTPCaMCa4 + ATP <-> AC1GsGiCaMCa4ATP (forward)
ks[79]  = 2.273        # AC1GsaGTPGiaGTPCaMCa4 + ATP <-> AC1GsGiCaMCa4ATP (backward)
ks[80]  = 0.002842     # AC1GsGiCaMCa4ATP --> cAMP + AC1GsaGTPGiaGTPCaMCa4 (forward)
ks[81]  = 62.5         # GiaGTP + AC1CaMCa4 <-> AC1GiaGTPCaMCa4 (forward)
ks[82]  = 0.01         # GiaGTP + AC1CaMCa4 <-> AC1GiaGTPCaMCa4 (backward)
ks[83]  = 10.0         # AC1GiaGTPCaMCa4 + ATP <-> AC1GiaGTPCaMCa4ATP (forward)
ks[84]  = 2.273        # AC1GiaGTPCaMCa4 + ATP <-> AC1GiaGTPCaMCa4ATP (backward)
ks[85]  = 0.0005684    # AC1GiaGTPCaMCa4ATP --> cAMP + AC1GiaGTPCaMCa4 (forward)
ks[86]  = 6.0          # AC1 + CaMCa4 <-> AC1CaMCa4 (forward)
ks[87]  = 0.0009       # AC1 + CaMCa4 <-> AC1CaMCa4 (backward)
ks[88]  = 10.0         # AC1CaMCa4 + ATP <-> AC1CaMCa4ATP (forward)
ks[89]  = 2.273        # AC1CaMCa4 + ATP <-> AC1CaMCa4ATP (backward)
ks[90]  = 0.005684     # AC1CaMCa4ATP --> cAMP + AC1CaMCa4 (forward)
ks[91]  = 62.5         # AC1GiaGTP + GsaGTP <-> AC1GsaGTPGiaGTP (forward)
ks[92]  = 0.01         # AC1GiaGTP + GsaGTP <-> AC1GsaGTPGiaGTP (backward)
ks[93]  = 1.25         # AC8 + CaMCa4 <-> AC8CaMCa4 (forward)
ks[94]  = 0.001        # AC8 + CaMCa4 <-> AC8CaMCa4 (backward)
ks[95]  = 10.0         # AC8CaMCa4 + ATP <-> AC8CaMCa4ATP (forward)
ks[96]  = 2.273        # AC8CaMCa4 + ATP <-> AC8CaMCa4ATP (backward)
ks[97]  = 0.002842     # AC8CaMCa4ATP --> cAMP + AC8CaMCa4 (forward)
ks[98]  = 6.0          # CaM + Ca*2 <-> CaMCa2 (forward)
ks[99]  = 0.0091       # CaM + Ca*2 <-> CaMCa2 (backward)
ks[100] = 100.0        # CaMCa2 + Ca*2 <-> CaMCa4 (forward)
ks[101] = 1.0          # CaMCa2 + Ca*2 <-> CaMCa4 (backward)
ks[102] = 28.0         # CaM + Ng <-> NgCaM (forward)
ks[103] = 0.036        # CaM + Ng <-> NgCaM (backward)
ks[104] = 4.6          # CaM + PP2B <-> PP2BCaM (forward)
ks[105] = 1.2e-06      # CaM + PP2B <-> PP2BCaM (backward)
ks[106] = 46.0         # CaMCa2 + PP2B <-> PP2BCaMCa2 (forward)
ks[107] = 1.2e-06      # CaMCa2 + PP2B <-> PP2BCaMCa2 (backward)
ks[108] = 46.0         # CaMCa4 + PP2B <-> PP2BCaMCa4 (forward)
ks[109] = 1.2e-06      # CaMCa4 + PP2B <-> PP2BCaMCa4 (backward)
ks[110] = 600.0        # PP2BCaM + Ca*2 <-> PP2BCaMCa2 (forward)
ks[111] = 0.091        # PP2BCaM + Ca*2 <-> PP2BCaMCa2 (backward)
ks[112] = 100.0        # PP2BCaMCa2 + Ca*2 <-> PP2BCaMCa4 (forward)
ks[113] = 1.0          # PP2BCaMCa2 + Ca*2 <-> PP2BCaMCa4 (backward)
ks[114] = 10.0         # CaMCa4 + CK <-> CKCaMCa4 (forward)
ks[115] = 0.003        # CaMCa4 + CK <-> CKCaMCa4 (backward)
ks[116] = 0.1          # CKCaMCa4*2 <-> Complex (forward)
ks[117] = 0.01         # CKCaMCa4*2 <-> Complex (backward)
ks[118] = 0.1          # CKpCaMCa4 + CKCaMCa4 <-> pComplex (forward)
ks[119] = 0.01         # CKpCaMCa4 + CKCaMCa4 <-> pComplex (backward)
ks[120] = 0.1          # CKpCaMCa4 + Complex --> CKpCaMCa4 + pComplex (forward)
ks[121] = 0.1          # CKCaMCa4 + Complex --> CKCaMCa4 + pComplex (forward)
ks[122] = 10.0         # Complex*2 --> Complex + pComplex (forward)
ks[123] = 30.0         # Complex + pComplex --> pComplex*2 (forward)
ks[124] = 8e-07        # CKpCaMCa4 <-> CaMCa4 + CKp (forward)
ks[125] = 10.0         # CKpCaMCa4 <-> CaMCa4 + CKp (backward)
ks[126] = 0.004        # CKp + PP1 <-> CKpPP1 (forward)
ks[127] = 0.00034      # CKp + PP1 <-> CKpPP1 (backward)
ks[128] = 8.6e-05      # CKpPP1 --> PP1 + CK (forward)
ks[129] = 0.004        # CKpCaMCa4 + PP1 <-> CKpCaMCa4PP1 (forward)
ks[130] = 0.00034      # CKpCaMCa4 + PP1 <-> CKpCaMCa4PP1 (backward)
ks[131] = 8.6e-05      # CKpCaMCa4PP1 --> PP1 + CKCaMCa4 (forward)
ks[132] = 1600000000.0 # PKA + cAMP*4 <-> PKAcAMP4 (forward)
ks[133] = 6e-05        # PKA + cAMP*4 <-> PKAcAMP4 (backward)
ks[134] = 0.031        # Epac1 + cAMP <-> Epac1cAMP (forward)
ks[135] = 6.51e-05     # Epac1 + cAMP <-> Epac1cAMP (backward)
ks[136] = 1.4          # I1 + PKAc <-> I1PKAc (forward)
ks[137] = 0.0056       # I1 + PKAc <-> I1PKAc (backward)
ks[138] = 0.0014       # I1PKAc --> Ip35 + PKAc (forward)
ks[139] = 1.0          # Ip35 + PP1 <-> Ip35PP1 (forward)
ks[140] = 1.1e-06      # Ip35 + PP1 <-> Ip35PP1 (backward)
ks[141] = 96.25        # Ip35 + PP2BCaMCa4 <-> Ip35PP2BCaMCa4 (forward)
ks[142] = 0.33         # Ip35 + PP2BCaMCa4 <-> Ip35PP2BCaMCa4 (backward)
ks[143] = 0.055        # Ip35PP2BCaMCa4 --> I1 + PP2BCaMCa4 (forward)
ks[144] = 96.25        # Ip35PP1 + PP2BCaMCa4 <-> Ip35PP1PP2BCaMCa4 (forward)
ks[145] = 0.33         # Ip35PP1 + PP2BCaMCa4 <-> Ip35PP1PP2BCaMCa4 (backward)
ks[146] = 0.055        # Ip35PP1PP2BCaMCa4 --> I1 + PP1PP2BCaMCa4 (forward)
ks[147] = 0.0015       # PP1PP2BCaMCa4 --> PP1 + PP2BCaMCa4 (forward)
ks[148] = 4.02         # GluR1 + PKAc <-> GluR1_PKAc (forward)
ks[149] = 0.024        # GluR1 + PKAc <-> GluR1_PKAc (backward)
ks[150] = 0.006        # GluR1_PKAc --> GluR1_S845 + PKAc (forward)
ks[151] = 0.02224      # GluR1 + CKCaMCa4 <-> GluR1_CKCam (forward)
ks[152] = 0.0016       # GluR1 + CKCaMCa4 <-> GluR1_CKCam (backward)
ks[153] = 0.0004       # GluR1_CKCam --> GluR1_S831 + CKCaMCa4 (forward)
ks[154] = 0.0278       # GluR1 + CKpCaMCa4 <-> GluR1_CKpCam (forward)
ks[155] = 0.002        # GluR1 + CKpCaMCa4 <-> GluR1_CKpCam (backward)
ks[156] = 0.0005       # GluR1_CKpCam --> GluR1_S831 + CKpCaMCa4 (forward)
ks[157] = 0.02224      # GluR1 + CKp <-> GluR1_CKp (forward)
ks[158] = 0.0016       # GluR1 + CKp <-> GluR1_CKp (backward)
ks[159] = 0.0004       # GluR1_CKp --> GluR1_S831 + CKp (forward)
ks[160] = 0.0278       # GluR1 + PKCt <-> GluR1_PKCt (forward)
ks[161] = 0.002        # GluR1 + PKCt <-> GluR1_PKCt (backward)
ks[162] = 0.0005       # GluR1_PKCt --> GluR1_S831 + PKCt (forward)
ks[163] = 0.0278       # GluR1 + PKCp <-> GluR1_PKCp (forward)
ks[164] = 0.002        # GluR1 + PKCp <-> GluR1_PKCp (backward)
ks[165] = 0.0005       # GluR1_PKCp --> GluR1_S831 + PKCp (forward)
ks[166] = 0.02224      # GluR1_S845 + CKCaMCa4 <-> GluR1_S845_CKCam (forward)
ks[167] = 0.0016       # GluR1_S845 + CKCaMCa4 <-> GluR1_S845_CKCam (backward)
ks[168] = 0.0004       # GluR1_S845_CKCam --> GluR1_S845_S831 + CKCaMCa4 (forward)
ks[169] = 0.0278       # GluR1_S845 + CKpCaMCa4 <-> GluR1_S845_CKpCam (forward)
ks[170] = 0.002        # GluR1_S845 + CKpCaMCa4 <-> GluR1_S845_CKpCam (backward)
ks[171] = 0.0005       # GluR1_S845_CKpCam --> GluR1_S845_S831 + CKpCaMCa4 (forward)
ks[172] = 0.02224      # GluR1_S845 + CKp <-> GluR1_S845_CKp (forward)
ks[173] = 0.0016       # GluR1_S845 + CKp <-> GluR1_S845_CKp (backward)
ks[174] = 0.0004       # GluR1_S845_CKp --> GluR1_S845_S831 + CKp (forward)
ks[175] = 0.0278       # GluR1_S845 + PKCt <-> GluR1_S845_PKCt (forward)
ks[176] = 0.002        # GluR1_S845 + PKCt <-> GluR1_S845_PKCt (backward)
ks[177] = 0.0005       # GluR1_S845_PKCt --> GluR1_S845_S831 + PKCt (forward)
ks[178] = 0.0278       # GluR1_S845 + PKCp <-> GluR1_S845_PKCp (forward)
ks[179] = 0.002        # GluR1_S845 + PKCp <-> GluR1_S845_PKCp (backward)
ks[180] = 0.0005       # GluR1_S845_PKCp --> GluR1_S845_S831 + PKCp (forward)
ks[181] = 4.0          # GluR1_S831 + PKAc <-> GluR1_S831_PKAc (forward)
ks[182] = 0.024        # GluR1_S831 + PKAc <-> GluR1_S831_PKAc (backward)
ks[183] = 0.006        # GluR1_S831_PKAc --> GluR1_S845_S831 + PKAc (forward)
ks[184] = 0.87         # GluR1_S845 + PP1 <-> GluR1_S845_PP1 (forward)
ks[185] = 0.00068      # GluR1_S845 + PP1 <-> GluR1_S845_PP1 (backward)
ks[186] = 0.00017      # GluR1_S845_PP1 --> GluR1 + PP1 (forward)
ks[187] = 0.875        # GluR1_S845_S831 + PP1 <-> GluR1_S845_S831_PP1 (forward)
ks[188] = 0.0014       # GluR1_S845_S831 + PP1 <-> GluR1_S845_S831_PP1 (backward)
ks[189] = 0.00035      # GluR1_S845_S831_PP1 --> GluR1_S845 + PP1 (forward)
ks[190] = 0.00035      # GluR1_S845_S831_PP1 --> GluR1_S831 + PP1 (forward)
ks[191] = 0.875        # GluR1_S831 + PP1 <-> GluR1_S831_PP1 (forward)
ks[192] = 0.0014       # GluR1_S831 + PP1 <-> GluR1_S831_PP1 (backward)
ks[193] = 0.00035      # GluR1_S831_PP1 --> GluR1 + PP1 (forward)
ks[194] = 2.01         # GluR1_S845 + PP2BCaMCa4 <-> GluR1_S845_PP2B (forward)
ks[195] = 0.008        # GluR1_S845 + PP2BCaMCa4 <-> GluR1_S845_PP2B (backward)
ks[196] = 0.002        # GluR1_S845_PP2B --> GluR1 + PP2BCaMCa4 (forward)
ks[197] = 2.01         # GluR1_S845_S831 + PP2BCaMCa4 <-> GluR1_S845_S831_PP2B (forward)
ks[198] = 0.008        # GluR1_S845_S831 + PP2BCaMCa4 <-> GluR1_S845_S831_PP2B (backward)
ks[199] = 0.002        # GluR1_S845_S831_PP2B --> GluR1_S831 + PP2BCaMCa4 (forward)
ks[200] = 4.02         # GluR1_memb + PKAc <-> GluR1_memb_PKAc (forward)
ks[201] = 0.024        # GluR1_memb + PKAc <-> GluR1_memb_PKAc (backward)
ks[202] = 0.006        # GluR1_memb_PKAc --> GluR1_memb_S845 + PKAc (forward)
ks[203] = 0.02224      # GluR1_memb + CKCaMCa4 <-> GluR1_memb_CKCam (forward)
ks[204] = 0.0016       # GluR1_memb + CKCaMCa4 <-> GluR1_memb_CKCam (backward)
ks[205] = 0.0004       # GluR1_memb_CKCam --> GluR1_memb_S831 + CKCaMCa4 (forward)
ks[206] = 0.0278       # GluR1_memb + CKpCaMCa4 <-> GluR1_memb_CKpCam (forward)
ks[207] = 0.002        # GluR1_memb + CKpCaMCa4 <-> GluR1_memb_CKpCam (backward)
ks[208] = 0.0005       # GluR1_memb_CKpCam --> GluR1_memb_S831 + CKpCaMCa4 (forward)
ks[209] = 0.02224      # GluR1_memb + CKp <-> GluR1_memb_CKp (forward)
ks[210] = 0.0016       # GluR1_memb + CKp <-> GluR1_memb_CKp (backward)
ks[211] = 0.0004       # GluR1_memb_CKp --> GluR1_memb_S831 + CKp (forward)
ks[212] = 0.0278       # GluR1_memb + PKCt <-> GluR1_memb_PKCt (forward)
ks[213] = 0.002        # GluR1_memb + PKCt <-> GluR1_memb_PKCt (backward)
ks[214] = 0.0005       # GluR1_memb_PKCt --> GluR1_memb_S831 + PKCt (forward)
ks[215] = 0.0278       # GluR1_memb + PKCp <-> GluR1_memb_PKCp (forward)
ks[216] = 0.002        # GluR1_memb + PKCp <-> GluR1_memb_PKCp (backward)
ks[217] = 0.0005       # GluR1_memb_PKCp --> GluR1_memb_S831 + PKCp (forward)
ks[218] = 0.02224      # GluR1_memb_S845 + CKCaMCa4 <-> GluR1_memb_S845_CKCam (forward)
ks[219] = 0.0016       # GluR1_memb_S845 + CKCaMCa4 <-> GluR1_memb_S845_CKCam (backward)
ks[220] = 0.0004       # GluR1_memb_S845_CKCam --> GluR1_memb_S845_S831 + CKCaMCa4 (forward)
ks[221] = 0.0278       # GluR1_memb_S845 + CKpCaMCa4 <-> GluR1_memb_S845_CKpCam (forward)
ks[222] = 0.002        # GluR1_memb_S845 + CKpCaMCa4 <-> GluR1_memb_S845_CKpCam (backward)
ks[223] = 0.0005       # GluR1_memb_S845_CKpCam --> GluR1_memb_S845_S831 + CKpCaMCa4 (forward)
ks[224] = 0.02224      # GluR1_memb_S845 + CKp <-> GluR1_memb_S845_CKp (forward)
ks[225] = 0.0016       # GluR1_memb_S845 + CKp <-> GluR1_memb_S845_CKp (backward)
ks[226] = 0.0004       # GluR1_memb_S845_CKp --> GluR1_memb_S845_S831 + CKp (forward)
ks[227] = 0.0278       # GluR1_memb_S845 + PKCt <-> GluR1_memb_S845_PKCt (forward)
ks[228] = 0.002        # GluR1_memb_S845 + PKCt <-> GluR1_memb_S845_PKCt (backward)
ks[229] = 0.0005       # GluR1_memb_S845_PKCt --> GluR1_memb_S845_S831 + PKCt (forward)
ks[230] = 0.0278       # GluR1_memb_S845 + PKCp <-> GluR1_memb_S845_PKCp (forward)
ks[231] = 0.002        # GluR1_memb_S845 + PKCp <-> GluR1_memb_S845_PKCp (backward)
ks[232] = 0.0005       # GluR1_memb_S845_PKCp --> GluR1_memb_S845_S831 + PKCp (forward)
ks[233] = 4.0          # GluR1_memb_S831 + PKAc <-> GluR1_memb_S831_PKAc (forward)
ks[234] = 0.024        # GluR1_memb_S831 + PKAc <-> GluR1_memb_S831_PKAc (backward)
ks[235] = 0.006        # GluR1_memb_S831_PKAc --> GluR1_memb_S845_S831 + PKAc (forward)
ks[236] = 0.87         # GluR1_memb_S845 + PP1 <-> GluR1_memb_S845_PP1 (forward)
ks[237] = 0.00068      # GluR1_memb_S845 + PP1 <-> GluR1_memb_S845_PP1 (backward)
ks[238] = 0.00017      # GluR1_memb_S845_PP1 --> GluR1_memb + PP1 (forward)
ks[239] = 0.875        # GluR1_memb_S845_S831 + PP1 <-> GluR1_memb_S845_S831_PP1 (forward)
ks[240] = 0.0014       # GluR1_memb_S845_S831 + PP1 <-> GluR1_memb_S845_S831_PP1 (backward)
ks[241] = 0.00035      # GluR1_memb_S845_S831_PP1 --> GluR1_memb_S845 + PP1 (forward)
ks[242] = 0.00035      # GluR1_memb_S845_S831_PP1 --> GluR1_memb_S831 + PP1 (forward)
ks[243] = 0.875        # GluR1_memb_S831 + PP1 <-> GluR1_memb_S831_PP1 (forward)
ks[244] = 0.0014       # GluR1_memb_S831 + PP1 <-> GluR1_memb_S831_PP1 (backward)
ks[245] = 0.00035      # GluR1_memb_S831_PP1 --> GluR1_memb + PP1 (forward)
ks[246] = 2.01         # GluR1_memb_S845 + PP2BCaMCa4 <-> GluR1_memb_S845_PP2B (forward)
ks[247] = 0.008        # GluR1_memb_S845 + PP2BCaMCa4 <-> GluR1_memb_S845_PP2B (backward)
ks[248] = 0.002        # GluR1_memb_S845_PP2B --> GluR1_memb + PP2BCaMCa4 (forward)
ks[249] = 2.01         # GluR1_memb_S845_S831 + PP2BCaMCa4 <-> GluR1_memb_S845_S831_PP2B (forward)
ks[250] = 0.008        # GluR1_memb_S845_S831 + PP2BCaMCa4 <-> GluR1_memb_S845_S831_PP2B (backward)
ks[251] = 0.002        # GluR1_memb_S845_S831_PP2B --> GluR1_memb_S831 + PP2BCaMCa4 (forward)
ks[252] = 2e-07        # GluR1 <-> GluR1_memb (forward)
ks[253] = 8e-07        # GluR1 <-> GluR1_memb (backward)
ks[254] = 2e-07        # GluR1_PKAc <-> GluR1_memb_PKAc (forward)
ks[255] = 8e-07        # GluR1_PKAc <-> GluR1_memb_PKAc (backward)
ks[256] = 2e-07        # GluR1_CKCam <-> GluR1_memb_CKCam (forward)
ks[257] = 8e-07        # GluR1_CKCam <-> GluR1_memb_CKCam (backward)
ks[258] = 2e-07        # GluR1_CKpCam <-> GluR1_memb_CKpCam (forward)
ks[259] = 8e-07        # GluR1_CKpCam <-> GluR1_memb_CKpCam (backward)
ks[260] = 2e-07        # GluR1_CKp <-> GluR1_memb_CKp (forward)
ks[261] = 8e-07        # GluR1_CKp <-> GluR1_memb_CKp (backward)
ks[262] = 2e-07        # GluR1_PKCt <-> GluR1_memb_PKCt (forward)
ks[263] = 8e-07        # GluR1_PKCt <-> GluR1_memb_PKCt (backward)
ks[264] = 2e-07        # GluR1_PKCp <-> GluR1_memb_PKCp (forward)
ks[265] = 8e-07        # GluR1_PKCp <-> GluR1_memb_PKCp (backward)
ks[266] = 2e-07        # GluR1_S831 <-> GluR1_memb_S831 (forward)
ks[267] = 8e-07        # GluR1_S831 <-> GluR1_memb_S831 (backward)
ks[268] = 2e-07        # GluR1_S831_PKAc <-> GluR1_memb_S831_PKAc (forward)
ks[269] = 8e-07        # GluR1_S831_PKAc <-> GluR1_memb_S831_PKAc (backward)
ks[270] = 2e-07        # GluR1_S831_PP1 <-> GluR1_memb_S831_PP1 (forward)
ks[271] = 8e-07        # GluR1_S831_PP1 <-> GluR1_memb_S831_PP1 (backward)
ks[272] = 3.28e-05     # GluR1_S845 <-> GluR1_memb_S845 (forward)
ks[273] = 8e-06        # GluR1_S845 <-> GluR1_memb_S845 (backward)
ks[274] = 3.28e-05     # GluR1_S845_CKCam <-> GluR1_memb_S845_CKCam (forward)
ks[275] = 8e-06        # GluR1_S845_CKCam <-> GluR1_memb_S845_CKCam (backward)
ks[276] = 3.28e-05     # GluR1_S845_CKpCam <-> GluR1_memb_S845_CKpCam (forward)
ks[277] = 8e-06        # GluR1_S845_CKpCam <-> GluR1_memb_S845_CKpCam (backward)
ks[278] = 3.28e-05     # GluR1_S845_CKp <-> GluR1_memb_S845_CKp (forward)
ks[279] = 8e-06        # GluR1_S845_CKp <-> GluR1_memb_S845_CKp (backward)
ks[280] = 3.28e-05     # GluR1_S845_PKCt <-> GluR1_memb_S845_PKCt (forward)
ks[281] = 8e-06        # GluR1_S845_PKCt <-> GluR1_memb_S845_PKCt (backward)
ks[282] = 3.28e-05     # GluR1_S845_PKCp <-> GluR1_memb_S845_PKCp (forward)
ks[283] = 8e-06        # GluR1_S845_PKCp <-> GluR1_memb_S845_PKCp (backward)
ks[284] = 3.28e-05     # GluR1_S845_S831 <-> GluR1_memb_S845_S831 (forward)
ks[285] = 8e-06        # GluR1_S845_S831 <-> GluR1_memb_S845_S831 (backward)
ks[286] = 3.28e-05     # GluR1_S845_PP1 <-> GluR1_memb_S845_PP1 (forward)
ks[287] = 8e-06        # GluR1_S845_PP1 <-> GluR1_memb_S845_PP1 (backward)
ks[288] = 3.28e-05     # GluR1_S845_S831_PP1 <-> GluR1_memb_S845_S831_PP1 (forward)
ks[289] = 8e-06        # GluR1_S845_S831_PP1 <-> GluR1_memb_S845_S831_PP1 (backward)
ks[290] = 3.28e-05     # GluR1_S845_PP2B <-> GluR1_memb_S845_PP2B (forward)
ks[291] = 8e-06        # GluR1_S845_PP2B <-> GluR1_memb_S845_PP2B (backward)
ks[292] = 3.28e-05     # GluR1_S845_S831_PP2B <-> GluR1_memb_S845_S831_PP2B (forward)
ks[293] = 8e-06        # GluR1_S845_S831_PP2B <-> GluR1_memb_S845_S831_PP2B (backward)
ks[294] = 100.0        # PDE1 + CaMCa4 <-> PDE1CaMCa4 (forward)
ks[295] = 0.001        # PDE1 + CaMCa4 <-> PDE1CaMCa4 (backward)
ks[296] = 4.6          # PDE1CaMCa4 + cAMP <-> PDE1CaMCa4cAMP (forward)
ks[297] = 0.044        # PDE1CaMCa4 + cAMP <-> PDE1CaMCa4cAMP (backward)
ks[298] = 0.011        # PDE1CaMCa4cAMP --> PDE1CaMCa4 + AMP (forward)
ks[299] = 0.001        # AMP --> ATP (forward)
ks[300] = 21.66        # PDE4 + cAMP <-> PDE4cAMP (forward)
ks[301] = 0.0034656    # PDE4 + cAMP <-> PDE4cAMP (backward)
ks[302] = 0.017233     # PDE4cAMP --> PDE4 + AMP (forward)
ks[303] = 0.25         # PKAc + PDE4 <-> PKAcPDE4 (forward)
ks[304] = 8e-05        # PKAc + PDE4 <-> PKAcPDE4 (backward)
ks[305] = 2e-05        # PKAcPDE4 --> pPDE4 + PKAc (forward)
ks[306] = 2.5e-06      # pPDE4 --> PDE4 (forward)
ks[307] = 433.175      # pPDE4 + cAMP <-> pPDE4cAMP (forward)
ks[308] = 0.069308     # pPDE4 + cAMP <-> pPDE4cAMP (backward)
ks[309] = 0.3446674    # pPDE4cAMP --> pPDE4 + AMP (forward)
ks[310] = 0.25         # PDE4cAMP + PKAc <-> PKAc_PDE4_cAMP (forward)
ks[311] = 8e-05        # PDE4cAMP + PKAc <-> PKAc_PDE4_cAMP (backward)
ks[312] = 2e-05        # PKAc_PDE4_cAMP --> pPDE4cAMP + PKAc (forward)
ks[313] = 0.00024      # PKAcAMP4 <-> PKAr + PKAc*2 (forward)
ks[314] = 25.5         # PKAcAMP4 <-> PKAr + PKAc*2 (backward)
ks[315] = 400.0        # Ca + fixedbuffer <-> fixedbufferCa (forward)
ks[316] = 20.0         # Ca + fixedbuffer <-> fixedbufferCa (backward)
ks[317] = 0.0005       # Glu <-> GluOut (forward)
ks[318] = 2e-10        # Glu <-> GluOut (backward)
ks[319] = 0.4          # Ca + PLC <-> PLCCa (forward)
ks[320] = 0.001        # Ca + PLC <-> PLCCa (backward)
ks[321] = 0.7          # GqaGTP + PLC <-> PLCGqaGTP (forward)
ks[322] = 0.0007       # GqaGTP + PLC <-> PLCGqaGTP (backward)
ks[323] = 80.0         # Ca + PLCGqaGTP <-> PLCCaGqaGTP (forward)
ks[324] = 0.04         # Ca + PLCGqaGTP <-> PLCCaGqaGTP (backward)
ks[325] = 100.0        # GqaGTP + PLCCa <-> PLCCaGqaGTP (forward)
ks[326] = 0.01         # GqaGTP + PLCCa <-> PLCCaGqaGTP (backward)
ks[327] = 0.03         # PLCCa + Pip2 <-> PLCCaPip2 (forward)
ks[328] = 0.01         # PLCCa + Pip2 <-> PLCCaPip2 (backward)
ks[329] = 0.0003       # PLCCaPip2 --> PLCCaDAG + Ip3 (forward)
ks[330] = 0.2          # PLCCaDAG --> PLCCa + DAG (forward)
ks[331] = 15.0         # PLCCaGqaGTP + Pip2 <-> PLCCaGqaGTPPip2 (forward)
ks[332] = 0.075        # PLCCaGqaGTP + Pip2 <-> PLCCaGqaGTPPip2 (backward)
ks[333] = 0.25         # PLCCaGqaGTPPip2 --> PLCCaGqaGTPDAG + Ip3 (forward)
ks[334] = 1.0          # PLCCaGqaGTPDAG --> PLCCaGqaGTP + DAG (forward)
ks[335] = 2.0          # Ip3degrad + PIkinase <-> Ip3degPIk (forward)
ks[336] = 0.001        # Ip3degrad + PIkinase <-> Ip3degPIk (backward)
ks[337] = 0.001        # Ip3degPIk --> PIkinase + Pip2 (forward)
ks[338] = 0.012        # PLCGqaGTP --> PLC + GqaGDP (forward)
ks[339] = 0.012        # PLCCaGqaGTP --> PLCCa + GqaGDP (forward)
ks[340] = 0.001        # GqaGTP --> GqaGDP (forward)
ks[341] = 0.01         # GqaGDP --> Gqabg (forward)
ks[342] = 125.0        # Ca + DGL <-> CaDGL (forward)
ks[343] = 0.05         # Ca + DGL <-> CaDGL (backward)
ks[344] = 0.5          # DAG + CaDGL <-> DAGCaDGL (forward)
ks[345] = 0.001        # DAG + CaDGL <-> DAGCaDGL (backward)
ks[346] = 0.00025      # DAGCaDGL --> CaDGL + _2AG (forward)
ks[347] = 0.01         # Ip3 --> Ip3degrad (forward)
ks[348] = 0.005        # _2AG --> _2AGdegrad (forward)
ks[349] = 0.07         # DAG + DAGK <-> DAGKdag (forward)
ks[350] = 0.0008       # DAG + DAGK <-> DAGKdag (backward)
ks[351] = 0.0002       # DAGKdag --> PA (forward)
ks[352] = 13.3         # Ca + PKC <-> PKCCa (forward)
ks[353] = 0.05         # Ca + PKC <-> PKCCa (backward)
ks[354] = 0.015        # PKCCa + DAG <-> PKCt (forward)
ks[355] = 0.00015      # PKCCa + DAG <-> PKCt (backward)
ks[356] = 0.0168       # Glu + MGluR <-> MGluR_Glu (forward)
ks[357] = 0.0001       # Glu + MGluR <-> MGluR_Glu (backward)
ks[358] = 6.25e-05     # MGluR_Glu <-> MGluR_Glu_desens (forward)
ks[359] = 1e-06        # MGluR_Glu <-> MGluR_Glu_desens (backward)
ks[360] = 9.0          # Gqabg + MGluR_Glu <-> MGluR_Gqabg_Glu (forward)
ks[361] = 0.00136      # Gqabg + MGluR_Glu <-> MGluR_Gqabg_Glu (backward)
ks[362] = 0.0015       # MGluR_Gqabg_Glu --> GqaGTP + MGluR_Glu (forward)
ks[363] = 0.4          # GluR2 + PKCt <-> GluR2_PKCt (forward)
ks[364] = 0.0008       # GluR2 + PKCt <-> GluR2_PKCt (backward)
ks[365] = 0.0047       # GluR2_PKCt --> GluR2_S880 + PKCt (forward)
ks[366] = 0.4          # GluR2 + PKCp <-> GluR2_PKCp (forward)
ks[367] = 0.0008       # GluR2 + PKCp <-> GluR2_PKCp (backward)
ks[368] = 0.0047       # GluR2_PKCp --> GluR2_S880 + PKCp (forward)
ks[369] = 0.5          # GluR2_S880 + PP2A <-> GluR2_S880_PP2A (forward)
ks[370] = 0.005        # GluR2_S880 + PP2A <-> GluR2_S880_PP2A (backward)
ks[371] = 0.00015      # GluR2_S880_PP2A --> GluR2 + PP2A (forward)
ks[372] = 0.4          # GluR2_memb + PKCt <-> GluR2_memb_PKCt (forward)
ks[373] = 0.0008       # GluR2_memb + PKCt <-> GluR2_memb_PKCt (backward)
ks[374] = 0.0047       # GluR2_memb_PKCt --> GluR2_memb_S880 + PKCt (forward)
ks[375] = 0.4          # GluR2_memb + PKCp <-> GluR2_memb_PKCp (forward)
ks[376] = 0.0008       # GluR2_memb + PKCp <-> GluR2_memb_PKCp (backward)
ks[377] = 0.0047       # GluR2_memb_PKCp --> GluR2_memb_S880 + PKCp (forward)
ks[378] = 0.5          # GluR2_memb_S880 + PP2A <-> GluR2_memb_S880_PP2A (forward)
ks[379] = 0.005        # GluR2_memb_S880 + PP2A <-> GluR2_memb_S880_PP2A (backward)
ks[380] = 0.00015      # GluR2_memb_S880_PP2A --> GluR2_memb + PP2A (forward)
ks[381] = 0.00024545   # GluR2 <-> GluR2_memb (forward)
ks[382] = 0.0003       # GluR2 <-> GluR2_memb (backward)
ks[383] = 0.00024545   # GluR2_PKCt <-> GluR2_memb_PKCt (forward)
ks[384] = 0.0003       # GluR2_PKCt <-> GluR2_memb_PKCt (backward)
ks[385] = 0.00024545   # GluR2_PKCp <-> GluR2_memb_PKCp (forward)
ks[386] = 0.0003       # GluR2_PKCp <-> GluR2_memb_PKCp (backward)
ks[387] = 0.0055       # GluR2_S880 <-> GluR2_memb_S880 (forward)
ks[388] = 0.07         # GluR2_S880 <-> GluR2_memb_S880 (backward)
ks[389] = 0.0055       # GluR2_S880_PP2A <-> GluR2_memb_S880_PP2A (forward)
ks[390] = 0.07         # GluR2_S880_PP2A <-> GluR2_memb_S880_PP2A (backward)
ks[391] = 0.095        # ACh + M1R <-> AChM1R (forward)
ks[392] = 0.0025       # ACh + M1R <-> AChM1R (backward)
ks[393] = 24.0         # Gqabg + AChM1R <-> AChM1RGq (forward)
ks[394] = 0.00042      # Gqabg + AChM1R <-> AChM1RGq (backward)
ks[395] = 0.576        # Gqabg + M1R <-> M1RGq (forward)
ks[396] = 0.00042      # Gqabg + M1R <-> M1RGq (backward)
ks[397] = 3.96         # ACh + M1RGq <-> AChM1RGq (forward)
ks[398] = 0.0025       # ACh + M1RGq <-> AChM1RGq (backward)
ks[399] = 0.0005       # AChM1RGq --> GqaGTP + AChM1R (forward)
ks[400] = 0.006        # ACh --> ACh*0 (forward)
ks[401] = 0.6          # Ca + PLA2 <-> CaPLA2 (forward)
ks[402] = 0.003        # Ca + PLA2 <-> CaPLA2 (backward)
ks[403] = 22.0         # CaPLA2 + Pip2 <-> CaPLA2Pip2 (forward)
ks[404] = 0.444        # CaPLA2 + Pip2 <-> CaPLA2Pip2 (backward)
ks[405] = 0.111        # CaPLA2Pip2 --> CaPLA2 + AA (forward)
ks[406] = 0.001        # AA --> Pip2 (forward)
ks[407] = 0.005        # PKCt + AA <-> PKCp (forward)
ks[408] = 1.76e-07     # PKCt + AA <-> PKCp (backward)

for ialteredk in range(0,len(alteredks)):
  ks[alteredks[ialteredk]] = alteredk_factors[ialteredk]*ks[alteredks[ialteredk]]
reaction000 = rxd.Reaction(specs[0] + specs[9] <> specs[11], ks[0], ks[1])
reaction001 = rxd.Reaction(specs[11] > specs[9] + specs[1], ks[2])
reaction002 = rxd.Reaction(specs[0] + specs[10] <> specs[12], ks[3], ks[4])
reaction003 = rxd.Reaction(specs[12] > specs[10] + specs[1], ks[5])
reaction004 = rxd.Reaction(specs[1] + specs[3] <> specs[2], ks[6], ks[7])
reaction005 = rxd.Reaction(specs[2] > specs[0] + specs[3], ks[8])
reaction006 = rxd.Reaction(specs[0] + specs[4] <> specs[5], ks[9], ks[10])
reaction007 = rxd.Reaction(specs[13] <> specs[6], ks[11], ks[12])
reaction008 = rxd.Reaction(specs[13] + specs[14] <> specs[17], ks[13], ks[14])
reaction009 = rxd.Reaction(specs[17] + specs[15] <> specs[18], ks[15], ks[16])
reaction010 = rxd.Reaction(specs[15] + specs[14] <> specs[39], ks[17], ks[18])
reaction011 = rxd.Reaction(specs[39] + specs[13] <> specs[18], ks[19], ks[20])
reaction012 = rxd.Reaction(specs[18] > specs[46] + specs[40], ks[21])
reaction013 = rxd.Reaction(specs[46] > specs[17] + specs[45], ks[22])
reaction014 = rxd.Reaction(specs[17] + specs[88] <> specs[19], ks[23], ks[24])
reaction015 = rxd.Reaction(specs[19] > specs[23] + specs[88], ks[25])
reaction016 = rxd.Reaction(specs[23] + specs[88] <> specs[20], ks[26], ks[27])
reaction017 = rxd.Reaction(specs[20] > specs[24] + specs[88], ks[28])
reaction018 = rxd.Reaction(specs[24] + specs[88] <> specs[21], ks[29], ks[30])
reaction019 = rxd.Reaction(specs[21] > specs[25] + specs[88], ks[31])
reaction020 = rxd.Reaction(specs[25] + specs[88] <> specs[22], ks[32], ks[33])
reaction021 = rxd.Reaction(specs[22] > specs[26] + specs[88], ks[34])
reaction022 = rxd.Reaction(specs[26] + specs[16] <> specs[27], ks[35], ks[36])
reaction023 = rxd.Reaction(specs[27] > specs[28] + specs[42], ks[37])
reaction024 = rxd.Reaction(specs[28] > specs[26] + specs[44], ks[38])
reaction025 = rxd.Reaction(specs[23] > specs[17], ks[39])
reaction026 = rxd.Reaction(specs[24] > specs[23], ks[40])
reaction027 = rxd.Reaction(specs[25] > specs[24], ks[41])
reaction028 = rxd.Reaction(specs[26] > specs[25], ks[42])
reaction029 = rxd.Reaction(specs[14] + specs[88] <> specs[29], ks[43], ks[44])
reaction030 = rxd.Reaction(specs[29] > specs[33] + specs[88], ks[45])
reaction031 = rxd.Reaction(specs[33] + specs[88] <> specs[30], ks[46], ks[47])
reaction032 = rxd.Reaction(specs[30] > specs[34] + specs[88], ks[48])
reaction033 = rxd.Reaction(specs[34] + specs[88] <> specs[31], ks[49], ks[50])
reaction034 = rxd.Reaction(specs[31] > specs[35] + specs[88], ks[51])
reaction035 = rxd.Reaction(specs[35] + specs[88] <> specs[32], ks[52], ks[53])
reaction036 = rxd.Reaction(specs[32] > specs[36] + specs[88], ks[54])
reaction037 = rxd.Reaction(specs[36] + specs[16] <> specs[37], ks[55], ks[56])
reaction038 = rxd.Reaction(specs[37] > specs[38] + specs[42], ks[57])
reaction039 = rxd.Reaction(specs[38] > specs[36] + specs[44], ks[58])
reaction040 = rxd.Reaction(specs[33] > specs[14], ks[59])
reaction041 = rxd.Reaction(specs[34] > specs[33], ks[60])
reaction042 = rxd.Reaction(specs[35] > specs[34], ks[61])
reaction043 = rxd.Reaction(specs[36] > specs[35], ks[62])
reaction044 = rxd.Reaction(specs[40] > specs[41], ks[63])
reaction045 = rxd.Reaction(specs[41] + specs[45] > specs[15], ks[64])
reaction046 = rxd.Reaction(specs[42] > specs[43], ks[65])
reaction047 = rxd.Reaction(specs[43] + specs[44] > specs[16], ks[66])
reaction048 = rxd.Reaction(specs[40] + specs[47] <> specs[48], ks[67], ks[68])
reaction049 = rxd.Reaction(specs[48] + specs[72] <> specs[49], ks[69], ks[70])
reaction050 = rxd.Reaction(specs[49] + specs[57] <> specs[50], ks[71], ks[72])
reaction051 = rxd.Reaction(specs[50] > specs[58] + specs[49], ks[73])
reaction052 = rxd.Reaction(specs[42] + specs[48] <> specs[54], ks[74], ks[75])
reaction053 = rxd.Reaction(specs[54] + specs[72] <> specs[55], ks[76], ks[77])
reaction054 = rxd.Reaction(specs[55] + specs[57] <> specs[56], ks[78], ks[79])
reaction055 = rxd.Reaction(specs[56] > specs[58] + specs[55], ks[80])
reaction056 = rxd.Reaction(specs[42] + specs[59] <> specs[52], ks[81], ks[82])
reaction057 = rxd.Reaction(specs[52] + specs[57] <> specs[53], ks[83], ks[84])
reaction058 = rxd.Reaction(specs[53] > specs[58] + specs[52], ks[85])
reaction059 = rxd.Reaction(specs[47] + specs[72] <> specs[59], ks[86], ks[87])
reaction060 = rxd.Reaction(specs[59] + specs[57] <> specs[60], ks[88], ks[89])
reaction061 = rxd.Reaction(specs[60] > specs[58] + specs[59], ks[90])
reaction062 = rxd.Reaction(specs[51] + specs[40] <> specs[54], ks[91], ks[92])
reaction063 = rxd.Reaction(specs[61] + specs[72] <> specs[62], ks[93], ks[94])
reaction064 = rxd.Reaction(specs[62] + specs[57] <> specs[63], ks[95], ks[96])
reaction065 = rxd.Reaction(specs[63] > specs[58] + specs[62], ks[97])
reaction066 = rxd.Reaction(specs[70] + specs[0]*2 <> specs[71], ks[98]*specs[70]*specs[0], ks[99]*specs[71], custom_dynamics=True)
reaction067 = rxd.Reaction(specs[71] + specs[0]*2 <> specs[72], ks[100]*specs[71]*specs[0], ks[101]*specs[72], custom_dynamics=True)
reaction068 = rxd.Reaction(specs[70] + specs[68] <> specs[69], ks[102], ks[103])
reaction069 = rxd.Reaction(specs[70] + specs[73] <> specs[74], ks[104], ks[105])
reaction070 = rxd.Reaction(specs[71] + specs[73] <> specs[75], ks[106], ks[107])
reaction071 = rxd.Reaction(specs[72] + specs[73] <> specs[76], ks[108], ks[109])
reaction072 = rxd.Reaction(specs[74] + specs[0]*2 <> specs[75], ks[110]*specs[74]*specs[0], ks[111]*specs[75], custom_dynamics=True)
reaction073 = rxd.Reaction(specs[75] + specs[0]*2 <> specs[76], ks[112]*specs[75]*specs[0], ks[113]*specs[76], custom_dynamics=True)
reaction074 = rxd.Reaction(specs[72] + specs[77] <> specs[78], ks[114], ks[115])
reaction075 = rxd.Reaction(specs[78]*2 <> specs[81], ks[116], ks[117])
reaction076 = rxd.Reaction(specs[79] + specs[78] <> specs[82], ks[118], ks[119])
reaction077 = rxd.Reaction(specs[79] + specs[81] > specs[79] + specs[82], ks[120])
reaction078 = rxd.Reaction(specs[78] + specs[81] > specs[78] + specs[82], ks[121])
reaction079 = rxd.Reaction(specs[81]*2 > specs[81] + specs[82], ks[122])
reaction080 = rxd.Reaction(specs[81] + specs[82] > specs[82]*2, ks[123])
reaction081 = rxd.Reaction(specs[79] <> specs[72] + specs[80], ks[124], ks[125])
reaction082 = rxd.Reaction(specs[80] + specs[92] <> specs[83], ks[126], ks[127])
reaction083 = rxd.Reaction(specs[83] > specs[92] + specs[77], ks[128])
reaction084 = rxd.Reaction(specs[79] + specs[92] <> specs[84], ks[129], ks[130])
reaction085 = rxd.Reaction(specs[84] > specs[92] + specs[78], ks[131])
reaction086 = rxd.Reaction(specs[85] + specs[58]*4 <> specs[86], ks[132], ks[133])
reaction087 = rxd.Reaction(specs[7] + specs[58] <> specs[8], ks[134], ks[135])
reaction088 = rxd.Reaction(specs[89] + specs[88] <> specs[90], ks[136], ks[137])
reaction089 = rxd.Reaction(specs[90] > specs[91] + specs[88], ks[138])
reaction090 = rxd.Reaction(specs[91] + specs[92] <> specs[93], ks[139], ks[140])
reaction091 = rxd.Reaction(specs[91] + specs[76] <> specs[94], ks[141], ks[142])
reaction092 = rxd.Reaction(specs[94] > specs[89] + specs[76], ks[143])
reaction093 = rxd.Reaction(specs[93] + specs[76] <> specs[95], ks[144], ks[145])
reaction094 = rxd.Reaction(specs[95] > specs[89] + specs[96], ks[146])
reaction095 = rxd.Reaction(specs[96] > specs[92] + specs[76], ks[147])
reaction096 = rxd.Reaction(specs[97] + specs[88] <> specs[101], ks[148], ks[149])
reaction097 = rxd.Reaction(specs[101] > specs[98] + specs[88], ks[150])
reaction098 = rxd.Reaction(specs[97] + specs[78] <> specs[102], ks[151], ks[152])
reaction099 = rxd.Reaction(specs[102] > specs[99] + specs[78], ks[153])
reaction100 = rxd.Reaction(specs[97] + specs[79] <> specs[103], ks[154], ks[155])
reaction101 = rxd.Reaction(specs[103] > specs[99] + specs[79], ks[156])
reaction102 = rxd.Reaction(specs[97] + specs[80] <> specs[104], ks[157], ks[158])
reaction103 = rxd.Reaction(specs[104] > specs[99] + specs[80], ks[159])
reaction104 = rxd.Reaction(specs[97] + specs[170] <> specs[105], ks[160], ks[161])
reaction105 = rxd.Reaction(specs[105] > specs[99] + specs[170], ks[162])
reaction106 = rxd.Reaction(specs[97] + specs[171] <> specs[106], ks[163], ks[164])
reaction107 = rxd.Reaction(specs[106] > specs[99] + specs[171], ks[165])
reaction108 = rxd.Reaction(specs[98] + specs[78] <> specs[107], ks[166], ks[167])
reaction109 = rxd.Reaction(specs[107] > specs[100] + specs[78], ks[168])
reaction110 = rxd.Reaction(specs[98] + specs[79] <> specs[108], ks[169], ks[170])
reaction111 = rxd.Reaction(specs[108] > specs[100] + specs[79], ks[171])
reaction112 = rxd.Reaction(specs[98] + specs[80] <> specs[109], ks[172], ks[173])
reaction113 = rxd.Reaction(specs[109] > specs[100] + specs[80], ks[174])
reaction114 = rxd.Reaction(specs[98] + specs[170] <> specs[110], ks[175], ks[176])
reaction115 = rxd.Reaction(specs[110] > specs[100] + specs[170], ks[177])
reaction116 = rxd.Reaction(specs[98] + specs[171] <> specs[111], ks[178], ks[179])
reaction117 = rxd.Reaction(specs[111] > specs[100] + specs[171], ks[180])
reaction118 = rxd.Reaction(specs[99] + specs[88] <> specs[112], ks[181], ks[182])
reaction119 = rxd.Reaction(specs[112] > specs[100] + specs[88], ks[183])
reaction120 = rxd.Reaction(specs[98] + specs[92] <> specs[113], ks[184], ks[185])
reaction121 = rxd.Reaction(specs[113] > specs[97] + specs[92], ks[186])
reaction122 = rxd.Reaction(specs[100] + specs[92] <> specs[114], ks[187], ks[188])
reaction123 = rxd.Reaction(specs[114] > specs[98] + specs[92], ks[189])
reaction124 = rxd.Reaction(specs[114] > specs[99] + specs[92], ks[190])
reaction125 = rxd.Reaction(specs[99] + specs[92] <> specs[115], ks[191], ks[192])
reaction126 = rxd.Reaction(specs[115] > specs[97] + specs[92], ks[193])
reaction127 = rxd.Reaction(specs[98] + specs[76] <> specs[116], ks[194], ks[195])
reaction128 = rxd.Reaction(specs[116] > specs[97] + specs[76], ks[196])
reaction129 = rxd.Reaction(specs[100] + specs[76] <> specs[117], ks[197], ks[198])
reaction130 = rxd.Reaction(specs[117] > specs[99] + specs[76], ks[199])
reaction131 = rxd.Reaction(specs[118] + specs[88] <> specs[122], ks[200], ks[201])
reaction132 = rxd.Reaction(specs[122] > specs[119] + specs[88], ks[202])
reaction133 = rxd.Reaction(specs[118] + specs[78] <> specs[123], ks[203], ks[204])
reaction134 = rxd.Reaction(specs[123] > specs[120] + specs[78], ks[205])
reaction135 = rxd.Reaction(specs[118] + specs[79] <> specs[124], ks[206], ks[207])
reaction136 = rxd.Reaction(specs[124] > specs[120] + specs[79], ks[208])
reaction137 = rxd.Reaction(specs[118] + specs[80] <> specs[125], ks[209], ks[210])
reaction138 = rxd.Reaction(specs[125] > specs[120] + specs[80], ks[211])
reaction139 = rxd.Reaction(specs[118] + specs[170] <> specs[126], ks[212], ks[213])
reaction140 = rxd.Reaction(specs[126] > specs[120] + specs[170], ks[214])
reaction141 = rxd.Reaction(specs[118] + specs[171] <> specs[127], ks[215], ks[216])
reaction142 = rxd.Reaction(specs[127] > specs[120] + specs[171], ks[217])
reaction143 = rxd.Reaction(specs[119] + specs[78] <> specs[128], ks[218], ks[219])
reaction144 = rxd.Reaction(specs[128] > specs[121] + specs[78], ks[220])
reaction145 = rxd.Reaction(specs[119] + specs[79] <> specs[129], ks[221], ks[222])
reaction146 = rxd.Reaction(specs[129] > specs[121] + specs[79], ks[223])
reaction147 = rxd.Reaction(specs[119] + specs[80] <> specs[130], ks[224], ks[225])
reaction148 = rxd.Reaction(specs[130] > specs[121] + specs[80], ks[226])
reaction149 = rxd.Reaction(specs[119] + specs[170] <> specs[131], ks[227], ks[228])
reaction150 = rxd.Reaction(specs[131] > specs[121] + specs[170], ks[229])
reaction151 = rxd.Reaction(specs[119] + specs[171] <> specs[132], ks[230], ks[231])
reaction152 = rxd.Reaction(specs[132] > specs[121] + specs[171], ks[232])
reaction153 = rxd.Reaction(specs[120] + specs[88] <> specs[133], ks[233], ks[234])
reaction154 = rxd.Reaction(specs[133] > specs[121] + specs[88], ks[235])
reaction155 = rxd.Reaction(specs[119] + specs[92] <> specs[134], ks[236], ks[237])
reaction156 = rxd.Reaction(specs[134] > specs[118] + specs[92], ks[238])
reaction157 = rxd.Reaction(specs[121] + specs[92] <> specs[135], ks[239], ks[240])
reaction158 = rxd.Reaction(specs[135] > specs[119] + specs[92], ks[241])
reaction159 = rxd.Reaction(specs[135] > specs[120] + specs[92], ks[242])
reaction160 = rxd.Reaction(specs[120] + specs[92] <> specs[136], ks[243], ks[244])
reaction161 = rxd.Reaction(specs[136] > specs[118] + specs[92], ks[245])
reaction162 = rxd.Reaction(specs[119] + specs[76] <> specs[137], ks[246], ks[247])
reaction163 = rxd.Reaction(specs[137] > specs[118] + specs[76], ks[248])
reaction164 = rxd.Reaction(specs[121] + specs[76] <> specs[138], ks[249], ks[250])
reaction165 = rxd.Reaction(specs[138] > specs[120] + specs[76], ks[251])
reaction166 = rxd.Reaction(specs[97] <> specs[118], ks[252], ks[253])
reaction167 = rxd.Reaction(specs[101] <> specs[122], ks[254], ks[255])
reaction168 = rxd.Reaction(specs[102] <> specs[123], ks[256], ks[257])
reaction169 = rxd.Reaction(specs[103] <> specs[124], ks[258], ks[259])
reaction170 = rxd.Reaction(specs[104] <> specs[125], ks[260], ks[261])
reaction171 = rxd.Reaction(specs[105] <> specs[126], ks[262], ks[263])
reaction172 = rxd.Reaction(specs[106] <> specs[127], ks[264], ks[265])
reaction173 = rxd.Reaction(specs[99] <> specs[120], ks[266], ks[267])
reaction174 = rxd.Reaction(specs[112] <> specs[133], ks[268], ks[269])
reaction175 = rxd.Reaction(specs[115] <> specs[136], ks[270], ks[271])
reaction176 = rxd.Reaction(specs[98] <> specs[119], ks[272], ks[273])
reaction177 = rxd.Reaction(specs[107] <> specs[128], ks[274], ks[275])
reaction178 = rxd.Reaction(specs[108] <> specs[129], ks[276], ks[277])
reaction179 = rxd.Reaction(specs[109] <> specs[130], ks[278], ks[279])
reaction180 = rxd.Reaction(specs[110] <> specs[131], ks[280], ks[281])
reaction181 = rxd.Reaction(specs[111] <> specs[132], ks[282], ks[283])
reaction182 = rxd.Reaction(specs[100] <> specs[121], ks[284], ks[285])
reaction183 = rxd.Reaction(specs[113] <> specs[134], ks[286], ks[287])
reaction184 = rxd.Reaction(specs[114] <> specs[135], ks[288], ks[289])
reaction185 = rxd.Reaction(specs[116] <> specs[137], ks[290], ks[291])
reaction186 = rxd.Reaction(specs[117] <> specs[138], ks[292], ks[293])
reaction187 = rxd.Reaction(specs[64] + specs[72] <> specs[65], ks[294], ks[295])
reaction188 = rxd.Reaction(specs[65] + specs[58] <> specs[66], ks[296], ks[297])
reaction189 = rxd.Reaction(specs[66] > specs[65] + specs[67], ks[298])
reaction190 = rxd.Reaction(specs[67] > specs[57], ks[299])
reaction191 = rxd.Reaction(specs[139] + specs[58] <> specs[140], ks[300], ks[301])
reaction192 = rxd.Reaction(specs[140] > specs[139] + specs[67], ks[302])
reaction193 = rxd.Reaction(specs[88] + specs[139] <> specs[141], ks[303], ks[304])
reaction194 = rxd.Reaction(specs[141] > specs[142] + specs[88], ks[305])
reaction195 = rxd.Reaction(specs[142] > specs[139], ks[306])
reaction196 = rxd.Reaction(specs[142] + specs[58] <> specs[143], ks[307], ks[308])
reaction197 = rxd.Reaction(specs[143] > specs[142] + specs[67], ks[309])
reaction198 = rxd.Reaction(specs[140] + specs[88] <> specs[144], ks[310], ks[311])
reaction199 = rxd.Reaction(specs[144] > specs[143] + specs[88], ks[312])
reaction200 = rxd.Reaction(specs[86] <> specs[87] + specs[88]*2, ks[313]*specs[86], ks[314]*specs[87]*specs[88], custom_dynamics=True)
reaction201 = rxd.Reaction(specs[0] + specs[145] <> specs[146], ks[315], ks[316])
reaction202 = rxd.Reaction(specs[147] <> specs[152], ks[317], ks[318])
reaction203 = rxd.Reaction(specs[0] + specs[156] <> specs[157], ks[319], ks[320])
reaction204 = rxd.Reaction(specs[154] + specs[156] <> specs[159], ks[321], ks[322])
reaction205 = rxd.Reaction(specs[0] + specs[159] <> specs[158], ks[323], ks[324])
reaction206 = rxd.Reaction(specs[154] + specs[157] <> specs[158], ks[325], ks[326])
reaction207 = rxd.Reaction(specs[157] + specs[160] <> specs[161], ks[327], ks[328])
reaction208 = rxd.Reaction(specs[161] > specs[164] + specs[163], ks[329])
reaction209 = rxd.Reaction(specs[164] > specs[157] + specs[172], ks[330])
reaction210 = rxd.Reaction(specs[158] + specs[160] <> specs[162], ks[331], ks[332])
reaction211 = rxd.Reaction(specs[162] > specs[165] + specs[163], ks[333])
reaction212 = rxd.Reaction(specs[165] > specs[158] + specs[172], ks[334])
reaction213 = rxd.Reaction(specs[181] + specs[166] <> specs[167], ks[335], ks[336])
reaction214 = rxd.Reaction(specs[167] > specs[166] + specs[160], ks[337])
reaction215 = rxd.Reaction(specs[159] > specs[156] + specs[155], ks[338])
reaction216 = rxd.Reaction(specs[158] > specs[157] + specs[155], ks[339])
reaction217 = rxd.Reaction(specs[154] > specs[155], ks[340])
reaction218 = rxd.Reaction(specs[155] > specs[153], ks[341])
reaction219 = rxd.Reaction(specs[0] + specs[176] <> specs[177], ks[342], ks[343])
reaction220 = rxd.Reaction(specs[172] + specs[177] <> specs[178], ks[344], ks[345])
reaction221 = rxd.Reaction(specs[178] > specs[177] + specs[179], ks[346])
reaction222 = rxd.Reaction(specs[163] > specs[181], ks[347])
reaction223 = rxd.Reaction(specs[179] > specs[180], ks[348])
reaction224 = rxd.Reaction(specs[172] + specs[173] <> specs[174], ks[349], ks[350])
reaction225 = rxd.Reaction(specs[174] > specs[175], ks[351])
reaction226 = rxd.Reaction(specs[0] + specs[168] <> specs[169], ks[352], ks[353])
reaction227 = rxd.Reaction(specs[169] + specs[172] <> specs[170], ks[354], ks[355])
reaction228 = rxd.Reaction(specs[147] + specs[148] <> specs[149], ks[356], ks[357])
reaction229 = rxd.Reaction(specs[149] <> specs[150], ks[358], ks[359])
reaction230 = rxd.Reaction(specs[153] + specs[149] <> specs[151], ks[360], ks[361])
reaction231 = rxd.Reaction(specs[151] > specs[154] + specs[149], ks[362])
reaction232 = rxd.Reaction(specs[182] + specs[170] <> specs[183], ks[363], ks[364])
reaction233 = rxd.Reaction(specs[183] > specs[185] + specs[170], ks[365])
reaction234 = rxd.Reaction(specs[182] + specs[171] <> specs[184], ks[366], ks[367])
reaction235 = rxd.Reaction(specs[184] > specs[185] + specs[171], ks[368])
reaction236 = rxd.Reaction(specs[185] + specs[192] <> specs[186], ks[369], ks[370])
reaction237 = rxd.Reaction(specs[186] > specs[182] + specs[192], ks[371])
reaction238 = rxd.Reaction(specs[187] + specs[170] <> specs[188], ks[372], ks[373])
reaction239 = rxd.Reaction(specs[188] > specs[190] + specs[170], ks[374])
reaction240 = rxd.Reaction(specs[187] + specs[171] <> specs[189], ks[375], ks[376])
reaction241 = rxd.Reaction(specs[189] > specs[190] + specs[171], ks[377])
reaction242 = rxd.Reaction(specs[190] + specs[192] <> specs[191], ks[378], ks[379])
reaction243 = rxd.Reaction(specs[191] > specs[187] + specs[192], ks[380])
reaction244 = rxd.Reaction(specs[182] <> specs[187], ks[381], ks[382])
reaction245 = rxd.Reaction(specs[183] <> specs[188], ks[383], ks[384])
reaction246 = rxd.Reaction(specs[184] <> specs[189], ks[385], ks[386])
reaction247 = rxd.Reaction(specs[185] <> specs[190], ks[387], ks[388])
reaction248 = rxd.Reaction(specs[186] <> specs[191], ks[389], ks[390])
reaction249 = rxd.Reaction(specs[193] + specs[194] <> specs[195], ks[391], ks[392])
reaction250 = rxd.Reaction(specs[153] + specs[195] <> specs[197], ks[393], ks[394])
reaction251 = rxd.Reaction(specs[153] + specs[194] <> specs[196], ks[395], ks[396])
reaction252 = rxd.Reaction(specs[193] + specs[196] <> specs[197], ks[397], ks[398])
reaction253 = rxd.Reaction(specs[197] > specs[154] + specs[195], ks[399])
reaction254 = rxd.Reaction(specs[193] > specs[193]*0, ks[400])
reaction255 = rxd.Reaction(specs[0] + specs[198] <> specs[199], ks[401], ks[402])
reaction256 = rxd.Reaction(specs[199] + specs[160] <> specs[200], ks[403], ks[404])
reaction257 = rxd.Reaction(specs[200] > specs[199] + specs[201], ks[405])
reaction258 = rxd.Reaction(specs[201] > specs[160], ks[406])
reaction259 = rxd.Reaction(specs[170] + specs[201] <> specs[171], ks[407], ks[408])

reaction_Ca_flux = rxd.Rate(specs[0], Ca_flux_rate) # Ca
reaction_L_flux = rxd.Rate(specs[13], L_flux_rate) # L
reaction_Glu_flux = rxd.Rate(specs[147], Glu_flux_rate) # Glu
reaction_ACh_flux = rxd.Rate(specs[193], ACh_flux_rate) # ACh
vec_t = h.Vector()

vecs = []
vec_t = h.Vector()
vec_t.record(h._ref_t)
toRecord = [0]*len(species)
Measured_species = protocols_many.get_measurement_protocol()[4]
for ispec in range(0,len(species)):
  vecs.append(h.Vector())
  toRecord[ispec] = 1+(species[ispec]=='Ca')
  if toRecord[ispec] == 2:
    vecs[ispec].record(specs[ispec].nodes(dend)(0.5)[0]._ref_concentration)
  elif toRecord[ispec] == 1:
    vecs[ispec].record(specs[ispec].nodes(dend)(0.5)[0]._ref_concentration,1000)

cvode = h.CVode()
cvode.active(1)
hmax = cvode.maxstep(1000)
hmin = cvode.minstep(1e-10)
cvode.atol(tolerance)

h.finitialize(-65)
def set_param(param, val):
    param.nodes.value = val
    h.cvode.re_init()

### Set on and off the inputs to the spine
T = 1000./Ca_input_freq
tnow = 0
for itrain in range(0,Ntrains):
    for istim in range(0,Ca_input_N):
      tnew = Ca_input_onset + istim*T + trainT*itrain
      h.cvode.event(tnew, lambda: set_param(Ca_flux_rate, Ca_input_flux/6.022e23/my_volume*1e3))
      h.cvode.event(tnew+Ca_input_dur, lambda: set_param(Ca_flux_rate, 0))
      h.cvode.event(tnew, lambda: set_param(L_flux_rate, L_input_flux/6.022e23/my_volume*1e3))
      h.cvode.event(tnew+Ca_input_dur, lambda: set_param(L_flux_rate, 0))
      h.cvode.event(tnew, lambda: set_param(Glu_flux_rate, Glu_input_flux/6.022e23/my_volume*1e3))
      h.cvode.event(tnew+Ca_input_dur, lambda: set_param(Glu_flux_rate, 0))
      h.cvode.event(tnew, lambda: set_param(ACh_flux_rate, ACh_input_flux/6.022e23/my_volume*1e3))
      h.cvode.event(tnew+Ca_input_dur, lambda: set_param(ACh_flux_rate, 0))
      tnow = tnew
timenow = time.time()
h.continuerun(Duration)
print "Simulation done in "+str(time.time()-timenow)+" seconds"
def isFlux(t):
  for itrain in range(0,Ntrains):
    for istim in range(0,Ca_input_N):
      tnew = Ca_input_onset + istim*T + trainT*itrain
      if t >= tnew and t < tnew+Ca_input_dur:
        return 1
  return 0
tvec = array(vec_t)
minDT_nonFlux = 20.0
minDT_Flux = 1.0
lastt = -inf
itvec2 = []
for it in range(0,len(tvec)):
  if tvec[it] - lastt > minDT_nonFlux or (isFlux(tvec[it]) and tvec[it] - lastt > minDT_Flux):
    itvec2.append(it)
    lastt = tvec[it]

headers = [ 'tvec', 'Ca', 'CaOut', 'CaOutLeak', 'Leak', 'Calbin', 'CalbinC', 'LOut', 'Epac1', 'Epac1cAMP', 'PMCA', 'NCX', 'PMCACa', 'NCXCa', 'L', 'R', 'Gs', 'Gi', 'LR', 'LRGs', 'PKAcLR', 'PKAcpLR', 'PKAcppLR', 'PKAcpppLR', 'pLR', 'ppLR', 'pppLR', 'ppppLR', 'ppppLRGi', 'ppppLRGibg', 'PKAcR', 'PKAcpR', 'PKAcppR', 'PKAcpppR', 'pR', 'ppR', 'pppR', 'ppppR', 'ppppRGi', 'ppppRGibg', 'GsR', 'GsaGTP', 'GsaGDP', 'GiaGTP', 'GiaGDP', 'Gibg', 'Gsbg', 'LRGsbg', 'AC1', 'AC1GsaGTP', 'AC1GsaGTPCaMCa4', 'AC1GsaGTPCaMCa4ATP', 'AC1GiaGTP', 'AC1GiaGTPCaMCa4', 'AC1GiaGTPCaMCa4ATP', 'AC1GsaGTPGiaGTP', 'AC1GsaGTPGiaGTPCaMCa4', 'AC1GsGiCaMCa4ATP', 'ATP', 'cAMP', 'AC1CaMCa4', 'AC1CaMCa4ATP', 'AC8', 'AC8CaMCa4', 'AC8CaMCa4ATP', 'PDE1', 'PDE1CaMCa4', 'PDE1CaMCa4cAMP', 'AMP', 'Ng', 'NgCaM', 'CaM', 'CaMCa2', 'CaMCa4', 'PP2B', 'PP2BCaM', 'PP2BCaMCa2', 'PP2BCaMCa4', 'CK', 'CKCaMCa4', 'CKpCaMCa4', 'CKp', 'Complex', 'pComplex', 'CKpPP1', 'CKpCaMCa4PP1', 'PKA', 'PKAcAMP4', 'PKAr', 'PKAc', 'I1', 'I1PKAc', 'Ip35', 'PP1', 'Ip35PP1', 'Ip35PP2BCaMCa4', 'Ip35PP1PP2BCaMCa4', 'PP1PP2BCaMCa4', 'GluR1', 'GluR1_S845', 'GluR1_S831', 'GluR1_S845_S831', 'GluR1_PKAc', 'GluR1_CKCam', 'GluR1_CKpCam', 'GluR1_CKp', 'GluR1_PKCt', 'GluR1_PKCp', 'GluR1_S845_CKCam', 'GluR1_S845_CKpCam', 'GluR1_S845_CKp', 'GluR1_S845_PKCt', 'GluR1_S845_PKCp', 'GluR1_S831_PKAc', 'GluR1_S845_PP1', 'GluR1_S845_S831_PP1', 'GluR1_S831_PP1', 'GluR1_S845_PP2B', 'GluR1_S845_S831_PP2B', 'GluR1_memb', 'GluR1_memb_S845', 'GluR1_memb_S831', 'GluR1_memb_S845_S831', 'GluR1_memb_PKAc', 'GluR1_memb_CKCam', 'GluR1_memb_CKpCam', 'GluR1_memb_CKp', 'GluR1_memb_PKCt', 'GluR1_memb_PKCp', 'GluR1_memb_S845_CKCam', 'GluR1_memb_S845_CKpCam', 'GluR1_memb_S845_CKp', 'GluR1_memb_S845_PKCt', 'GluR1_memb_S845_PKCp', 'GluR1_memb_S831_PKAc', 'GluR1_memb_S845_PP1', 'GluR1_memb_S845_S831_PP1', 'GluR1_memb_S831_PP1', 'GluR1_memb_S845_PP2B', 'GluR1_memb_S845_S831_PP2B', 'PDE4', 'PDE4cAMP', 'PKAcPDE4', 'pPDE4', 'pPDE4cAMP', 'PKAc_PDE4_cAMP', 'fixedbuffer', 'fixedbufferCa', 'Glu', 'MGluR', 'MGluR_Glu', 'MGluR_Glu_desens', 'MGluR_Gqabg_Glu', 'GluOut', 'Gqabg', 'GqaGTP', 'GqaGDP', 'PLC', 'PLCCa', 'PLCCaGqaGTP', 'PLCGqaGTP', 'Pip2', 'PLCCaPip2', 'PLCCaGqaGTPPip2', 'Ip3', 'PLCCaDAG', 'PLCCaGqaGTPDAG', 'PIkinase', 'Ip3degPIk', 'PKC', 'PKCCa', 'PKCt', 'PKCp', 'DAG', 'DAGK', 'DAGKdag', 'PA', 'DGL', 'CaDGL', 'DAGCaDGL', '2AG', '2AGdegrad', 'Ip3degrad', 'GluR2', 'GluR2_PKCt', 'GluR2_PKCp', 'GluR2_S880', 'GluR2_S880_PP2A', 'GluR2_memb', 'GluR2_memb_PKCt', 'GluR2_memb_PKCp', 'GluR2_memb_S880', 'GluR2_memb_S880_PP2A', 'PP2A', 'ACh', 'M1R', 'AChM1R', 'M1RGq', 'AChM1RGq', 'PLA2', 'CaPLA2', 'CaPLA2Pip2', 'AA' ]

myonset = Ca_input_onset
if myonset > max(tvec):
  myonset = 0
interptimes = [myonset + 1000*i for i in range(-10,int((max(tvec)-myonset)/1000))]
if interptimes[0] < 0:
  interptimes = interptimes[1:]
interpDATA = []
for j in range(0,len(species)):
  if toRecord[j]==2:
    interpDATA.append(mytools.interpolate(tvec,vecs[j],interptimes))
  elif toRecord[j]==1:
    interpDATA.append(mytools.interpolate([1000.0*x for x in range(0,len(vecs[j]))],vecs[j],interptimes))
  else:
    interpDATA.append([0 for x in interptimes])
tcDATA = array([interptimes]+interpDATA)
maxDATA = [max(tvec)]+[0.0 for i in range(0,len(species))]
for ispec in range(0,len(species)):
  if toRecord[ispec]:
    maxDATA[1+ispec] = max(array(vecs[ispec]))
scipy.io.savemat(filename,{'DATA': tcDATA, 'maxDATA': maxDATA, 'headers': headers})

Loading data, please wait...