-
Notifications
You must be signed in to change notification settings - Fork 0
/
SomaOnly_all.hoc
302 lines (187 loc) · 7.28 KB
/
SomaOnly_all.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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
// ******************************************************
//
// File generated by: neuroConstruct v1.6.0
//
// Generally replicates hoc for Cell Type as exported from
// NEURON's Cell Builder, together with some neuroConstruct
// specific helper/info procedures, e.g. toString(), netInfo()
//
// ******************************************************
begintemplate SomaOnly_all
public init, topol, basic_shape, subsets, geom, memb
public synlist, x, y, z, position, connect2target
// Some fields for referencing the cells
public reference, type, description, name
strdef reference, type, description, name
// Some methods for referencing the cells
public toString, netInfo
public all
objref synlist
objref all
objref stringFuncs
public soma_group
objref soma_group
proc init() {
topol()
subsets()
geom()
biophys()
geom_nseg()
synlist = new List()
x = y = z = 0
reference = $s1
type = $s2
description = $s3
strdef indexNum
stringFuncs = new StringFunctions()
stringFuncs.tail(reference, "_", indexNum)
while (stringFuncs.substr( indexNum, "_")>=0) {
stringFuncs.tail(indexNum, "_", indexNum)
}
sprint(name, "%s", type)
}
create Soma
public Soma
proc topol() {
basic_shape()
}
proc basic_shape() {
// Looking at segment number 0: Soma, section: Soma, SPHERICAL, ID: 0, ROOT SEGMENT, rad: 14.9, (0.0, 0.0, 0.0) -> (0.0, 0.0, 0.0) (FINITE VOLUME)
Soma {pt3dclear() pt3dadd(0.0, -14.9, 0.0, 29.8) pt3dadd(0.0, 14.9, 0.0, 29.8)}
}
proc subsets() { local i
// The group all is assumed never to change
all = new SectionList()
soma_group = new SectionList()
Soma soma_group.append()
Soma all.append()
}
proc geom() {
}
proc biophys() {
forsec all cm = 1.64
forsec all Ra = 250.0
forsec all {
// Assuming parameters other than max cond dens are set in the mod file...
insert CaT { gmax_CaT = 5.0E-4 }
// Ion ca is used in this mechanism...
eca = 137.52625 // note: this is val from ChannelML, may be reset later
}
forsec all {
// Assuming parameters other than max cond dens are set in the mod file...
insert KC { gmax_KC = 0.08 }
// Ion k is used in this mechanism...
ek = -85.0 // note: this is val from ChannelML, may be reset later
// Ion ca is used in this mechanism...
// Note: there is no reversal potential present for ion: ca
}
forsec all {
// Assuming parameters other than max cond dens are set in the mod file...
insert CaP { gmax_CaP = 0.0045 }
// Ion ca is used in this mechanism...
eca = 137.52625 // note: this is val from ChannelML, may be reset later
}
forsec all {
// Assuming parameters other than max cond dens are set in the mod file...
insert cad { }
// Ion ca is used in this mechanism...
// Note: there is no reversal potential present for ion: ca
}
forsec all {
// Assuming parameters other than max cond dens are set in the mod file...
insert K2 { gmax_K2 = 3.9E-4 }
// Ion k is used in this mechanism...
ek = -85.0 // note: this is val from ChannelML, may be reset later
// Ion ca is used in this mechanism...
// Note: there is no reversal potential present for ion: ca
}
forsec all {
// Assuming parameters other than max cond dens are set in the mod file...
insert KMnew2 { gmax_KMnew2 = 4.0E-5 }
// Ion k is used in this mechanism...
ek = -85.0 // note: this is val from ChannelML, may be reset later
}
forsec all {
// Assuming parameters other than max cond dens are set in the mod file...
insert NaF { gmax_NaF = 7.5 }
// Ion na is used in this mechanism...
ena = 45.0 // note: this is val from ChannelML, may be reset later
}
forsec all {
// Assuming parameters other than max cond dens are set in the mod file...
insert NaP { gmax_NaP = 0.001 }
// Ion na is used in this mechanism...
ena = 45.0 // note: this is val from ChannelML, may be reset later
}
addChanMechs_0() // Spliting function to prevent errors when proc too big
}
proc addChanMechs_0() {
forsec soma_group {
// Assuming parameters other than max cond dens are set in the mod file...
insert Kh1 { gmax_Kh1 = 3.0E-4 }
// Ion k is used in this mechanism...
ek = -85.0 // note: this is val from ChannelML, may be reset later
}
forsec soma_group {
// Assuming parameters other than max cond dens are set in the mod file...
insert Kh2 { gmax_Kh2 = 3.0E-4 }
// Ion k is used in this mechanism...
ek = -85.0 // note: this is val from ChannelML, may be reset later
}
forsec soma_group {
// Assuming parameters other than max cond dens are set in the mod file...
insert KA { gmax_KA = 0.015 }
// Ion k is used in this mechanism...
ek = -85.0 // note: this is val from ChannelML, may be reset later
}
forsec soma_group {
// Assuming parameters other than max cond dens are set in the mod file...
insert Kdr { gmax_Kdr = 0.6 }
// Ion k is used in this mechanism...
ek = -85.0 // note: this is val from ChannelML, may be reset later
}
forsec soma_group {
// Assuming parameters other than max cond dens are set in the mod file...
insert LeakConductance { gmax_LeakConductance = 1.0E-4 }
// Ion non_specific is used in this mechanism...
}
}
proc geom_nseg() {
// All sections not mentioned here have nseg = 1
}
proc position() { local i
forsec all {
for i = 0, n3d()-1 {
pt3dchange(i, $1+x3d(i), $2+y3d(i), $3+z3d(i), diam3d(i))
}
}
x = $1 y = $2 z = $3
}
proc connect2target() { //$o1 target point process, $o2 returned NetCon
// Using standard NetBuilder form. (Overly) simple assumption that first soma seg is trigger for AP...
// Note: neuroConstruct does not use this func for creating connections (in serial mode!), but it can be useful when using generated files in NEURON's NetBuilder
Soma $o2 = new NetCon(&v(1), $o1)
print "connect2target called on ", name
}
// This function is useful when checking what cells (aot sections) have been created. Run allcells() from nCtools.hoc...
proc toString() {
strdef info
sprint(info, "Cell ref: %s (%s), at: (%d, %d, %d)", reference, name, x, y, z)
print info
}
// This function is useful when checking network connections
proc netInfo() {
strdef info
sprint(info, "Cell reference: %s, type: %s", reference, type)
print "-------- ",info
print " There are ", synlist.count(), " connections in ", synlist
for i=0,synlist.count()-1 {
print " Connection from ", synlist.o[i].precell, " to: ", synlist.o[i].postcell
print " Pre: Weight: ", synlist.o[i].weight, ", delay: ", synlist.o[i].delay, ", threshold: ", synlist.o[i].threshold
print " Post: ", synlist.o[i].syn(), ", gmax: ", synlist.o[i].syn().gmax , ", e: ", synlist.o[i].syn().e , ", rise time: ", synlist.o[i].syn().tau_rise , ", decay time: ", synlist.o[i].syn().tau_decay
print " "
}
print "-------- "
print " "
}
endtemplate SomaOnly_all