modeling spontaneous firing

NMODL and the Channel Builder.
Post Reply
Brody M

modeling spontaneous firing

Post by Brody M »


I'm trying to implement a cell that fires spontaneously by using a technique described in the neuron book at chapter 10, example 10.8: intfire2.

According to the book, if we set ib to be bigger than one then the cell will fire spontaneously with rate i/taum, yet i tried it and it doesn't work.

Attached here is a basic code i tried using:

Code: Select all

	create soma
        diam= 30
	L = 30
	nseg = 1
	Ra = 100
	cm = 1	
	soma insert hh
////making the cell an intfire2 cell////
	objref if2
	soma if2 = new IntFire2(0)
	if2.ib = 1
	objref g
	g = new Graph()
	for i= 0, 40000{
I will appreciate any suggestions

thanks a lot
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine

Re: modeling spontaneous firing

Post by ted »

Your code creates a biophysical model cell and an artificial spiking cell. The biophysical model cell has the hh mechanism, but lacks any stimulus source that would perturb its membrane potential, so it isn't a surprise that it doesn't spike.

The artificial spiking cell is an instance of the IntFire2 class with ib parameter set to 1. If this is true
Brody M wrote:According to the book, if we set ib to be bigger than one then the cell will fire spontaneously with rate i/taum
then the IntFire2 cell should also remain silent.

A couple of suggestions:

1. Artificial spiking cells were originally implemented as point processes, and had to be attached to a "host" section. After a couple of years (unfortunately, after the NEURON Book was published) this awkwardness was eliminated by adding the ARTIFICIAL_CELL keyword to NMODL. An ARTIFICIAL_CELL does not need a host section.* This means you can create one simply by
objref anartificialcell
anartificialcell = new NameOfArtificialCellClass()
and in the context of your code, this would work fine:
if2 = new IntFire2()

*--the Programmer's Reference is always the most up-to-date source of documentation; the 2nd edition of the NEURON Book will contain many updates, but even so will only be current with the Programmer's Reference at its date of publication.

2. If you want to drive your biophysical model cell to spike, you'll need to attach an IClamp or AlphaSynapse. If you want your if2 cell to spike, you'll need to make ib > 1.

3. NEURON has a powerful and flexible standard run system that will take care of initialization and simulation execution (and a lot of other things) for you. Use it instead of trying to invent your own initiation and simulation flow control code. Example: insert this line at the top of your hoc file

Code: Select all

load_file("nrngui.hoc") // loads standard run system
and replace the stuff that starts at

Code: Select all

with this:

Code: Select all

  objref g
  g = new Graph(0)  // creates but does not display a new Graph
  g.size(0,tstop,-80,40)  // axis scaling
  // forget about the scene_vector stuff
  g.view(0, -80, tstop, 120, 200, 200, 300.48, 200.32)}  // draws it on the screen at 200,200
  // in a window with user-specified location (5th and 6th args) and size (last 2 args)
  graphList[0].append(vg)  // graphList[0] is for all objects that are to be
    // updated at integer multiples of dt
  g.addexpr("soma.v(0.5)", 1, 1, 0.8, 0.9, 2)

  // default dt is already 0.025
  // default tstop is only 5
  tstop = 20 // long enough to see some action
    // why let it grind on forever when you're in the development/debugging stage?
  // default v_init is -65 mV, fine for hh
  run() // initializes v to v_init, then runs a simulation
4. Instead of writing your own hoc code for graphs and simulation flow control, use the GUI. The Documentation page at has tutorials that will show you how. Write code only when necessary.

5. If you want a graph that plots the spike events generated by an artificial spiking cell, you'll have to record them to a Vector, then plot them after the end of the simulation. Easily done with a bit of hoc code, and there is at least one example in this Forum somewhere.
Post Reply