// 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 = 100 //Number of repetitions
// Define Cl--Concentration
Cl_Steps = 6 // Number of Different [Cl-]i
objref Cl_List
Cl_List = new Vector(Cl_Steps)
Cl_List.x[0] = 5 //mM
Cl_List.x[1] = 10
Cl_List.x[2] = 15
Cl_List.x[3] = 25
Cl_List.x[4] = 35
Cl_List.x[5] = 50
// 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.99 // Position GABA Synapse at the end of the dendrite
// at dend(1) notpossible for ion-using point processes
ONSET_GABA_PULSE = 10
// 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
ONSET_AMPA_PULSE = 10
// Identification of the node with the GABA Synapse
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[ANZAHL_NODES]
ampasyn= new Vector(ANZAHL_NODES)
dend {
for i = 0, ANZAHL_NODES - 1 {
// insert AMPA synapse
ampasyn[i] = new Exp2Syn(i/100)
ampasyn[i].tau1 = 0.1
ampasyn[i].tau2 = DECAY_AMPA
ampasyn[i].e = E_AMPA
}
}
// Definition of synaptic Stimuli
objref stimAMPApuls[ANZAHL_NODES] //Pulssequenz AMPA
stimAMPApuls = new Vector(ANZAHL_NODES)
for i = 0, ANZAHL_NODES -1 {
stimAMPApuls[i] = new NetStim(i/100)
stimAMPApuls[i].number = ANZAHL_AMPA
stimAMPApuls[i].start = ONSET_AMPA_PULSE
}
// 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
objref Analysismatrix //0=[Cl-]-initial, 1=gAMPA, 2=[Cl-]max, 3=[Cl-]min
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()
Analysismatrix = new Matrix(7, MAX_FAKTOR*Cl_Steps+1)
//-- 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 --------------------------------------------------------------
Syn_Location = 0
while (Syn_Location < MAX_FAKTOR) {
// Assign Value to Synapse
dend {
synpulsegaba = new NetCon(stimGABApuls, gabasyn, 0, 0, G_GABA)
synpulseampa = new NetCon(stimAMPApuls[Syn_Location], ampasyn[Syn_Location], 0, 0, G_AMPA)
}
printf("Faktor = %g of %g ", Cl_Step*MAX_FAKTOR+Syn_Location+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[SynPos].x[1]-clivec[SynPos].min()) > abs(clivec[SynPos].x[1]-clivec[SynPos].max())){
DeltaCl = clivec[SynPos].min()- clivec[SynPos].x[1]
}else{
DeltaCl = clivec[SynPos].max() -clivec[SynPos].x[1]
}
printf("- g_AMPA = %g pS - location %g - [Cl-]i = %g mM => Delta[Cl-]i = %g mM, Em = %g mV \n", G_AMPA*1000, Syn_Location, Cl_List.x[Cl_Step], DeltaCl, voltvec[SynPos].max())
// Put Vectors in Outmatrix
MakeShort(clivec[SynPos], shortclivec, lenghtoutputvec)
MakeShort(voltvec[SynPos], shortvoltvec, lenghtoutputvec)
shortclivec.x[0] = G_AMPA*1000
shortvoltvec.x[0] = G_AMPA*1000
shortclivec.x[1] = Syn_Location
shortvoltvec.x[1] = Syn_Location
Outmatrix.setcol(Syn_Location, shortclivec)
Outmatrix.setcol(MAX_FAKTOR + Syn_Location, shortvoltvec)
Analysismatrix.x[0][Cl_Step*MAX_FAKTOR+Syn_Location] = Cl_List.x[Cl_Step]
Analysismatrix.x[1][Cl_Step*MAX_FAKTOR+Syn_Location] = Syn_Location
Analysismatrix.x[2][Cl_Step*MAX_FAKTOR+Syn_Location] = G_AMPA
Analysismatrix.x[3][Cl_Step*MAX_FAKTOR+Syn_Location] = clivec[SynPos].max()
Analysismatrix.x[4][Cl_Step*MAX_FAKTOR+Syn_Location] = clivec[SynPos].min()
Analysismatrix.x[5][Cl_Step*MAX_FAKTOR+Syn_Location] = voltvec[SynPos].max()
Analysismatrix.x[6][Cl_Step*MAX_FAKTOR+Syn_Location] = voltvec[SynPos].min()
// Goto next Syn_Location
Syn_Location+=1
}
// ----- end of inner loop (Syn_Location-Loop) -------
// Save the Data --------------------------------------------------------------------
OutFile = new File()
sprint(OutFileName, "Result_BS-long_Cli-%gmM_gAMPA-%gpS.asc", Cl_List.x[Cl_Step],G_AMPA)
OutFile.wopen(OutFileName)
Outmatrix.fprint(OutFile, "\t%g")
OutFile.close
// Goto next Cl- Concentration
Cl_Step+=1
}
// ---------- End of outer loop (Cl_Step-Loop) ----------------------
// Save the Analysismatrix --------------------------------------------------------------------
OutFile = new File()
sprint(OutFileName, "Analysis_BS-long_Var-Cli_Var-Synloc_gAMPA-%gpS.asc",G_AMPA)
OutFile.wopen(OutFileName)
Analysismatrix.fprint(OutFile, "\t%g")
OutFile.close