-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_spn_model.hoc
140 lines (107 loc) · 3.36 KB
/
run_spn_model.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
// SPN neuron model
// ---------------------------------------------
//
// This model simulates rebound action potential firing in SPN neurons
// following prolonged inhibition from the MNTB.
//
// Reference:
// The Sound of Silence: ionic mechanisms encoding sound termination.
// Cornelia Kopp-Scheinpflug, Adam JB Tozer, Susan W Robinson
// Bruce L Tempel, Matthias H Hennig and Ian D Forsythe
// Neuron, in press (2011)
//
// Contact:
// Matthias H. Hennig, University of Edinburgh, 2011
//
// with contributions from:
// Sarah J. Griffin, MRC Toxicology Unit, Leicester
load_file("nrngui.hoc")
load_file("pointman.hoc")
objectvar input, plotwin
objectvar windows[5]
objref ns
objref fl
objref syn[21], synstim[21], synstim2[21]
objref netsynstim[21], netsynstim2[21]
// definitions for spike counting
objref spiketimes
spiketimes = new Vector(100)
objref aps
objref spikestmp
// default synapse parameters
syninterval = 10 // stimulus interval (ms)
synnum = 10 // number of stimuli
synnoise = 0 // could be used to introduce some spike jitter
synconductance = 4e-3 // umho
// default gap between the two stimulus trains
gap = 10
// how many inhibitory synapses does our neuron have?
nsyns = 14
// set up the model neurons (defaut parameters)
// ---------------------------------------------
load_file("spn_neuron.hoc")
// Stimuli + Inputs
// ---------------------------------------------
// current injection
// this is not used by default, but can be used to simulate voltage
// clamp conditions when Ih is blocked
load_file("current_inj.hoc")
// synapses
load_file("synapses.hoc")
// noise source (simulates excitatory synaptic noise)
load_file("conductance_noise.hoc")
// set up the spike detector
// ---------------------------------------------
proc foundspike() {
print "called handle() at time ", t, " when soma.v(.5) = ", soma.v(.5)
spiketimes.x[nspikes] = t
nspikes = nspikes+1
}
aps = new NetCon(&v(0.5),spikestmp)
aps.threshold = -10
aps.record("foundspike()")
// add the second stimulus (after the gap
// ---------------------------------------------
for i=0, nsyns {
synstim2[i] = new NetStims(0.5)
synstim2[i].start = 300+gap
synstim2[i].interval = syninterval
synstim2[i].number = synnum
synstim2[i].noise = synnoise
netsynstim2[i] = new NetCon(synstim2[i],syn[i])
}
// wrapper function to run a simulation
// ---------------------------------------------
proc myrun() {
tstop = 750 // duration of the simulation
nspikes = 0 // reset spike counter
// noise
fl.std_e = 0.0005
fl.tau_e = 2
syninterval = NetStim[0].interval
// set synapse parameters
for i=0, nsyns {
synstim[i].start = 300-syninterval*synnum
synstim[i].interval = syninterval
synstim[i].number = synnum
synstim[i].noise = synnoise
synstim2[i].start = 300+gap
synstim2[i].interval = syninterval
netsynstim[i].weight = synconductance
netsynstim2[i].weight = synconductance
}
// run a simulation
finitialize(-60)
run()
// print out results summary
printf("time of 2 stimults: %g\n",200+syninterval*synnum+gap)
printf("number of spikes: %g\n",nspikes)
}
// Simulation controls
// ---------------------------------------------
load_file("simcontrols.hoc")
// plot windows
// ---------------------------------------------
load_file("allgraphs.hoc")