// Model of 16 pyramidal cells (PCs) and 1 basket cell (IN) which shows a putative mechanism of cell replay during a sharp-wave ripple. // Proximal axonal collaterals of all PCs are connected by gap junctions and stimulated by current pulses at about 100 Hz (stim_interval_percell = 10 ms). // This creates synchronous spikes in the plexus of axonal collaterals, at nearly 200 Hz, which is hidden (not seen at somata and main axons). // An afferent EPSP in PC(0) unmasks the hidden axonal activity, which makes PC(0) to burst. // Bursting of PC(0) initiates a replay: PC(0)->PC(1)->PC(2) guided by two excitatory synapses (->) between the cells. The replay is triggered and guided by EPSPs, // but temporally driven by synchronous spiking of the axonal collaterals. // author: Nikita Vladimirov, PhD load_file("nrngui.hoc") load_file("template_PC.hoc") load_file("template_IN.hoc") load_file("gap_collat.hoc") Nx=4 Ny=4 ncells=Nx*Ny nbaskets = 1 gj_per_cell = 3 gj_radius_x = gj_radius_y = 4 gj_pos_random = 1 //0 if gjs positioned at 0.5, 1 if gjs positioned random(0,1) gj_pos=0.5 // used if gj_pos_random=0 gj_pos_min = 0.25 gj_pos_max = 0.75 gj_conductance = 3e-3 //[uS] stim_interval_percell = 10 // [ms], mean interstimulus interval, per cell // random number seeds: stim_seed = 2 // seed for axonal stimulation times gj_radius_seed = 3 // seed for connecting gap junctions gj_pos_seed = 4 // seed for gap junctions on the collateral // synaptic weights: wsyn_2PC = 0.005 //afferent->pyr wsyn_PC2PC = 0.005 // pyr->pyr wsyn_PC2IN = 0.0035 //pyr->bask wsyn_IN2PC = 0.040 //bask->pyr objref cells, baskets, gaps objref NetConL, IN2PCsynL, PC2INsynL, PC2PCsynL objref IpulseL, RandNetStimL, CA3NetStim PC2PCsynL = new List() PC2INsynL = new List() IN2PCsynL = new List() NetConL = new List() IpulseL = new List() RandNetStimL = new List() CA3NetStim = new NetStim() // coordinates of the extracellular electrode (um): Ex = 60 Ey = 20 Ez = 60 //////////////////// procedures and functions ////////////////////// proc mkPCs(){ local i localobj pyr // $1 is the total number of pyramidal cells cells=new List() //pyramidal cells for i=0,$1-1{ pyr = new pyramidalCA1() forsec pyr.axonal { nseg *= 9 } pyr.setcurrentbias_soma(-0.05) pyr.setcurrentbias_AIS(-0.1) cells.append(pyr) } } proc mkbaskets(){ local i localobj cell_ // $1 is the total number of basket cells baskets = new List() for i=0,$1-1{ cell_ = new basket() baskets.append(cell_) } } proc setpositions(){ local i, x, y, x_index, y_index for i=1,cells.count(){ x_index =(i-1)%Nx+1 x = (x_index-1)*40 y_index =(i-x_index)/Nx+1 y = (y_index-1)*40 cells.object(i-1).position(x,0,y) cells.object(i-1).setindexXY(x_index,y_index) } baskets.o(0).position(-40,0,-40) } proc rotateRandOY(){ local i, choices localobj rand choices = 4 rand = new Random() rand.discunif( 0, choices - 1 ) for i=0,cells.count()-1 { cells.o(i).rotateOY(2*PI*rand.repick()/choices) } } obfunc shuffle(){ local n, rand_ind, a localobj rand, shuff rand=new Random() shuff=new Vector($o1.size(),0) for (n=0; n<=$o1.size()-1;n=n+1){ shuff.x[n]=$o1.x[n] } for (n=$o1.size(); n>1; n=n-1){ rand_ind=rand.discunif(0,n-1) a=shuff.x[n-1] shuff.x[n-1]=shuff.x[rand_ind] shuff.x[rand_ind]=a } return shuff } func round() { return int($1+0.5) } /////////////// Connect the cells into a network by gap junctions /////////////// proc connect_gj(){ local i, i_gj, icell, xi, yi, xj, yj, n1, n2, attempt, check1, check2, pos1, pos2 localobj cell_gids, cell_gids_shuffled, gap_, stubs, rand2, rand3, gj_table ngaps=int(ncells*gj_per_cell/2) stubs=new Vector(ncells+1)// Fortan-style indexing, 1..ncells gj_table=new Matrix(ngaps+1,2) rand2=new Random(gj_radius_seed) rand3=new Random(gj_pos_seed) rand2.discunif(-gj_radius_x,gj_radius_x) rand3.uniform(0,1) stubs.fill(gj_per_cell) //regular stubs.x[0]=0 // fortran legacy gaps=new List() cell_gids=new Vector(cells.count()) cell_gids.indgen(1,cells.count(),1) cell_gids_shuffled=shuffle(cell_gids) i_gj=0 for i=0,cells.count()-1{ icell=cell_gids_shuffled.x[i]// icell=1..ncells, Fortran style xi=cells.object(icell-1).x_index yi=cells.object(icell-1).y_index while(stubs.x[icell]>0) { xj=xi+rand2.repick() yj=yi+rand2.repick() n1=icell n2=Nx*(yj-1)+xj attempt=0 check1=((xj<1)||(yj<1)||(xj>Nx)||(yj>Ny)||((xj==xi)&&(yj==yi))) if(check1==0){ //if cell is within range, try its free stubs check2=(stubs.x[n2]==0) } while ((check1 || check2) && (attempt<1000)){ attempt=attempt+1 xj=xi+rand2.repick() yj=yi+rand2.repick() n2=Nx*(yj-1)+xj check1=((xj<1)||(yj<1)||(xj>Nx)||(yj>Ny)||((xj==xi)&&(yj==yi))) if(check1==0){ //if cell is within range, try its free stubs check2=(stubs.x[n2]==0) } } if(attempt<1000 && i_gj