How to set up large network of gap junction coupled cells

NMODL and the Channel Builder.
Post Reply
Posts: 56
Joined: Mon Oct 11, 2010 9:12 am

How to set up large network of gap junction coupled cells

Post by lb5999 »

Dear NEURON Forum,

I have a large network of cells that are gap-junction coupled; 318 cells in total. The cells are simply somas. The coupling between cells is determined by a coupling matrix; if cell and cell[j] are coupled, CouplingMatrix.x[j]=1, else =0.

This coupling matrix is strictly lower triangular.

I now want to use this matrix to set up all the gap junction connections in my network of cells. I use something like:

Code: Select all

// All cells coupled




objectvar CoupledMatrix, CoupledFile
CoupledMatrix=new Matrix()
CoupledFile=new File()
CoupledFile.ropen("H4-1-1_CouplingMatrix.dat") // first line is NROW NCOL. Remove space from end of file.
CoupledMatrix.scanf(CoupledFile) // CoupledMatrix.x[2][1] = 1 so Cell[2].soma and Cell[1].soma are coupled.

objectvar gap[50244-1] // (318*318)/2-318 = elements in the strictly lower triangular matrix


for i=0, 159-1 {
for j=0, 318-1 {

gap = new gapjunction(cell[i],cell[j],0.5,0.5,0.0002*CoupledMatrix.x[i][j]) // 200pS



There are 318 cells, and so there are (318*159)-318 lower triangular entries, hence the iterations in the for loop. I think I have done this correctly, but I also feel that isn't the most efficient way of doing this. Many gap junctions have been generated, despite the gap junction conductance being 0. How do I make this code more sophisticated (and, I assume, the simulations faster), by only generating a gap junction point process when CoupledMatrix.x[j] is non-zero? Some kind of "if" statement?

Also, is this the most efficient way of handling such a large and complex (at least its one of the largest ones I have handled) network of coupled cells in NEURON? Any hints that would perhaps speed up simulations would be greatly appreciated.

Here is gapjunction.hoc:

Code: Select all

// makes a gap junction between 2 soma compartments
// $o1 - cell[1],
// $o2 - cell[2],
// $3, $4 - position within section1, section2
// $5 - gj conductance
begintemplate gapjunction
      public g
	  public setg, setcells, cell1, cell2
      objref con1, con2
      proc init() {
        objref con1, con2
        $o1.soma con1 = new Gap($3)
        $o2.soma con2 = new Gap($4)
        setpointer con1.vgap, $o2.soma.v($4)
        setpointer con2.vgap, $o1.soma.v($3)
		con1.g = $5
		con2.g = $5
	 proc setg() { // change the gj conductance externally
        con1.g = $1
        con2.g = $1
endtemplate gapjunction
Kind regards,
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine

Re: How to set up large network of gap junction coupled cell

Post by ted »

First suggestion is to create a gap junction only if its conductance will be nonzero.
Second is to keep track of the coupled cells by appending the cell ids (indices in this case) to a Vector (you might call this vector "coupled") at the time the junction is created. That way you'll know that gap junction i is associated with cells who indices are coupled[2*i] and coupled[2*i+1]. This is bound to work, regardless of the strategy you use to decide if a particular pair of cells is coupled (in your current example, it's quite easy to write a formula that generates the indices, but what if next week you decide to make random connections?).
Post Reply