///////////////////////
/* net_dd_emodel.hoc */
///////////////////////
objref principalneuron[nPN] // the "network" of Principal Cells (n = nPN)
begintemplate Principalneuron // template of a Principal Cell
public soma_principalneuron, old_v, drv_principalneuron, syn_IE, \
switch_syn_IE, set_syn, change_Imu_principalneuron, \
pre_list_IE, connect_pre_IE, is_connected_IE,\
disconnect_cell_IE, syn_EE, pre_list_EE, connect_pre_EE, disconnect_cell_EE,\
is_connected_EE, currents, index_PN, switch_syn_EE, indicing_PN,\
bgdrive, inj_input, injvec, signinput
external n_d_principalneuron,n_L_principalneuron,n_seg_principalneuron,Ek_principalneuron,\
ARes_principalneuron,MCap_principalneuron,Rm_principalneuron, Vrest_principalneuron,\
gna_principalneuron, shift_principalneuron, ena_principalneuron, gkdr_principalneuron,\
gka_principalneuron, gkm_principalneuron,\
Syn_IE_rise, SynE_IE, SynDel, SynADel, Imu_principalneuron, tstop,\
Syn_EE_rise, Syn_EE_decay, SynE_EE, Ek_principalneuron, tauvec_IE, Syn_IE_N,\
temiinj_PN, iinj_time, inj_step, BGSyn_rise_PN, BGSyn_decay_PN, max_ddcon_IE, nPN,\
tPNinj_on, PN_SIGNSyn_rise, PN_SIGNSyn_decay
objref syn_IE[50], pre_list_IE, syn_EE, pre_list_EE, injvec,\
drv_principalneuron, net_c_interneuron, net_c_principalneuron, bgsyn, bgdrive_list, inj_PN,\
signinput_list, signsyn
create soma_principalneuron
proc init() {
pre_list_IE = new List()
pre_list_EE = new List()
bgdrive_list = new List()
signinput_list = new List()
soma_principalneuron {
//geometry
diam = n_d_principalneuron L=n_L_principalneuron nseg=n_seg_principalneuron
f_surf = area(0.5)/100000
//cable params
Ra = ARes_principalneuron cm=MCap_principalneuron v=Vrest_principalneuron
old_v = Vrest_principalneuron
//membrane mechanisms
insert pas
e_pas=Vrest_principalneuron
g_pas=1/Rm_principalneuron
insert na3
gbar_na3 = gna_principalneuron
sh_na3 = shift_principalneuron
ena = ena_principalneuron
insert kdr
gkdrbar_kdr = gkdr_principalneuron
sh_kdr = shift_principalneuron
ek = Ek_principalneuron
insert kap
gkabar_kap = gka_principalneuron
sh_kap = shift_principalneuron
insert km
gbar_km = gkm_principalneuron
sh_km=shift_principalneuron
// postsynaptic IPSCs
for i = 0,Syn_IE_N-1 {
syn_IE[i] = new Exp2Syn(0.5)
syn_IE[i].tau1 = Syn_IE_rise
syn_IE[i].tau2 = tauvec_IE.x[i*(max_ddcon_IE/Syn_IE_N)]
syn_IE[i].e = SynE_IE
}
// postsynaptic EPSCs
syn_EE = new Exp2Syn(0.5)
syn_EE.tau1 = Syn_EE_rise
syn_EE.tau2 = Syn_EE_decay
syn_EE.e = SynE_EE
// excitatory synapses for background drive
bgsyn = new Exp2Syn(0.5)
bgsyn.tau1 = BGSyn_rise_PN
bgsyn.tau2 = BGSyn_decay_PN
bgsyn.e = 0
// excitatory synapses for synaptic input signal
signsyn = new Exp2Syn(0.5)
signsyn.tau1 = PN_SIGNSyn_rise
signsyn.tau2 = PN_SIGNSyn_decay
signsyn.e = 0
// IClamps - a) constant drive
drv_principalneuron = new IClamp(0.5)
drv_principalneuron.del = 0
drv_principalneuron.dur = tstop
drv_principalneuron.amp = Imu_principalneuron*f_surf // nA
// excitatory curent injection - the density param. 'Imu' [uA/cm^2] should be converted
// to the injected current 'amp' [nA] using the factor 'fsurf' derived from the
// surface area [um^2] and the conversion of the units
// IClamps - b) for shaped input
inj_PN = new IClamp(0.5)
inj_PN.del = 0
inj_PN.dur = tstop
}
}
proc indicing_PN() {
index_PN = $1
}
// ****IPSCs****
proc connect_pre_IE() {local f, axdel, strength
// $o1 arg is the **PRESynaptic** Cell, $2 is the distance between the cells, $3 gsyn, $4 distance for the tau-Vector
axdel=$2*SynADel // in ms distance between cells 50 um
// AP propagation .25 m/s => 0.2 ms for one interval
strength = $3*f_surf // synaptic strength calculate using the surface factor
synno = int(($4*Syn_IE_N)/(max_ddcon_IE+1))
$o1.soma_interneuron pre_list_IE.append( new NetCon(&v(1),syn_IE[synno],-20,SynDel+axdel,strength))
// list.append() adds new items to the list
// NetCon: (presynaptic variable, target, thresh, delay, weight)
// the last argument is the 'weight' with a range of [0-1] where 1 corresponds to 1 æS peak
// conversion: 'SynG' [mS/cm^2] to 'weight' [uS] using the factor 'fsurf' derived from the
// surface area [um^2] and the conversion of the units
}
proc disconnect_cell_IE() {
pre_list_IE.remove_all()
}
func is_connected_IE() {local i,c // check if connected
c = 0
for i = 0,pre_list_IE.count()-1 {
net_c_interneuron = pre_list_IE.object(i) // get netCon object from list
if ($o1 == net_c_interneuron.precell()) {c=1}
}
return c
}
proc switch_syn_IE() {local i // check if connected
for i = 0,Syn_IE_N-1 {
syn_IE[i].tau1 = Syn_IE_rise // to make sure changes in syn params
syn_IE[i].tau2 = tauvec_IE.x[i*(max_ddcon_IE/Syn_IE_N)]
syn_IE[i].e = SynE_IE
}
for i = 0,pre_list_IE.count()-1 {
net_c_interneuron = pre_list_IE.object(i) // get netCon object from list
net_c_interneuron.active($1)
}
}
// ****EPSCs****
proc connect_pre_EE() {local f, axdel, strength
// $o1 arg is the **PRSynEaptic** Cell, $2 is the distance between the cells, $3 gsyn
axdel=$2*SynADel // AP propagation .25 m/s => 0.2 ms for one interval
strength = $3*f_surf // synaptic strength calculate using the surface factor
$o1.soma_principalneuron pre_list_EE.append( new NetCon(&v(1),syn_EE,-20,SynDel+axdel,strength))
// list.append() adds new items to the list
// NetCon: (presynaptic variable, target, thresh, delay, weight)
// the last argument is the 'weight' with a range of [0-1] where 1 corresponds to 1 æS peak
// conversion: 'SynG' [mS/cm^2] to 'weight' [uS] using the factor 'fsurf' derived from the
// surface area [um^2] and the conversion of the units
}
proc disconnect_cell_EE() {
pre_list_EE.remove_all()
}
func is_connected_EE() {local i,c // check if connected
c = 0
for i = 0,pre_list_EE.count()-1 {
net_c_principalneuron = pre_list_EE.object(i) // get netCon object from list
if ($o1 == net_c_principalneuron.precell()) {c=1}
}
return c
}
proc switch_syn_EE() {local i // check if connected
syn_EE.tau1 = Syn_EE_rise // to make sure changes in syn params
// take place in the network
syn_EE.tau2 = Syn_EE_decay
syn_EE.e = SynE_EE
for i = 0,pre_list_EE.count()-1 {
net_c_principalneuron = pre_list_EE.object(i) // get netCon object from list
net_c_principalneuron.active($1)
}
}
proc change_Imu_principalneuron() {
if (numarg()<1) {
drv_principalneuron.amp = Imu_principalneuron*f_surf
} else {
drv_principalneuron.amp = $1*f_surf
}
}
// ****Background synaptic drive****
proc bgdrive() {
strength = $2*f_surf
bgdrive_list.append( new NetCon($o1,bgsyn,10,0,strength) )
}
// ****Shaped input****
proc inj_input() {
injvec = new Vector(tstop/inj_step)
// $1 is the multiplicative factor that depends on the spatial position of the cell in the net!
injvec = temiinj_PN.c.mul(f_surf*$1)
// $2 is a variability factor determined by spainput_on_sd
for i = tPNinj_on/inj_step,$2/inj_step {
injvec.x[i-1] = 0
}
injvec.play(&inj_PN.amp,iinj_time,1)
}
proc signinput() {
strength = $2*f_surf
signinput_list.append( new NetCon($o1,signsyn,10,0,strength) )
}
endtemplate Principalneuron