-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathFig6D.hoc
More file actions
246 lines (137 loc) · 5.16 KB
/
Copy pathFig6D.hoc
File metadata and controls
246 lines (137 loc) · 5.16 KB
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
/*----------------------------------------------------------------------------
demo file
---------
Simulations of networks using the object-oriented ability of NEURON
5 neurons connected with GABA-A synapses
All-to-all connections along a ring:
(every cell connects all the others, including itself)
cell1 - cell2
| |
cell3 cell4
\ /
cell5
Idem Fig.6D of the J Neurophysiol. paper
Reference:
Destexhe, A., Contreras, D., Sejnowski, T.J. and Steriade, M. A model of
spindle rhythmicity in the isolated reticular thalamus. Journal of
Neurophysiology 72: 803-818, 1994.
See also:
http://www.cnl.salk.edu/~alain
http://cns.fmed.ulaval.ca
----------------------------------------------------------------------------*/
//----------------------------------------------------------------------------
// load and define general graphical procedures
//----------------------------------------------------------------------------
//xopen("$(NEURONHOME)/lib/hoc/stdrun.hoc")
objectvar g[20] // max 20 graphs
ngraph = 0
proc addgraph() { local ii // define subroutine to add a new graph
// addgraph("variable", minvalue, maxvalue)
ngraph = ngraph+1
ii = ngraph-1
g[ii] = new Graph()
g[ii].size(0,tstop,$2,$3)
g[ii].xaxis()
g[ii].yaxis()
g[ii].addvar($s1,1,0)
g[ii].save_name("graphList[0].")
graphList[0].append(g[ii])
}
if(ismenu==0) {
nrnmainmenu() // create main menu
nrncontrolmenu() // create control menu
ismenu=1
}
//----------------------------------------------------------------------------
// general parameters
//----------------------------------------------------------------------------
dt=0.1
tstop = 5000
runStopAt = tstop
steps_per_ms = 5
celsius = 36
v_init = -70
//----------------------------------------------------------------------------
// create cells
//----------------------------------------------------------------------------
load_file("RE.tem") // load template for RE cell
ncells = 5 // sets the number of cells
objectvar RE[ncells] // create an array of object variables
for(i=0; i<ncells; i=i+1) {
RE[i] = new REcell() // create RE cells from template
}
//----------------------------------------------------------------------------
// create connections
//----------------------------------------------------------------------------
print " "
print " << Defining connectivity ... >>"
print " "
// The connectivity is defined here in a 1-dim ring of neurons;
// each neuron is connected to its neighbors according to a mininal (layer_min)
// and a maximal (layer_max) distance.
layer_min = 0 // first neighbors
layer_max = 2
neighmax = 1 + 2 * layer_max // cells in neighborhood
neighmin = 1 + 2 * (layer_min-1) // cells not in neighborhood
if(layer_min == 0) neighmin = 0
neigh = neighmax-neighmin // nb of cells connected
print " "
print " << Number of synapses per cell: ",neigh," >>"
print " "
objectvar syn[ncells][neigh] // create object variables for synapses
for(i=0; i<ncells; i=i+1) { // scan over each cell
ns = 0
for(k=(i-layer_max); k<(i+layer_max+1); k=k+1) { // scan over postsyn
if(k < 0) { // boundaries = PERIODIC
j = ncells + k
} else if(k >= ncells) {
j = k - ncells
} else {
j = k
}
dis = abs(i-k)
if( (dis >= layer_min) && (dis <= layer_max) ) { // distance OK?
print "<< GABA synapse from cell ",i," to cell ",j," >>"
syn[i][ns] = new GABA()
RE[j].soma syn[i][ns].loc(0.5) // j is postsynaptic
setpointer syn[i][ns].pre, RE[i].soma.v(0.5) // i is presynaptic
ns = ns + 1 // update synapse counter
}
}
}
print " "
//----------------------------------------------------------------------------
// create procedure for setting the synaptic weights
//----------------------------------------------------------------------------
proc assign_synapses() { // assign a value to all synapses
for(i=0; i<ncells; i=i+1) { // scan over each cell
for(j=0; j<neigh; j=j+1) { // scan over each connection
syn[i][j].gmax = $1 // assign value of gmax
}
}
}
assign_synapses(0.2) // assign value (in uS) to each synapse
// sum of all synapses 1ust be of 1uS
// for each cell
//----------------------------------------------------------------------------
// insert random current pulse in each neuron
//----------------------------------------------------------------------------
objectvar RG,Pulse[ncells] // create object variables
RG = new Random() // create random generator
for (i=0; i<ncells; i=i+1) {
print "defining current pulse in RE[",i,"]"
RE[i].soma Pulse[i] = new IClamp(.5) // create current stim
// note: for older versions of NEURON, please use PulseStim instead of IClamp
Pulse[i].dur = 200 // fixed duration
Pulse[i].amp = RG.uniform(0,-0.05) // random amplitude
Pulse[i].del = RG.uniform(0,2000) // random latency
}
//----------------------------------------------------------------------------
// add graphs
//----------------------------------------------------------------------------
print " "
print " << Creating graphics ... >>"
print " "
for(i=0; i<ncells; i=i+1) {
addgraph("RE[i].soma.v(0.5)",-100,20)
}