// 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 Cl--Concentration CLi = 25 //mM //Define Tau-AMPA DECAY_AMPA = 37 //ms // Define spatial properties of dendrite ANZAHL_NODES = 100 // Define number or Repetitions of the steps for the ampa delay 0 = -50 150 = + 100 AMPA_Delay_Steps = 150 //Number of repetitions // Define number or tau(GABA) values used Tau_GABA_Steps = 46 // 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.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-, AMPA_Delay_Steps+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, AMPA_Delay_Steps*Tau_GABA_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 ------------------------------------------------------------------------------ // --------------------------------------------------------------------------------------------------------- // Assign Cl- value in all compartments ---------------------------------------------- forsec all { cli0_cldif_CA3_NKCC1_HCO3 = CLi cli_Start_cldif_CA3_NKCC1_HCO3 = CLi cli_cldif_CA3_NKCC1_HCO3 = CLi } //-- Outer Loop Variation of [Cli] initial ------------------- Tau_GABA_Step = 0 while (Tau_GABA_Step < Tau_GABA_Steps){ // assign the new Decay value to the GABA synapse gabasyn.tau2 = Tau_GABA_Step+5 //-- Inner Loop Variation of synaptic location -------------------------------------------------------------- AMPA_Delay = 0 while (AMPA_Delay < AMPA_Delay_Steps) { // Assign Value to Synapse dend { synpulsegaba = new NetCon(stimGABApuls, gabasyn, 0, 0, G_GABA) if (AMPA_Delay == 0){ stimAMPApuls.start = ONSET_GABA_PULSE - 50 + AMPA_Delay synpulseampa = new NetCon(stimAMPApuls, ampasyn, 0, 0, 0) }else{ stimAMPApuls.start = ONSET_GABA_PULSE - 50 + AMPA_Delay synpulseampa = new NetCon(stimAMPApuls, ampasyn, 0, 0, G_AMPA) } } printf("Faktor = %g of %g ", Tau_GABA_Step*AMPA_Delay_Steps+AMPA_Delay+1, AMPA_Delay_Steps*Tau_GABA_Steps) Cl_graph.size(0, tstop, CLi- 1, CLi + 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 * AMPA_Delay_Steps) 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("- tauGABA = %g ms - delay %g ms - [Cl-]i = %g mM => Delta[Cl-]i = %g mM, Em = %g mV \n", Tau_GABA_Step+5, (AMPA_Delay-50), CLi, DeltaCl, voltvec[GABA_SynPos].max()) // Put Vectors in Outmatrix MakeShort(clivec[GABA_SynPos], shortclivec, lenghtoutputvec) MakeShort(voltvec[GABA_SynPos], shortvoltvec, lenghtoutputvec) shortclivec.x[0] = Tau_GABA_Step+5 shortvoltvec.x[0] = Tau_GABA_Step+5 shortclivec.x[1] = AMPA_Delay-50 shortvoltvec.x[1] = AMPA_Delay-50 Outmatrix.setcol(AMPA_Delay+1, shortclivec) Outmatrix.setcol(AMPA_Delay_Steps + AMPA_Delay+1, shortvoltvec) Analysismatrix.x[0][Tau_GABA_Step*AMPA_Delay_Steps+AMPA_Delay] = Tau_GABA_Step+5 if (AMPA_Delay == 0){ Analysismatrix.x[1][Tau_GABA_Step*AMPA_Delay_Steps+AMPA_Delay] = AMPA_Delay-50 Analysismatrix.x[2][Tau_GABA_Step*AMPA_Delay_Steps+AMPA_Delay] = 0 }else{ Analysismatrix.x[1][Tau_GABA_Step*AMPA_Delay_Steps+AMPA_Delay] = AMPA_Delay-50 Analysismatrix.x[2][Tau_GABA_Step*AMPA_Delay_Steps+AMPA_Delay] = G_AMPA } Analysismatrix.x[3][Tau_GABA_Step*AMPA_Delay_Steps+AMPA_Delay] = clivec[GABA_SynPos].max() Analysismatrix.x[4][Tau_GABA_Step*AMPA_Delay_Steps+AMPA_Delay] = clivec[GABA_SynPos].min() Analysismatrix.x[5][Tau_GABA_Step*AMPA_Delay_Steps+AMPA_Delay] = voltvec[GABA_SynPos].max() Analysismatrix.x[6][Tau_GABA_Step*AMPA_Delay_Steps+AMPA_Delay] = voltvec[GABA_SynPos].min() // Goto next Syn_Location AMPA_Delay+=1 } // ----- end of inner loop (Syn_Location-Loop) ------- // Save the Data -------------------------------------------------------------------- OutFile = new File() sprint(OutFileName, "Result_BS_gAMPA-%gpS_tauAMPA-%gms_Cli-%gmM_tauGABA-%gms_Var-temp_rel_AMPA.asc",G_AMPA*1000,DECAY_AMPA, CLi, Tau_GABA_Step+5) OutFile.wopen(OutFileName) Outmatrix.fprint(OutFile, "\t%.12g") OutFile.close // Goto next Cl- Concentration Tau_GABA_Step+=1 } // ---------- End of outer loop (Tau_GABA_Step-Loop) ---------------------- // Save the Analysismatrix -------------------------------------------------------------------- OutFile = new File() sprint(OutFileName, "Analyze_BS_gAMPA-%gpS_tauAMPA-%gms_Cli-%gmM_Var-tauGABA_Var-temp_rel_AMPA.asc",G_AMPA*1000,DECAY_AMPA, CLi) OutFile.wopen(OutFileName) Analysismatrix.fprint(OutFile, "\t%.12g") OutFile.close