Stimulation of gap junction with data from file

Anything that doesn't fit elsewhere.
Post Reply
bkg
Posts: 3
Joined: Fri Jan 23, 2009 9:38 am
Location: PAD

Stimulation of gap junction with data from file

Post by bkg »

Hello,
we would like to to stimulate a network of cells with external data. The architecture has following structure
-Two cells connected with over 600 gap junctions in their dendritic fileds,
- One cell receives inhibtory and exitatory graded input via gap junctions (2*600 inputs external data) in their dendritic field.
- The simulation should be controlled with the gui.
To test the implementation approach, I use the gap junction mechanism from the book for junctions between the cells and the the inhi- and exitaory input, created two nw-cells with the gui, conncet them with setpointer () as described, use fread (vread didn't worked) into vector and use vector.play. The external file has a resolution of 1ms. The hoc code loads without error, init works but running the simulation delivers voltage values values in the point process with zero. It's my first Neuron project, therefore I would like to get some support to get this working. Following the relevant hoc code parts:

Code: Select all

 
begintemplate First_Cell
...
public exilist, inhilist, gaplist
public gaps, gap, stims, exi, inhi
...
objref exilist
objref inhilist
objref gaplist
...
objref exi_
objref inhi_
proc stims() {
     for (i=0; i<=2; i=i+1) {
      d[i] exi_ = new Exi(0.1) exilist.append(exi_)
      d[i] inhi_ = new Inhi(0.9) inhilist.append(inhi_)
     }
}
objref gap_
proc gaps() {
     for i=0, 7 {d[i] gap_ = new Gap(0.5) gaplist.append(gap_)}
}
...
endtemplate First_Cell
// second Cell has only gaps defined with the mechanism as in proc gaps()

//Network specification interface
objref cells //, nclist, netcon
{cells = new List()  /*nclist = new List()*/}

func cell_append() {cells.append($o1)  $o1.position($2,$3,$4)
	return cells.count - 1
}
cell_append(new First_Cell(),	-50,	 55, 0)
cell_append(new Secnd_Cell(),	-48,	 9, 0)

//Connections for the inputs, vexi and vinhi are defined in separate mechanisms (copies from the gap mechanism)
double exin[First_Cell[0].exilist.count], inhin[HS_Cell[0].inhilist.count]
for (i=0; i<=2; i=i+1) {
     setpointer First_Cell[0].exilist.object[i].vexi, exin[i]
     setpointer First_Cell[0].inhilist.object[i].vinhi, inhin[i]
     }
// load data and initialize synapses, assumption: # of exitatory = inhibitory
//
objref stimexi[First_Cell[0].exilist.count], stiminhi[First_Cell[0].inhilist.count], exi, inhi, tv
proc init() {
tv = new Vector(tstop)
tv.indgen(tstop/dt)
exi = new File()
inhi = new File()
for (i=0; i<(First_Cell[0].exilist.count); i=i+1) {
  stimexi[i] = new Vector()
  stiminhi[i] = new Vector()
  exi.ropen("stimex.dat")
  stimexi[i].fread(exi, tstop)
  inhi.ropen("stiminhi.dat")
  stiminhi[i].fread(inhi, tstop)
  finitialize(v_init)

  }
}
// plays new data to synapses
proc advance() {
  for (i=0; i<(First_Cell[0].exilist.count); i=i+1) { 
    stimexi[i].play(&exin[i],tv,0)
    stiminhi[i].play(&inhin[i],tv,0)
    }
  fadvance()
}
For testing the data of stimex.dat etc. was created with vector.indgen and writen to file by fvec.write() on the same machine.
In a first version I've used setpointer() for the inputs to monitor vexi/vinhi for itself and used them in vector.play as veriable, but this doesn't worked too.
One additonal question: What must be the value of Dt in vec.play if the external file has 1 ms resolution and dt is 0.025 ms (1 or 40)?
Thanks
Bernd
ted
Site Admin
Posts: 6394
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Stimulation of gap junction with data from file

Post by ted »

bkg wrote:It's my first Neuron project
so don't try to eat the whole thing in one bite. Start by making a toy model that consists of two single compartment cells connected by one gap junction. Use an IClamp to drive one of the cells with a brief current pulse. Adjust the coupling between the cells so that you see something in the second cell that has a clearly different amplitude and time course from what you see in the first (driven) cell.

After you have that working, it's time to add whatever you will use to represent the "afferent drive" (input or forcing function). In your conceptual model, this is delivered by gap junctions that are connected to one of your cells. The question is, what is the most appropriate way to implement this in computational form?
The external file
is presumably a recording, or precalculated waveform, of something, but what? Time course of membrane potential in the cell(s) that provide the "afferent drive"? If so, then the best way to represent an afferent gap junction is with an SEClamp, whose rs = 1/gap junction conductance. Let dur1 = 1e9 and use Vector play to drive amp1. Of course, the way to do this is by adding just one SEClamp and making sure that everything works correctly before proceeding to the next steps.

Which are (with testing at each step to verify that what you get is what you intended):
--replace the single compartment model cells with cells that have whatever degree of anatomical complexity you need
--add more gap junction connections between the two cells
--add more "afferent gap junctions" (driven SEClamps) to the model
What must be the value of Dt in vec.play if the external file has 1 ms resolution and dt is 0.025 ms (1 or 40)?
1, since that's the interval at which the driving function was recorded (precalculated?). Use interpolated play
vsrc.play(&var, 1, 1)
so the data sequence will be treated as breakpoints in a piecewise linear function; otherwise you'll get a step function, which is almost certainly not what you want.
bkg
Posts: 3
Joined: Fri Jan 23, 2009 9:38 am
Location: PAD

Re: Stimulation of gap junction with data from file

Post by bkg »

Ted,
thank you for your fast reply. The current model derived more or less in the way you proposed. I've started with a single cell, tested caracteristics with IClamp and VClamp, build two simple cells with soma, axon and 8 dendrites, build a test network with available mechanism from the GUI, used then the 10.1.2 example from the book to connect both cells and stimulated the network with netstim, reused the hoc code to build a simple test network, step by step I've got it working. Now I have an issue getting the external data in to drive the model. Background for our work is, that we would like to integrate a compartmental model in an abstract model for a more complex structure. With this we would like to vlaidate parts of the high level model. Therefore I have only abstract values from the hig level model. To keep the model in a first step simple, I reuse the 10.1.2 example as model for the exi/inhibitory input synapses for the external data. But with my code the vector.play seems not to work. I think the issue might in the area where I made the connection for the input synapses with setpointer() but I have no clue. Do you have hint for me?
Thanks
Bernd
ted
Site Admin
Posts: 6394
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Stimulation of gap junction with data from file

Post by ted »

The key question: what does your "external data" represent? Is it the time course of membrane potential in a cell? If not, exactly what is it?
bkg
Posts: 3
Joined: Fri Jan 23, 2009 9:38 am
Location: PAD

Re: Stimulation of gap junction with data from file

Post by bkg »

Yes ,the external data represents the time course of the presynaptic axon membrane potential.
ted
Site Admin
Posts: 6394
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Stimulation of gap junction with data from file

Post by ted »

bkg wrote:the external data represents the time course of the presynaptic axon membrane potential.
There are two different ways to represent a gap junction between an "afferent" and your modeled cell.

One is with an instance of the Gap mechanism that is attached to your target cell, in which case you want vgap to be driven by the presynaptic waveform. But vgap is a POINTER, and unless I misremember, you can't simply use Vector play to drive a POINTER. So instead create a dummy variable and drive that with Vector play. Example:

Code: Select all

// assumes:
// objref gap is an instance of the Gap class that has been attached to the target cell
// gap.r has been set to the desired value
// vector vvec contains the recorded waveform
vdummy = 0 // creates the dummy variable
vvec.play(&vdummy, 1, 1) // vvec samples presyn v at 1 ms intervals, so interpolate
setpointer gap.vgap, vdummy
If you have multiple gap junctions and all are to be driven by the same presynaptic voltage, just add more setpointer statements, or better, append the gap junction objrefs to a List when you first create them, then iterate over the contents of the List

Code: Select all

for i=0,gaplist.count-1 setpointer gaplist.o(i).vgap, vdummy
This gets sloppy if each gap junction must be driven by a different presynaptic voltage, because each gap junction will need its own dummy variable. In such a case, I'd use SEClamp instead. SEClamp is just a voltage source in series with a resistor, plus a little logic to handle the classical three-step command potential sequence. Its amp parameters are simple RANGE variables, not pointers, so they can be driven directly by Vector play without having to resort to dummy variables or setpointer statements. Consequently the implementation is cleaner. The only "tricky" bit is to remember that its series resistance is called rs, not r, and to assign 1e9 to dur1 so that the command potential (which is going to be used as the presynaptic potential) is always specified by the value of amp1. Example:

Code: Select all

// assumes:
// objref gap is an instance of the SEClamp class that has been attached to the target cell
// gap.rs has been set to the desired value
// vector vvec contains the recorded waveform
gap.dur1 = 1e9 // so its "command potential" is always amp1
vvec.play(&gap.amp1, 1, 1) // vvec samples presyn v at 1 ms intervals, so interpolate
My personal preference is to use SEClamp because it's simpler code and requires less typing. Stimmt?
Post Reply