-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmsnd1.tem
422 lines (403 loc) · 11.5 KB
/
msnd1.tem
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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
//execute1("celltypes.element(\"d1msn\")")
begintemplate d1msn
public init, topol, basic_shape, subsets, geom, biophys, geom_nseg, biophys_inhomo
public synlist, x, y, z, position, connect2target
public proximal, middend, distal, axonal, axon_init, axon_myelin
public soma, dend6, dend4, dend3, axon, dend5, dend2
public dend1, dend6_3, dend6_2, dend6_1, dend4_2, dend4_1, dend3_3
public dend3_1, dend3_2, dend5_3, dend5_2, dend5_1, dend2_2, dend2_1
public dend1_2, dend1_1
public all
objref synlist
proc init() {
topol()
subsets()
geom()
biophys()
geom_nseg()
synlist = new List()
synapses()
forall {
//print secname(), " ",
nseg compts = compts + nseg
}
print compts, " compartments"
x = y = z = 0 // only change via position
}
create soma, dend6, dend4, dend3, axon[3], dend5, dend2
create dend1, dend6_3, dend6_2[3], dend6_1[3], dend4_2[3], dend4_1[3], dend3_3[3]
create dend3_1[3], dend3_2[3], dend5_3, dend5_2[3], dend5_1[3], dend2_2[3], dend2_1[3]
create dend1_2[3], dend1_1[3]
proc topol() { local i
connect dend6(0), soma(0)
connect dend4(0), soma(0)
connect dend3(0), soma(0)
connect axon(0), soma(0.5)
for i = 1, 2 connect axon[i](0), axon[i-1](1)
connect dend5(0), soma(1)
connect dend2(0), soma(1)
connect dend1(0), soma(1)
connect dend6_3(0), dend6(0.8)
connect dend6_2(0), dend6(1)
for i = 1, 2 connect dend6_2[i](0), dend6_2(1)
connect dend6_1(0), dend6(1)
for i = 1, 2 connect dend6_1[i](0), dend6_1(1)
connect dend4_2(0), dend4(1)
for i = 1, 2 connect dend4_2[i](0), dend4_2(1)
connect dend4_1(0), dend4(1)
for i = 1, 2 connect dend4_1[i](0), dend4_1(1)
connect dend3_3(0), dend3(0.8)
for i = 1, 2 connect dend3_3[i](0), dend3_3(1)
connect dend3_1(0), dend3(1)
for i = 1, 2 connect dend3_1[i](0), dend3_1(1)
connect dend3_2(0), dend3(1)
for i = 1, 2 connect dend3_2[i](0), dend3_2(1)
connect dend5_3(0), dend5(0.8)
connect dend5_2(0), dend5(1)
for i = 1, 2 connect dend5_2[i](0), dend5_2(1)
connect dend5_1(0), dend5(1)
for i = 1, 2 connect dend5_1[i](0), dend5_1(1)
connect dend2_2(0), dend2(1)
for i = 1, 2 connect dend2_2[i](0), dend2_2(1)
connect dend2_1(0), dend2(1)
for i = 1, 2 connect dend2_1[i](0), dend2_1(1)
connect dend1_2(0), dend1(1)
for i = 1, 2 connect dend1_2[i](0), dend1_2(1)
connect dend1_1(0), dend1(1)
for i = 1, 2 connect dend1_1[i](0), dend1_1(1)
basic_shape()
}
proc shape3d_1() {
soma {pt3dclear()
pt3dadd(0, 0, 0, 12.0737)
pt3dadd(14.2347, 0, 0, 12.0737)
}
dend6 {pt3dclear()
pt3dadd(0, 0, 0, 1.27785)
pt3dadd(-26.9899, 0, 0, 1.27785)
}
dend4 {pt3dclear()
pt3dadd(0, 0, 0, 1.27785)
pt3dadd(-18.7586, 19.4054, 0, 1.27785)
}
dend3 {pt3dclear()
pt3dadd(0, 0, 0, 1.27785)
pt3dadd(-19.0847, -19.0847, 0, 1.27785)
}
axon {pt3dclear()
pt3dadd(7.11737, 0, 0, 1.1875)
pt3dadd(7.11737, 10, 0, 1.1875)
pt3dadd(7.11737, 20, 0, 1.1875)
}
dend5 {pt3dclear()
pt3dadd(14.2347, 0, 0, 1.27785)
pt3dadd(41.2246, 0, 0, 1.27785)
}
dend2 {pt3dclear()
pt3dadd(14.2347, 0, 0, 1.27785)
pt3dadd(33.3195, 19.0847, 0, 1.27785)
}
dend1 {pt3dclear()
pt3dadd(14.2347, 0, 0, 1.27785)
pt3dadd(33.6402, -18.7586, 0, 1.27785)
}
dend6_3 {pt3dclear()
pt3dadd(-21.5919, 0, 0, 1.28798)
pt3dadd(-49.494, -17.4388, 0, 1.28798)
}
dend6_2 {pt3dclear()
pt3dadd(-26.9899, 0, 0, 1.28798)
pt3dadd(-56.4196, -14.7149, 0, 1.28798)
}
dend6_1 {pt3dclear()
pt3dadd(-26.9899, 0, 0, 1.28798)
pt3dadd(-56.4196, 14.7149, 0, 1.28798)
}
dend4_2 {pt3dclear()
pt3dadd(-18.7586, 19.4054, 0, 1.28798)
pt3dadd(-51.662, 19.4054, 0, 1.28798)
}
dend4_1 {pt3dclear()
pt3dadd(-18.7586, 19.4054, 0, 1.28798)
pt3dadd(-29.1636, 50.6204, 0, 1.28798)
}
dend3_3 {pt3dclear()
pt3dadd(-15.2678, -15.2678, 0, 1.28798)
pt3dadd(-48.1712, -15.2678, 0, 1.28798)
}
dend3_1 {pt3dclear()
pt3dadd(-19.0847, -19.0847, 0, 1.28798)
pt3dadd(-33.7996, -48.5145, 0, 1.28798)
}
dend3_2 {pt3dclear()
pt3dadd(-19.0847, -19.0847, 0, 1.28798)
pt3dadd(-51.9882, -19.0847, 0, 1.28798)
}
axon[1] {pt3dclear()
pt3dadd(7.11737, 20, 0, 0.6875)
pt3dadd(7.11737, 35, 0, 0.6875)
pt3dadd(7.11737, 50, 0, 0.6875)
}
dend5_3 {pt3dclear()
pt3dadd(35.8267, 0, 0, 1.28798)
pt3dadd(63.7287, -17.4388, 0, 1.28798)
}
dend5_2 {pt3dclear()
pt3dadd(41.2246, 0, 0, 1.28798)
pt3dadd(70.6544, -14.7149, 0, 1.28798)
}
dend5_1 {pt3dclear()
pt3dadd(41.2246, 0, 0, 1.28798)
pt3dadd(70.6544, 14.7149, 0, 1.28798)
}
dend2_2 {pt3dclear()
pt3dadd(33.3195, 19.0847, 0, 1.28798)
pt3dadd(43.7245, 50.2997, 0, 1.28798)
}
dend2_1 {pt3dclear()
pt3dadd(33.3195, 19.0847, 0, 1.28798)
pt3dadd(66.2229, 19.0847, 0, 1.28798)
}
dend1_2 {pt3dclear()
pt3dadd(33.6402, -18.7586, 0, 1.28798)
pt3dadd(66.5436, -18.7586, 0, 1.28798)
}
dend1_1 {pt3dclear()
pt3dadd(33.6402, -18.7586, 0, 1.28798)
pt3dadd(33.6402, -51.662, 0, 1.28798)
}
dend6_2[1] {pt3dclear()
pt3dadd(-56.4196, -14.7149, 0, 0.87893)
pt3dadd(-160.739, -119.034, 0, 0.87893)
}
dend6_2[2] {pt3dclear()
pt3dadd(-56.4196, -14.7149, 0, 0.87893)
pt3dadd(-203.949, -14.7149, 0, 0.87893)
}
dend6_1[1] {pt3dclear()
pt3dadd(-56.4196, 14.7149, 0, 0.87893)
pt3dadd(-160.739, 119.034, 0, 0.87893)
}
dend6_1[2] {pt3dclear()
pt3dadd(-56.4196, 14.7149, 0, 0.87893)
pt3dadd(-203.949, 14.7149, 0, 0.87893)
}
dend4_2[1] {pt3dclear()
pt3dadd(-51.662, 19.4054, 0, 0.87893)
pt3dadd(-183.617, -46.5718, 0, 0.87893)
}
dend4_2[2] {pt3dclear()
pt3dadd(-51.662, 19.4054, 0, 0.87893)
pt3dadd(-117.639, 151.36, 0, 0.87893)
}
dend4_1[1] {pt3dclear()
pt3dadd(-29.1636, 50.6204, 0, 0.87893)
pt3dadd(-161.118, 116.598, 0, 0.87893)
}
dend4_1[2] {pt3dclear()
pt3dadd(-29.1636, 50.6204, 0, 0.87893)
pt3dadd(75.1556, 154.94, 0, 0.87893)
}
dend3_3[1] {pt3dclear()
pt3dadd(-48.1712, -15.2678, 0, 0.87893)
pt3dadd(17.806, -147.222, 0, 0.87893)
}
dend3_3[2] {pt3dclear()
pt3dadd(-48.1712, -15.2678, 0, 0.87893)
pt3dadd(-114.148, -147.222, 0, 0.87893)
}
dend3_1[1] {pt3dclear()
pt3dadd(-33.7996, -48.5145, 0, 0.87893)
pt3dadd(-173.758, -95.1674, 0, 0.87893)
}
dend3_1[2] {pt3dclear()
pt3dadd(-33.7996, -48.5145, 0, 0.87893)
pt3dadd(32.1777, -180.469, 0, 0.87893)
}
dend3_2[1] {pt3dclear()
pt3dadd(-51.9882, -19.0847, 0, 0.87893)
pt3dadd(-156.307, -123.404, 0, 0.87893)
}
dend3_2[2] {pt3dclear()
pt3dadd(-51.9882, -19.0847, 0, 0.87893)
pt3dadd(-183.943, 46.8925, 0, 0.87893)
}
axon[2] {pt3dclear()
pt3dadd(7.11737, 50, 0, 0.5)
pt3dadd(7.11736, 250, 0, 0.5)
pt3dadd(7.11735, 450, 0, 0.5)
}
dend5_2[1] {pt3dclear()
pt3dadd(70.6544, -14.7149, 0, 0.87893)
pt3dadd(174.974, -119.034, 0, 0.87893)
}
dend5_2[2] {pt3dclear()
pt3dadd(70.6544, -14.7149, 0, 0.87893)
pt3dadd(218.184, -14.7149, 0, 0.87893)
}
dend5_1[1] {pt3dclear()
pt3dadd(70.6544, 14.7149, 0, 0.87893)
pt3dadd(174.974, 119.034, 0, 0.87893)
}
dend5_1[2] {pt3dclear()
pt3dadd(70.6544, 14.7149, 0, 0.87893)
pt3dadd(218.184, 14.7149, 0, 0.87893)
}
dend2_2[1] {pt3dclear()
pt3dadd(43.7245, 50.2997, 0, 0.87893)
pt3dadd(-22.2528, 182.254, 0, 0.87893)
}
dend2_2[2] {pt3dclear()
pt3dadd(43.7245, 50.2997, 0, 0.87893)
pt3dadd(175.679, 116.277, 0, 0.87893)
}
dend2_1[1] {pt3dclear()
pt3dadd(66.2229, 19.0847, 0, 0.87893)
pt3dadd(132.2, 151.039, 0, 0.87893)
}
dend2_1[2] {pt3dclear()
pt3dadd(66.2229, 19.0847, 0, 0.87893)
pt3dadd(198.177, -46.8925, 0, 0.87893)
}
dend1_2[1] {pt3dclear()
pt3dadd(66.5436, -18.7586, 0, 0.87893)
pt3dadd(170.863, -123.078, 0, 0.87893)
}
dend1_2[2] {pt3dclear()
pt3dadd(66.5436, -18.7586, 0, 0.87893)
pt3dadd(198.498, 47.2187, 0, 0.87893)
}
dend1_1[1] {pt3dclear()
pt3dadd(33.6402, -51.662, 0, 0.87893)
pt3dadd(165.595, -117.639, 0, 0.87893)
}
dend1_1[2] {pt3dclear()
pt3dadd(33.6402, -51.662, 0, 0.87893)
pt3dadd(-32.3371, -183.617, 0, 0.87893)
}
}
proc basic_shape() {
shape3d_1()
}
objref all
proc subsets() { local i
objref all, proximal, middend, distal, axonal
objref axon_init, axon_myelin
all = new SectionList()
axonal = new SectionList()
axon_myelin=new SectionList()
axon_init = new SectionList()
axon[0] {
axon_init.append()
axonal.append()
}
axon[1] {
axon_init.append()
axonal.append()
}
axon[2] {
axon_myelin.append()
axonal.append()
}
soma[0] all.append()
dend1 all.append()
dend2 all.append()
dend3 all.append()
dend4 all.append()
dend5 all.append()
dend6 all.append()
dend5_2 all.append()
dend6_1 all.append()
dend6_2 all.append()
for i=0, 2 dend1_1[i] all.append()
for i=0, 2 dend1_2[i] all.append()
for i=0, 2 dend2_1[i] all.append()
for i=0, 2 dend2_2[i] all.append()
for i=0, 2 dend4_1[i] all.append()
for i=0, 2 dend4_2[i] all.append()
for i=0, 2 dend3_2[i] all.append()
for i=0, 2 dend3_1[i] all.append()
for i=0, 2 dend5_1[i] all.append()
// forsec axonal { all.append() }
proximal = new SectionList()
dend1 proximal.append()
dend2 proximal.append()
dend3 proximal.append()
dend4 proximal.append()
dend5 proximal.append()
dend6 proximal.append()
middend = new SectionList()
dend1_1 middend.append()
dend1_2 middend.append()
dend2_1 middend.append()
dend2_2 middend.append()
dend4_1 middend.append()
dend4_2 middend.append()
dend3_2 middend.append()
dend3_1 middend.append()
dend5_1 middend.append()
dend5_2 middend.append()
dend6_1 middend.append()
dend6_2 middend.append()
distal = new SectionList()
for i=1, 2 dend1_1[i] distal.append()
for i=1, 2 dend1_2[i] distal.append()
for i=1, 2 dend2_1[i] distal.append()
for i=1, 2 dend2_2[i] distal.append()
for i=1, 2 dend4_1[i] distal.append()
for i=1, 2 dend4_2[i] distal.append()
for i=1, 2 dend3_2[i] distal.append()
for i=1, 2 dend3_1[i] distal.append()
for i=1, 2 dend5_1[i] distal.append()
}
proc geom() {
soma { L = 11.2753 diam = 9.99 }
forsec proximal {L = 30.361812 diam = 1.3861217} //forsec proximal {L = 20 diam = 1.125}
forsec middend {L = 36.42597 diam = 1.3551664}//forsec middend {L = 24 diam = 1.1} // { L = 20 diam = 1 * (1+0.3) }
forsec distal {L = 174.77467 diam = 0.92105621}//forsec distal {L = 106.8 diam = 0.72} // { L = 190 diam = 0.5 * (1+2) }
axon[0] {L=20 diam(0:1)=1.5:0.85 }
axon[1] {L=30 diam(0:1)=0.875:0.5}
axon[2] {L=400 diam=0.5}
}
print "Successful loading D1 MSN morph"
func lambda_f() { local i, x1, x2, d1, d2, lam
if (n3d() < 2) {
return 1e5*sqrt(diam/(4*PI*$1*Ra*cm))
}
// above was too inaccurate with large variation in 3d diameter
// so now we use all 3-d points to get a better approximate lambda
x1 = arc3d(0)
d1 = diam3d(0)
lam = 0
for i=1, n3d()-1 {
x2 = arc3d(i)
d2 = diam3d(i)
lam += (x2 - x1)/sqrt(d1 + d2)
x1 = x2 d1 = d2
}
// length of the section in units of lambda
lam *= sqrt(2) * 1e-5*sqrt(4*PI*$1*Ra*cm)
return L/lam
}
proc geom_nseg() {
freq = 100 // Hz, frequency at which AC length constant will be computed
d_lambda = 0.1
forall { nseg = int((L/(d_lambda*lambda_f(freq))+0.9)/2)*2 + 1 }
}
proc biophys() {
}
proc biophys_inhomo(){}
proc position() { local i
soma for i = 0, n3d()-1 {
pt3dchange(i, $1-x+x3d(i), $2-y+y3d(i), $3-z+z3d(i), diam3d(i))
}
x = $1 y = $2 z = $3
}
obfunc connect2target() { localobj nc //$o1 target point process, optional $o2 returned NetCon
soma nc = new NetCon(&v(1), $o1)
nc.threshold = 10
if (numarg() == 2) { $o2 = nc } // for backward compatibility
return nc
}
proc synapses() {}
endtemplate d1msn