Randomization of gap connections in the network

Anything that doesn't fit elsewhere.
Post Reply
archana

Randomization of gap connections in the network

Post by archana »

Hello Ted or Hines,

Am a new user of neuron and this is my first project using neuron software. I have problem in getting random connections among the dendrites of basketcells. I tried that by generating random number but some how my code is not inserting gap junctions at all. (Because i don't see any kind of spikelets when stimualted a basket cell and seeing response in the other.) I have exp2syn synapses randomly connected in the code. they are working good. But the setpointer variable which am using in gap junctions is not working. I dont see any kind of errors.
I need your help for getting code run. My network is with 500 granule cells , 6 basket cells, 15 mossy cells, 6 hipp cells. Am pasting the code for basket cells and random number generater for inserting gap junctions. Am using the MOD file for gap junctions from the neuron book.

Code: Select all

objref Bcell[nbcell]

	begintemplate BasketCell
ndend1=4
ndend2=4
ndend3=4
ndend4=4

public  pre_list, connect_pre, subsets, is_art, is_connected, gapjun, con_gap
public vbc2gc, vmc2gc, vhc2gc, vgc2bc, vbc2bc, vmc2bc, vhc2bc, vgc2mc, vbc2mc, vmc2mc, vhc2mc, vgc2hc, vmc2hc
public soma, bcdend1, bcdend2, bcdend3, bcdend4
public all, adend, bdend, cdend, ddend
create soma, bcdend1[ndend1], bcdend2[ndend2], bcdend3[ndend3], bcdend4[ndend4]
objref syn, pre_list, gaps[12]
nst=10
	objectvar stim[nst]
double stimdur[nst], stimdel[nst], stimamp[nst]
public stim, stimdur, stimamp, stimdel


objref syn
proc init() {
	pre_list = new List()
	subsets()
      gapjun()
      con_gap()
	temp()
	synapse()
}

objref all, adend, bdend, cdend, ddend

proc subsets() { local i
	objref all, adend, bdend, cdend, ddend
	all = new SectionList()
		soma all.append()
		for i=0, 3 bcdend1 [i] all.append()
		for i=0, 3 bcdend2 [i] all.append()
		for i=0, 3 bcdend3 [i] all.append()
		for i=0, 3 bcdend4 [i] all.append()

	adend  = new SectionList()
		bcdend1 [0] adend.append()
		bcdend2 [0] adend.append()
		bcdend3 [0] adend.append()
		bcdend4 [0] adend.append()

	bdend  = new SectionList()
		bcdend1 [1] bdend.append()
		bcdend2 [1] bdend.append()
		bcdend3 [1] bdend.append()
		bcdend4 [1] bdend.append()

	cdend  = new SectionList()
		bcdend1 [2] cdend.append()
		bcdend2 [2] cdend.append()
		bcdend3 [2] cdend.append()
		bcdend4 [2] cdend.append()

	ddend  = new SectionList()
		bcdend1 [3] ddend.append()
		bcdend2 [3] ddend.append()
		bcdend3 [3] ddend.append()
		bcdend4 [3] ddend.append()
}

proc temp() {

	soma {nseg=1 L=20 diam=15} // changed L & diam
		
	bcdend1 [0] {nseg=1 L=75 diam=4}	// bcdend 1 and 2 are apical
	bcdend1 [1] {nseg=1 L=75 diam=3}
	bcdend1 [2] {nseg=1 L=75 diam=2}
 	bcdend1 [3] {nseg=1 L=75 diam=1}

	bcdend2 [0] {nseg=1 L=75 diam=4}
	bcdend2 [1] {nseg=1 L=75 diam=3}
	bcdend2 [2] {nseg=1 L=75 diam=2}
	bcdend2 [3] {nseg=1 L=75 diam=1}
 		 
	bcdend3 [0] {nseg=1 L=50 diam=4} 	// bcdend 3 and 4 are basal
	bcdend3 [1] {nseg=1 L=50 diam=3}
	bcdend3 [2] {nseg=1 L=50 diam=2}
	bcdend3 [3] {nseg=1 L=50 diam=1} 
	
	bcdend4 [0] {nseg=1 L=50 diam=4}
	bcdend4 [1] {nseg=1 L=50 diam=3}
	bcdend4 [2] {nseg=1 L=50 diam=2}
	bcdend4 [3] {nseg=1 L=50 diam=1} 	

    
	forsec all {
		insert ccanl
	catau_ccanl = 10
	caiinf_ccanl = 5.e-6
		insert borgka
	gkabar_borgka=0.00015
		insert nca  // HAV-N- Ca channel
	gncabar_nca=0.0008   //check to modify- original 0.004
		insert lca 
	glcabar_lca=0.005
		insert gskch
	gskbar_gskch=0.000002
		insert cagk
	gkbar_cagk=0.0002
	}

	soma {insert ichan2  //ildikos ichan
	gnatbar_ichan2=0.12  //original 0.030 to .055 
	gkfbar_ichan2=0.013  //original 0.015
	gl_ichan2 = 0.00018
	cm=1.4
	} 

	forsec adend {insert ichan2
	gnatbar_ichan2=0.12  //original 0.015
	gkfbar_ichan2=0.013
	gl_ichan2 = 0.00018
	cm=1.4
	}		
	forsec	bdend {insert ichan2
	gnatbar_ichan2=0.0
	gkfbar_ichan2=0.00
	gl_ichan2 = 0.00018
	cm=1.4}
		
	forsec 	cdend {insert ichan2
	gnatbar_ichan2=0.0
	gkfbar_ichan2=0.00
	gl_ichan2 = 0.00018
	cm=1.4}

	forsec	ddend {insert ichan2
	gnatbar_ichan2=0.0
	gkfbar_ichan2=0.00
	gl_ichan2 = 0.00018
	cm=1.4}


	connect bcdend1[0](0), soma(1)
	connect bcdend2[0](0), soma(1)
	connect bcdend3[0](0), soma(0)
	connect bcdend4[0](0), soma(0)
	for i=1,3 {
	connect bcdend1[i](0), bcdend1[i-1](1)
	}
	for i=1,3 {
	connect bcdend2[i](0), bcdend2[i-1](1)
	}
	for i=1,3 {
	connect bcdend3[i](0), bcdend3[i-1](1)
	}
	for i=1,3 {
	connect bcdend4[i](0), bcdend4[i-1](1)
	}


	forsec all {Ra=100}
	forsec all {enat = 55 ekf = -90  ek=-90  elca=130	esk=-90
		 el_ichan2 =-60.06

		cao_ccanl=2 }  // make catau slower70e-3 	cao=2 cai=50.e-6 

And code for gap junctions.

Code: Select all

objref gaps[6]
proc gapjun(){
for i=0,5{
gaps[i] = new Gap(0.5)
gaps[i].r = 100
setpointer gaps[i].vgap, v(0.5)}
}

n_gaps=0
proc con_gap() { 
n_gaps +=1
for i = 0,3{
    setpointer gaps[n_gaps-1].vgap, bcdend1.v(0.5)
             }
               }

	func is_art()  { return 0 }
	endtemplate BasketCell
Code for randomization

Code: Select all

ropen("/proc/uptime") 
if (unix_mac_pc()==1)  {                                   // get a seed that is changing
rrseed = fscan()                       // so simulation will not start with the same seed
ropen()
} else {
rrseed = 12345 }   
objref rdgap        
rdgap = new Random(rrseed)
rdgap.binomial(1,0.5)
proc new_rdgap() {rdgap.discunif(0,3)}
new_rdgap()
x = int(rdgap.repick())

proc connect_gaps() {local i, j, n, pre 
n=0
for i=0,nbcell-1 { 
for j=1,2 {    
pre=i+j
if (pre >= nbcell) {pre -= nbcell}  
 if (x()){
Bcell[i].bcdend1[x].con_gap(Bcell[pre].bcdend1[x])
Bcell[pre].bcdend1[x].con_gap(Bcell[i].bcdend1[x]) 
n += 1 
}
}
} 
printf(" -with %d gaps inserted. ", n)
}

I am missing something in the code. This code is not inserting gap junctions.

Thank you.
ted
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Randomization of gap connections in the network

Post by ted »

Are you sure there are no instances of the Gap class?
If Gap is a point process, it must be attached to a section. What section is accessed at the time of Gap creation?
To answer these questions, change the "for" loop to

Code: Select all

for i=0,5{
gaps[i] = new Gap(0.5)
gaps[i].r = 100
setpointer gaps[i].vgap, v(0.5)}
  print "created object ", gaps[i], " attached to ", secname()
}
and see if it reports the creation of any Gap objects, and to which section they are attached.
Hint: try this with a small net that contains just a few instances of the cell class.

A comment about something that may cause difficulty in the future, if it hasn't already: this may be OK for demonstration purposes
ropen("/proc/uptime")
if (unix_mac_pc()==1) { // get a seed that is changing
rrseed = fscan() // so simulation will not start with the same seed
but it is not a good strategy for introducing randomness into a model when you are involved in serious work such as development, debugging, or "production" ("generation of publishable results"). It destroys the ability to reproduce the results of any particular run. Worse, it destroys the ability to detect whether any change you make to your program broke anything, because you will not be able to compare results against the known output of a "good implementation." It is much better to create a set of random seeds, store them in a file for future use, and read them from that file when needed.
Post Reply