-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCellsTemplate.hoc
152 lines (133 loc) · 4.72 KB
/
CellsTemplate.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
//////////////////* Cells Template *//////////////////
//Parameters Setting
SOMA_SIZE_L = 28
SOMA_SIZE_diam = 28 // assume spherical shape for soma
SOMA_Ra = 200 // Ra, [ohm-cm] Cell resistance
SOMA_cm = 1 //cm, [uF/cm2] Membrane capacitance
//For Hodgkin-Huxley model
GNaBAR_HH = 0.12 //gnabar_hh, [mho/cm2](mho = ohm^-1) Maximum specific sodium channel conductance
GKBAR_HH = 0.036 //gkbar_hh, [mho/cm2] Maximum potassium channel conductance
GL_HH_ZERO = 0 //gl_hh, [mho/cm2] Leakage conductance in HH model -> set to zero because the mechanism "pas" is used
EL_HH = -65 //el_hh , [mV] Leakage reversal potential
GL_PAS = 0.0004 //gl_hh, [mho/cm2] Leakage conductance
EL_PAS = -65 //el_hh , [mV] Leakage reversal potential
ENa_HH = 55 //ena, [mV] Na reversal potential
EK_HH = -80 //ek, [mV] K reversal potential
//Calcium T-Type
ECa_CaT = 126.1 //eca, [mV] Ca reversal potential
GCaMAX_CaT = 0.002 //gmax_CaT [mho/cm2] Maximum specific calcium channel conductance
//netcon
NETCON_THRESHOLD = 0 //nc.threshold --> When the source variable passes threshold in the positive direction at time t-delay, the target will receive an event at time t along with weight information.
//synapses
EPSP_TAU1 = 1 //[ms]
EPSP_TAU2 = 3 //[ms]
EPSP_E_REVERSE = 0 //[mV]
IPSP_TAU1 = 1 //[ms]
IPSP_TAU2 = 7 //[ms]
IPSP_I_REVERSE = -80 //[mV]
///////////// Templates
begintemplate Target_Cell //////////////////////////////////////////////////////////Begin Target_Cell template
public is_art
public init, topol, basic_shape, subsets, geom, biophys, geom_nseg, biophys_inhomo
public synlist, cID, tID, cType, x, y, z, position, connect2target, setID //cID = cell ID (numbering of all cells) , tID = type ID
public soma
public all
objref synlist
external SOMA_SIZE_L, SOMA_SIZE_diam, SOMA_Ra,SOMA_cm, GNaBAR_HH, GKBAR_HH, GL_HH_ZERO, EL_HH, ENa_HH , EK_HH, NETCON_THRESHOLD
external EPSP_TAU1,EPSP_TAU2,EPSP_E_REVERSE ,IPSP_TAU1,IPSP_TAU2, IPSP_I_REVERSE, EL_PAS, GL_PAS
external ECa_CaT, GCaMAX_CaT
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() {
forsec all { L = SOMA_SIZE_L diam = SOMA_SIZE_diam } //{ L = SOMA_SIZE diam = SOMA_SIZE } //um
}
external lambda_f
proc geom_nseg() {
forsec all { nseg = int((L/(0.1*lambda_f(100))+.999)/2)*2 + 1 }
}
proc biophys() {
forsec all {
Ra = SOMA_Ra //ohm-cm
cm = SOMA_cm //uF/cm2
insert hh
gnabar_hh = GNaBAR_HH //GNaBAR_HH //0.12
gkbar_hh = GKBAR_HH //GKBAR_HH //0.036
gl_hh = GL_HH_ZERO //GL_HH_ZERO //0.0001
el_hh = EL_HH //EL_HH //-60
ena = ENa_HH
ek = EK_HH
insert pas
e_pas = EL_PAS
g_pas = GL_PAS
insert CaT
gmax_CaT = GCaMAX_CaT
eca = ECa_CaT
}
}
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(0.5), $o1)
nc.threshold = NETCON_THRESHOLD
if (numarg() == 2) { $o2 = nc } // for backward compatibility
return nc
}
proc setID(){ //$1 = cell ID , $2 = type ID, $3 = cType 0=Input, E=1, I =2
cID = $1 tID = $2 cType = $3 }
objref syn_
proc synapses() {
/* E0 */ soma syn_ = new Exp2Syn(0.5) synlist.append(syn_)
syn_.tau1 = EPSP_TAU1 //EPSP_TAU1 //1
syn_.tau2 = EPSP_TAU2 //EPSP_TAU2 //3
syn_.e = EPSP_E_REVERSE //EPSP_E_REVERSE//0
/* I1 */ soma syn_ = new Exp2Syn(0.5) synlist.append(syn_)
syn_.tau1 = IPSP_TAU1 //IPSP_TAU1 //1
syn_.tau2 = IPSP_TAU2 //IPSP_TAU2 //7
syn_.e = IPSP_I_REVERSE //IPSP_I_REVERSE //-80
}
func is_art() { return 0 }
endtemplate Target_Cell //////////////////////////////////////////////////////////End Target_Cell template
begintemplate In_spk_VecStim ////////////////////////////////////////////////////////////////Begin In_spk_VecStim
public pp, connect2target, x, y, z, cID,tID,cType, position, is_art, setID
external NETCON_THRESHOLD
objref pp
proc init() {
pp = new VecStim()
}
func is_art() { return 1 } //artificial
obfunc connect2target() { localobj nc
nc = new NetCon(pp, $o1)
if (numarg() == 2) { $o2 = nc }
nc.threshold = NETCON_THRESHOLD
return nc
}
proc position(){x=$1 y=$2 z=$3}
proc setID(){ cID = $1 tID = $2 cType = $3 }
endtemplate In_spk_VecStim //////////////////////////////////////////////////////////////// End In_spk_VecStim
printf("Done Downloading Cells Template")