/
fig10network.hoc
183 lines (162 loc) · 4.16 KB
/
fig10network.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
// NetGUI default section. Artificial cells, if any, are located here.
create acell_home_
access acell_home_
//Network cell templates
// C_Cell
//Artificial cells
// Bkgd_NetStim
// Stim_NetStim
// Stop_NetStim
// Reward_NetStim
begintemplate C_Cell
public is_art
public init, topol, basic_shape, subsets, geom, biophys
public synlist, x, y, z, position, connect2target
public soma
public all
objref synlist
proc init() {
topol()
subsets()
geom()
biophys()
geom_nseg()
synlist = new List()
synapses()
x = y = z = 0 // only change via position
}
create soma
proc topol() { local i
basic_shape()
}
proc basic_shape() {
soma {pt3dclear() pt3dadd(0, 0, 0, 1) pt3dadd(15, 0, 0, 1)}
}
objref all
proc subsets() { local i
objref all
all = new SectionList()
soma all.append()
}
proc geom() {
soma { /*area = 100 */ L = diam = 5.6419 }
}
external lambda_f
proc geom_nseg() {
soma area(.5) // make sure diam reflects 3d points
soma { nseg = 1 }
}
proc biophys() {
soma {
Ra = 80
cm = 1
insert caL
Pbar_caL = 42
insert kir2
gbar_kir2 = 1.2
insert ksi
gbar_ksi = 0.45
insert leak
g_leak = 0.008
e_leak = -90
}
}
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
}
proc connect2target() { //$o1 target point process, $o2 returned NetCon
soma $o2 = new NetCon(&v(1), $o1)
}
objref syn_
proc synapses() {
/* ExpSyn0 */ soma syn_ = new ExpSyn(0.5) synlist.append(syn_)
syn_.tau = 3
/* DAsyn1 */ soma syn_ = new DAsyn(0.5) synlist.append(syn_)
}
func is_art() { return 0 }
endtemplate C_Cell
begintemplate Bkgd_NetStim
public pp, connect2target, x, y, z, position, is_art
external acell_home_
objref pp
proc init() {
acell_home_ pp = new NetStim(.5)
pp.interval = 3
pp.number = 1e+09
pp.noise = 0.15
}
func is_art() { return 1 }
proc connect2target() { $o2 = new NetCon(pp, $o1) }
proc position(){x=$1 y=$2 z=$3}
endtemplate Bkgd_NetStim
begintemplate Stim_NetStim
public pp, connect2target, x, y, z, position, is_art
external acell_home_
objref pp
proc init() {
acell_home_ pp = new NetStim(.5)
pp.interval = 3
pp.number = 1e+09
pp.start = 400
pp.noise = 0.15
}
func is_art() { return 1 }
proc connect2target() { $o2 = new NetCon(pp, $o1) }
proc position(){x=$1 y=$2 z=$3}
endtemplate Stim_NetStim
begintemplate Stop_NetStim
public pp, connect2target, x, y, z, position, is_art
external acell_home_
objref pp
proc init() {
acell_home_ pp = new NetStim(.5)
pp.number = 1
pp.start = 800
}
func is_art() { return 1 }
proc connect2target() { $o2 = new NetCon(pp, $o1) }
proc position(){x=$1 y=$2 z=$3}
endtemplate Stop_NetStim
begintemplate Reward_NetStim
public pp, connect2target, x, y, z, position, is_art
external acell_home_
objref pp
proc init() {
acell_home_ pp = new NetStim(.5)
pp.number = 1
pp.start = 500
}
func is_art() { return 1 }
proc connect2target() { $o2 = new NetCon(pp, $o1) }
proc position(){x=$1 y=$2 z=$3}
endtemplate Reward_NetStim
//Network specification interface
objref cells, nclist, netcon
{cells = new List() nclist = new List()}
func cell_append() {cells.append($o1) $o1.position($2,$3,$4)
return cells.count - 1
}
func nc_append() {//srcindex, tarcelindex, synindex
if ($3 >= 0) {
cells.object($1).connect2target(cells.object($2).synlist.object($3),netcon)
netcon.weight = $4 netcon.delay = $5
}else{
cells.object($1).connect2target(cells.object($2).pp,netcon)
netcon.weight = $4 netcon.delay = $5
}
nclist.append(netcon)
return nclist.count - 1
}
//Network instantiation
/* C0 */ cell_append(new C_Cell(), -40, 57, 0)
/* Bkgd1 */ cell_append(new Bkgd_NetStim(), -88, 57, 0)
/* Stim2 */ cell_append(new Stim_NetStim(), 1, 57, 0)
/* Stop3 */ cell_append(new Stop_NetStim(), 54, 57, 0)
/* Reward4 */ cell_append(new Reward_NetStim(), -42, 12, 0)
/* Bkgd1 -> C0.ExpSyn0 */ nc_append(1, 0, 0, 1.05e-05,1)
/* Stim2 -> C0.ExpSyn0 */ nc_append(2, 0, 0, 2.4e-06,1)
/* Reward4 -> C0.DAsyn1 */ nc_append(4, 0, 1, 0.4,1)
/* Stop3 -> Stim2 */ nc_append(3, 2, -1, -2,1)