// Simulation and analysis of Spatiotemporal Component of Cl- Gradients in a isolated dendrite
// Here simulation of different AMPA Synapses
// Here application in a simple Ball and Stick Model
// Define spatial properties of dendrite
ANZAHL_NODES = 100
// Define number or Repetitions of the non-Cl-Parameter
MAX_FAKTOR = 25 //Number of repetitions
// Define Cl--Concentration
Cl_Steps = 4 // Number of Different [Cl-]i
objref Cl_List
Cl_List = new Vector(Cl_Steps)
Cl_List.x[0] = 5 //mM
Cl_List.x[1] = 15
Cl_List.x[2] = 25
Cl_List.x[3] = 35
// Determination Parameters GABA
ANZAHL_GABA = 1 //Anzahl der synaptischen Pulse
G_GABA = 0.000789 //Value from Lombardi et al 2018
P_GABA = 0.18
DECAY_GABA = 37 //Value from Lombardi et al 2018
GABA_SYN_LOCATION = 0.5 // Position GABA Synapse for Pulses
ONSET_GABA_PULSE = 50
// Determination Parameters AMPA
ANZAHL_AMPA = 1 //Anzahl der synaptischen Pulse
G_AMPA = 0.000305 * 1 //Value from Lombardi et al 2018
E_AMPA = 0 // Reversal Potential of Exp2Syn
DECAY_AMPA = 11 //Value from Lombardi et al 2018
AMPA_SYN_LOCATION = 0.5 // Position GABA Synapse for Pulses
// Identification of the node with the GABA Synapse
GABA_SynPos = ANZAHL_NODES*GABA_SYN_LOCATION
//----- Define run parameters ---------------------
tstop = 200 // Duration
v_init = -60 // Initial voltage
dt = 0.5 // Step Interval in ms
lenghtoutputvec = 2000 // Number of Lines for output (< 32000 for Excel-Figures)
//-- Initialize Graph for Display of [Cli]i in the right scale
objectvar Cl_graph
Cl_graph = new Graph(0)
Cl_graph.size(0,210,10,50)
Cl_graph.view(0, 10, 210, 40, 462, 636, 961.2, 200.8)
graphList[0].append(Cl_graph)
Cl_graph.addexpr("dend.cli( 0.5 )", 1, 1, 0.8, 0.9, 2)
//----- Insert synapses -------------------------
// Determination of GABA Synapse
objref gabasyn
dend {
// insert GABA synapse
gabasyn = new gaba(GABA_SYN_LOCATION)
gabasyn.tau1 = 0.1
gabasyn.tau2 = DECAY_GABA
gabasyn.P = P_GABA
}
// Definition of synaptic Stimuli
objref stimGABApuls //Pulssequenz GABA
stimGABApuls = new NetStim(GABA_SYN_LOCATION)
stimGABApuls.number = ANZAHL_GABA
stimGABApuls.start = ONSET_GABA_PULSE
// Linkage of synaptic Inputs
objref synpulsegaba
// Determination of AMPA Synapse
objref ampasyn
dend {
// insert AMPA synapse
ampasyn = new Exp2Syn(AMPA_SYN_LOCATION)
ampasyn.tau1 = 0.1
ampasyn.tau2 = DECAY_AMPA
ampasyn.e = E_AMPA
}
// Definition of synaptic Stimuli
objref stimAMPApuls //Pulssequenz AMPA
stimAMPApuls = new NetStim(AMPA_SYN_LOCATION)
stimAMPApuls.number = ANZAHL_AMPA
// Linkage of synaptic Inputs
objref synpulseampa
// ------------Procedures and Functions -------------------------------
// --------------------------------------------------------------------
// Function MakeShort ---------------------------------------//
// Inputs: $1 Objref to Inputvector //
// $2 Objref to Outoutvector //
// lenoutvec desired lendth of Outputvector //
// //
// Reduce Inputvec to Outputvev by averaging n elements //
// n (reducing factor) = floor(Inputvec.size() / lenoutvec) //
// ----------------------------------------------------------//
obfunc MakeShort() {local i, n
n = int($o1.size()/$3)
$o2.resize($3)
for i=0, $3-1 {
$o2.x[i] = $o1.mean(i*n, (i+1)*n-1)
}
return $o2
} // End of function
// ---------Definition of Output Vectors and File Output --------------
// --------------------------------------------------------------------
//-- Define ------
objref timevec, shorttimevec
objref voltvec[ANZAHL_NODES], shortvoltvec, voltvec_aver
objref clivec[ANZAHL_NODES], shortclivec, clivec_aver
objref Outmatrix //0=time, FAKTOR=Cl-, MAX_FAKTOR+FAKTOR = v
strdef OutFileName // Name of File Output
objref OutFile
//--- Assign -------
timevec = new Vector()
shorttimevec = new Vector()
for i = 0, ANZAHL_NODES-1 {
voltvec[i] = new Vector()
clivec[i] = new Vector()
}
// not used in thie simulation clivec_aver = new Vector()
// not used in thie simulation voltvec_aver = new Vector()
shortclivec = new Vector()
shortvoltvec = new Vector()
Outmatrix = new Matrix()
//-- Link Output Vectors ----------------
timevec.record(&t) // Time vector
for i = 0, ANZAHL_NODES-1 { // Generate Vektor for each node
voltvec[i].record(&dend.v(i/ANZAHL_NODES))
clivec[i].record(&dend.cli(i/ANZAHL_NODES))
}
// --- Simulation starts here ------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------
//-- Outer Loop Variation of [Cli] initial -------------------
Cl_Step = 0
while (Cl_Step < Cl_Steps){
// Update Cl- homeostasis in all compartments ----------------------------------------------
forsec all {
cli0_cldif_CA3_NKCC1_HCO3 = Cl_List.x[Cl_Step]
cli_Start_cldif_CA3_NKCC1_HCO3 = Cl_List.x[Cl_Step]
cli_cldif_CA3_NKCC1_HCO3 = Cl_List.x[Cl_Step]
}
//-- Inner Loop Variation of synaptic location --------------------------------------------------------------
AMPA_Delay = 0
while (AMPA_Delay < MAX_FAKTOR) {
// Assign Value to Synapse
dend {
synpulsegaba = new NetCon(stimGABApuls, gabasyn, 0, 0, G_GABA)
if (AMPA_Delay == 0){
stimAMPApuls.start = ONSET_GABA_PULSE -2 + (AMPA_Delay*2)
synpulseampa = new NetCon(stimAMPApuls, ampasyn, 0, 0, 0)
}else{
stimAMPApuls.start = ONSET_GABA_PULSE - 2 + (AMPA_Delay*2)
synpulseampa = new NetCon(stimAMPApuls, ampasyn, 0, 0, G_AMPA)
}
}
printf("Faktor = %g of %g ", Cl_Step*MAX_FAKTOR+AMPA_Delay+1, MAX_FAKTOR*Cl_Steps)
Cl_graph.size(0, tstop, Cl_List.x[Cl_Step]- 1, Cl_List.x[Cl_Step] + 1)
// Run Simulation --------------------------------------------------------
run()
// Put Data in Output Matrix --------------------------------------------
// ---- => shrink the parameters to output-size before ---------------------
MakeShort(timevec, shorttimevec, lenghtoutputvec)
Outmatrix.resize(shorttimevec.size(), 1 + 2 * MAX_FAKTOR)
Outmatrix.setcol(0, shorttimevec)
// Not used for this analysis // Calculate average [Cli] over all Nodes -------
// clivec_aver.resize(clivec[0].size())
// voltvec_aver.resize(voltvec[0].size())
// clivec_aver.mul(0) // empty vector
// voltvec_aver.mul(0)
// for i=0, ANZAHL_NODES-1 {
// clivec_aver.add(clivec[i])
// voltvec_aver.add(voltvec[i])
// }
// clivec_aver.div(ANZAHL_NODES)
// voltvec_aver.div(ANZAHL_NODES)
// determine delta CLi
if (abs(clivec[GABA_SynPos].x[1]-clivec[GABA_SynPos].min()) > abs(clivec[GABA_SynPos].x[1]-clivec[GABA_SynPos].max())){
DeltaCl = clivec[GABA_SynPos].min()- clivec[GABA_SynPos].x[1]
}else{
DeltaCl = clivec[GABA_SynPos].max() -clivec[GABA_SynPos].x[1]
}
printf("- g_AMPA = %g pS - delay %g - [Cl-]i = %g mM => Delta[Cl-]i = %g mM, Em = %g mV \n", G_AMPA*1000, (AMPA_Delay*2-2), Cl_List.x[Cl_Step], DeltaCl, voltvec[GABA_SynPos].max())
// Put Vectors in Outmatrix
MakeShort(clivec[GABA_SynPos], shortclivec, lenghtoutputvec)
MakeShort(voltvec[GABA_SynPos], shortvoltvec, lenghtoutputvec)
shortclivec.x[0] = G_AMPA*1000
shortvoltvec.x[0] = G_AMPA*1000
shortclivec.x[1] = AMPA_Delay*2-2
shortvoltvec.x[1] = AMPA_Delay*2-2
Outmatrix.setcol(AMPA_Delay+1, shortclivec)
Outmatrix.setcol(MAX_FAKTOR + AMPA_Delay+1, shortvoltvec)
// Goto next Delay
AMPA_Delay+=1
}
// ----- end of inner loop (Syn_Location-Loop) -------
// Save the Data --------------------------------------------------------------------
OutFile = new File()
sprint(OutFileName, "Essential_Traces_Kap-1uF_Var-temp_rel_AMPA_Cli-%gmM_gAMPA-%gpS_tauAMPA-%g.asc", Cl_List.x[Cl_Step],G_AMPA*1000,DECAY_AMPA)
OutFile.wopen(OutFileName)
Outmatrix.fprint(OutFile, "\t%.12g")
OutFile.close
// Goto next Cl- Concentration
Cl_Step+=1
}
// ---------- End of outer loop (Cl_Step-Loop) ----------------------