-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathNRTprocs.hoc
executable file
·283 lines (259 loc) · 13 KB
/
NRTprocs.hoc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
// Perform NRT cell related computing and simulation routines
objref cell, stim, stimMinisE, stimMinisI, synE, synI, ncSynE, ncSynI, syn, ncSyn
cell = new NRTcell(0, 0, 0, "FO")
/* A procedure for rescaling the error tolerances of states when using cvode. */
proc rescaleET() {local precision
if (varDt || varDt_local) {
precision = 1e-4
cvode.atolscale("v", max(precision, 10))
cvode.atolscale("nai", max(precision, 10))
cvode.atolscale("cai", max(precision, 1e-4))
cvode.atolscale("cahvai", max(precision, 1e-4))
cvode.atolscale("m1_iahp", max(precision, 0.01))
cvode.atolscale("m2_iahp", max(precision, 0.1))
cvode.atolscale("mCa_icanm", max(precision, 0.1))
cvode.atolscale("hCa_icanm", max(precision, 1))
cvode.atolscale("m_ihvaNRT", max(precision, 0.1))
//cvode.atolscale("n_ikna", max(precision, 1))
cvode.atolscale("m_inap", max(precision, 1))
cvode.atolscale("m_its", max(precision, 1))
cvode.atolscale("h_its", max(precision, 0.01))
cvode.atolscale("p0_iarg", max(precision, 1))
cvode.atolscale("p1_iarg", max(precision, 1))
cvode.atolscale("c_iarg", max(precision, 1))
cvode.atolscale("o1_iarg", max(precision, 0.1))
cvode.atolscale("o2_iarg", max(precision, 1))
cvode.atolscale("m_hhT", max(precision, 1))
cvode.atolscale("h_hhT", max(precision, 1))
cvode.atolscale("n_hhT", max(precision, 0.1))
if (randomise.x[4]) {
cvode.atolscale("AMPA_S.Ron", max(precision, 0.01))
cvode.atolscale("AMPA_S.Roff", max(precision, 0.01))
cvode.atolscale("GABAa_S.Ron", max(precision, 0.001))
cvode.atolscale("GABAa_S.Roff", max(precision, 0.001))
}
}
}
/* A procedure for setting up minis. */
proc miniStim() {local smooth
smooth = 1 // increase to smooth the appearance of the voltage trace
stimMinisE = new minisI()
stimMinisE.interval = (1/smooth)*75
stimMinisE.noise = 1
cell.createSyn("AMPA", 1)
synE = cell.getSyn("AMPA")
ncSynE = new NetCon(stimMinisE, synE)
ncSynE.delay = 0
ncSynE.weight = (1/smooth)*0.021 // 0.021: ~0.2 mV @-65 mV and Ri = ~160 MOhms
stimMinisI = new minisI()
stimMinisI.interval = (1/smooth)*150
stimMinisI.noise = 1
cell.createSyn("GABAa", 1)
synI = cell.getSyn("GABAa")
ncSynI = new NetCon(stimMinisI, synI)
ncSynI.delay = 0
ncSynI.weight = (1/smooth)*0.06 // 0.06: ~-0.2 mV @-65 mV and Ri = ~160 MOhms
}
/* A procedure for delivering a number of synaptic stimuli to a cell. */
proc testStim() {
stim = new NetStim()
stim.interval = 10
stim.number = 10
stim.start = 31e3
cell.createSyn("GLU", 1)
syn = cell.getSyn("GLU")
ncSyn = new NetCon(stim, syn)
ncSyn.delay = 0
ncSyn.weight = 1*(10*(3*0.052))
//stim = stimFamily(cell, 1000, 100, 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.17, 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)
singleRun(cell, saveData)
}
/* A procedure fot multiple runs using a current clamp for testing voltage
dependence of rhythmic burst firing in NRT cells. */
proc testvdBurst() {local i
for (i = 0.00010; i <= 0.00160; i += 0.00025) {
cell.soma.gkbar1_iahp(0.5) = i
cell.soma.gkbar2_iahp(0.5) = 0.1*cell.soma.gkbar1_iahp(0.5)
stimLoop13(cell, 0.15, -0.065, -0.005, -0.225, 5e3, saveData)
print i
}
}
/* A procedure for a double voltage clamp run in order to obtain subtracted
I_AHP. */
proc testIAHP() {localobj cell2
vClampLoop(cell, 2, -100, -100, 5, -60, -60, 5e3, 125, 8001, saveData)
cell2 = new NRTcell()
cell2.soma.gkbar1_iahp = 0
cell2.soma.gkbar2_iahp = 0
vClampLoop(cell2, 2, -100, -100, 5, -60, -60, 5e3, 125, 8001, saveData)
}
/* A procedure for exploring the role of I_h papameters in determining the
oscillatory behaviour of the NRT cell. */
proc testIh() {local i, j, k, k2, l, power localobj data, clamp
if (saveData) {
data = new NRTdata(cell, clamp, saveData)
}
for (i = 6*0.0000043; i <= 6*0.0000043; i += 0.000001) {
cell.soma.ghbar_iarg = i
for (j = 0; j <= 0; j += 10) {
cell.soma.shift_iarg = j
//for (k = 0.0000220; k <= 0.0000500; k += 0.0000001) {
//for (k = 0.0000197; k <= 0.0000197; k += 0.0000001) {
for (k = 0.0000240; k <= 0.0000240; k += 0.0000001) {
//for (k = 0.0000400; k <= 0.0000400; k += 0.0000001) {
//for (k = 0.0000240; k <= 0.0000440; k += 0.0000001) {
//for (k = 0.0000220; k <= 0.0000440; k += 0.000001) {
k2 = k
cell.soma.g_pas = k2
for (l = -0.010; l <= 0.080; l += 0.001) {
//for (l = -0.040; l <= -0.010; l += 0.001) {
//for (l = 0.050; l <= 0.060; l += 0.001) {
//for (l = 0.061; l <= 0.100; l += 0.001) {
//for (l = 0.101; l <= 0.200; l += 0.001) {
//for (l = 0.000; l <= 0.000; l += 0.001) {
stimSingleAdj(stim, 0e3, tstop, -l)
runMain()
if (saveData) {
strdef dataFile
if (varDt && !varDt_local) {
sprint(dataFile, "x%g_20_%1.6f_NRT0data%1.7f_%3.0f_%1.7f_%1.4f.dat", saveData, cell.soma.gkbar1_iahp(0.5), i, 75-j, k2, l)
} else if (varDt && varDt_local) {
sprint(dataFile, "y%g_20_%1.6f_NRT0data%1.7f_%3.0f_%1.7f_%1.4f.dat", saveData, cell.soma.gkbar1_iahp(0.5), i, 75-j, k2, l)
} else {
sprint(dataFile, "z%g_20_%1.6f_NRT0data%1.7f_%3.0f_%1.7f_%1.4f.dat", saveData, cell.soma.gkbar1_iahp(0.5), i, 75-j, k2, l)
}
data.save(dataFile)
}
}
}
print 75-j
}
}
}
/* A procedure for exploring the role of I_T papameters in determining the
oscillatory behaviour of the NRT cell. */
proc testIT() {local i, j, k, l, m localobj data, clamp
if (saveData) {
data = new NRTdata(cell, clamp, saveData)
}
for (i = 0.00069; i <= 0.00069; i += 0.00001) {
cell.soma.gcabar_its = i
for (j = 0; j <= 0; j += 1) {
cell.soma.mshift_its = j
for (k = 0; k <= 0; k += 1) {
cell.soma.hshift_its = k
for (l = 7.4; l <= 7.4; l += 1) {
cell.soma.km_its = l
for (m = 5.0; m <= 5.0; m += 0.5) {
cell.soma.kh_its = m
for (n = 0.0000150; n <= 0.0000150; n += 0.0000001) {
cell.soma.g_pas = n
runMain()
if (saveData) {
strdef dataFile
sprint(dataFile, "NRT0data%1.6f_%1.0f_%1.0f_%1.1f_%1.2f_%1.7f.dat", i, j, k, l, m, n)
data.save(dataFile)
}
}
}
}
}
}
}
}
proc testRB() {local i, count localobj data, clamp
if (saveData) {
data = new NRTdata(cell, clamp, saveData)
}
count = 0
//for (i = 0.03; i >= -0.20; i += -0.01) {
for (i = 0; i >= 0; i += -0.01) {
stim = stimFamily(cell, 10e3, 125, 9875, 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, i, -0.1, i, 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)
runMain()
if (saveData) {
strdef dataFile
if (count < 10) {
sprint(dataFile, "y%1.0fNRTdata00%g.dat", saveData, count)
} else if (count < 100) {
sprint(dataFile, "y%1.0fNRTdata0%g.dat", saveData, count)
} else {
sprint(dataFile, "y%1.0fNRTdata%g.dat", saveData, count)
}
data.save(dataFile)
}
count += 1
}
}
if (randomise.x[4]) {
miniStim()
}
rescaleET()
if (runMode == 0) {
addGraph("cell.soma.v(0.5)", 340, 120, 1500, 850)
testStim()
//singleRun(cell, saveData)
} else if (runMode == 1) {
addGraph("cell.soma.v(0.5)", 340, 120, 1500, 850)
// order start limit step base hold dur1 dur2 dur3
vClampLoop(cell, 3, -100, 40, 5, -50, -100, 1e3, 1e3, 1e3, saveData)
// test I_Ts: vClampLoop(cell, 3, -100, 40, 5, -50, -100, 1e3, 1e3, 1e3, saveData)
// test I_AHP: vClampLoop(cell, 2, -100, -100, 5, -60, -60, 5e3, 125, 8001, saveData)
// test I_h: vClampLoop(cell, 2, -110, -40, 5, -65, -65, 5e3, 5e3, 5e3, saveData)
// test I_NaP: vClampLoop(cell, 2, -100, 0, 5, -118, -118, 3e3, 1e3, 0, saveData)
// test I_Na: vClampLoop(cell, 3, -70, 40, 5, -50, -111, 1e3, 1e3, 1e3, saveData)
// test I_HVA: vClampLoop(cell, 3, -50, 50, 5, -50, -50, 1e3, 1e3, 1e3, saveData)
// test burst: vClampLoop(cell, 2, -85, -85, 5, -65, -65, 3e3, 3e3, 0e3, saveData)
} else if (runMode == 2) {
addGraph("cell.soma.v(0.5)", 340, 120, 1500, 850)
// dur1 dur2 dur3 amp1 amp2 amp3
//stim = stimFamily(cell, 2975, 125, 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.17, 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) // AHP
stim = stimFamily(cell, 10e3, 125, 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.17, 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) // Spindle rhythmicity (Bal & McCormick, 1993)
//stim = stimFamily(cell, 10e3, 340, 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.17, 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) // Spindle rhythmicity (Cueni et al., 2008)
//amp = 1
//base = 0 //-0.11
//dur = 100
//isi = 100
//stim = stimFamily(cell, 3e3, dur,isi, dur,isi, dur,isi, dur,isi, dur,isi, dur,isi, dur,isi, dur,isi, dur,isi, dur,isi, dur,isi, dur,isi, dur,isi, 0,0,0, base, amp,base, amp,base, amp,base, amp,base, amp,base, amp,base, amp,base, amp,base, amp,base, amp,base, amp,base, amp,base, amp,base, base,base,base)
singleRun(cell, saveData)
} else if (runMode == 3) {
addGraph("cell.soma.v(0.5)", 340, 120, 1500, 850)
amp2 = 0.0305
iStep = -0.02
amp3 = amp2 + iStep
dur = 5e3
dur2 = 15e3
// dur1 dur2 dur3 amp1 amp2 amp3
stim = stimFamily(cell, dur,dur2, dur, 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, amp2, amp3, 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)
singleRunRi(cell, iStep, dur, dur2, saveData)
amp = 0
amp2 = amp+0.01
amp3 = amp-0.01
dur = 5e3
dur2 = 1e3
dur3 = dur - dur2
// dur1 dur2 dur3 dur4, dur5 amp1 amp2 amp3 amp4 amp5
stimFamilyAdj(stim, dur, dur2, dur3, dur2, dur3,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, amp, amp2, amp, amp3, amp,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)
singleRunTau(cell, dur, dur2, saveData)
} else if (runMode == 4) {
atoltool()
} else if (runMode == 5) {
stimLoop(cell, 0, -0.1, -0.001, -0.150615, 10e3, saveData)
} else if (runMode == 6) {
addGraph("cell.soma.v(0.5)", 340, 120, 1500, 850)
//testvdBurst()
stim = stimSingle(cell, 0, 0, 0, "soma")
testIh()
//testIT()
//testRB()
} else if (runMode == 7) {
addGraph("cell.soma.v(0.5)", 340, 120, 1500, 850)
stim = stimSingle(cell, 0, 3e3, -0.1016, "soma")
// order start limit step base del dur1 dur2
//delClampLoop(cell, 1, -120, 20, 5, 0,3120, 1841, 0, saveData)
delClampLoop(cell, 1, -120, 20, 5, 0,3360, 5520, 0, saveData)
//delClampLoop(cell, 1, -120, 20, 5, 0,3210, 5670, 0, saveData)
} else if (runMode == 8) {
testIAHP()
} else if (runMode == 9) {
stimLoop13(cell, 0.06, -0.15, -0.001, -0.15, 5e3, saveData)
}