// GENERATE A FAMILY OF SINGLE AND BURST PSPS DEPENDING ON E-I RATIO // JM Schulz, 2020 objref cvode cvode = new CVode() cvode.active(1) strdef ColLabel, file_name1, file_name2 objref shapeSyn //save output in python vectors nrnpython("import numpy as N") nrnpython("import matplotlib.pyplot as plt") nrnpython("from mpl_toolkits import mplot3d") objref p p = new PythonObject() nrnpython("Peak_PSP=N.zeros((0,))") nrnpython("Peak_PSP_AP5=N.zeros((0,))") nrnpython("X=N.zeros((0,))") nrnpython("Y=N.zeros((0,))") nrnpython("Arr_Peak_PSP=N.zeros((21,61))") nrnpython("Arr_Peak_PSP_AP5=N.zeros((21,61))") nrnpython("Arr_X=N.zeros((21,61))") nrnpython("Arr_Y=N.zeros((21,61))") nrnpython("x=0") nrnpython("y=0") nrnpython("peak=0") load_file("Calc_Func.hoc") // Numerical parameters for simulation. tstop = 350 // stop time of simulation stimStart=20 dtime=0.2 gluSyn_iter=21 GabaSyn_iter=61 // GABA reversal inhRev = -35 ampaWeight=0.00002 // 0.00002 = 1/7 of mature synapse in CA1 (Schulz et al. 2018); Li et al., 2017: 2 pA = 0.025 nS nmdaWeight=7*ampaWeight // Li et al., 2017 GABAweight_total=0.00024 alpha_vspom=-0.062 v0_block=10 //synGABA[0] is not rectifying, synGABA[1] is rectifying GABAweight0= GABAweight_total/5 GABAweight1= 4*GABAweight_total/5 GABAtau2=55 GABAtau1=3 shapeSyn = new Shape() shapeSyn.label("Syn") for (ii=0; ii0){ synGABA[2*(gg-1)].isOn=1 synGABA[2*(gg-1)+1].isOn=1 } for(jj=0; jj0){ synAMPA[jj-1].isOn=1 synNMDA[jj-1].isOn=1 } if (gg==5 && jj%4==1){curGr = graphList[0].append(Inh_intact_5)} if (gg==10 && jj%4==1){curGr = graphList[0].append(Inh_intact_10)} if (gg==30 && jj%4==1){curGr = graphList[0].append(Inh_intact_15)} if (gg==20 && jj%4==1){curGr = graphList[0].append(Inh_intact_20)} if (gg==0 && jj%4==1){curGr = graphList[0].append(NMDA_plus_AMPA) } if (jj==0 && gg%5==1){curGr = graphList[0].append(Inh_only) } finitialize() run() if (gg==5 && jj%4==1){graphList[0].remove(curGr-1)} if (gg==10 && jj%4==1){graphList[0].remove(curGr-1)} if (gg==30 && jj%4==1){graphList[0].remove(curGr-1)} if (gg==20 && jj%4==1){graphList[0].remove(curGr-1)} if (gg==0 && jj%4==1){graphList[0].remove(curGr-1)} if (jj==0 && gg%5==1){graphList[0].remove(curGr-1)} p.x=jj p.y=gg p.peak=get_max(recv,int(stimStart/dtime),int(tstop/dtime)-1)+80 nrnpython("Peak_PSP=N.append(Peak_PSP,peak)") nrnpython("Arr_Peak_PSP[int(x),int(y)]=peak") nrnpython("X=N.append(X,x)") nrnpython("Y=N.append(Y,y)") nrnpython("Arr_X[int(x),int(y)]=x") nrnpython("Arr_Y[int(x),int(y)]=y") } } print "simulation is done" nrnpython("fig1 = plt.figure()") nrnpython("ax = plt.axes(projection='3d')") nrnpython("ax.plot_surface(Arr_X, Arr_Y, Arr_Peak_PSP, rstride=1, cstride=1, cmap='jet', edgecolor='none')") nrnpython("ax.scatter(X,Y, Peak_PSP)") nrnpython("ax.set_xlim([21,-1])") nrnpython("ax.set_ylim([-0.5,61])") nrnpython("ax.set_xlabel('# Glu synapses')") nrnpython("ax.set_ylabel('# GABA synapses')") nrnpython("ax.set_zlabel('Peak Depol (mV)')") nrnpython("plt.show()")