Driving a synapse with recorded or precomputed spike events
Posted: Wed Nov 10, 2010 11:12 am
There are several ways to drive synaptic mechanisms with previously recorded or computed spike events. Which is most appropriate for a particular instance depends on the nature of the modeling problem.
For cases in which there are just a few spikes to deliver in this way, it may be easiest to use an FInitializeHandler to load all of the spike times into the event queue in the course of initializing a simulation. This approach is discussed in NEURON's FAQ list
http://www.neuron.yale.edu/neuron/faq#playevents
If there are more than a few dozen precomputed spikes, it is best to fill a Vector with the spike times before the simulation run, and use an NMODL-defined artificial spiking cell that generates spike events at the times stored in that Vector. For an example of this strategy, see the files vecevent.hoc, vecevent.ses, and vecevent.mod in NEURON's installation tree under nrn/examples/nrniv/netcon (UNIX/Linux/OS X users: the complete tree is nrn/share/nrn/examples...).
vecevent.mod specifies the properties of an artificial cell class called VecStim. Each instance of the VecStim class has a play() method that can be used to specify the Vector from which that instance will read its "spike times" in the course of a simulation. Every VecStim instance may have its own different Vector.
vecevent.ses is a session file that recreates a model constructed with the Network Builder. This model consists of a single instance of the VecStim class. The VecStim class is a class of artificial spiking cell whose spike times are specified by the elements in a Vector.
vecevent.hoc illustrates the usage of a VecStim object; here's the file with comments added by me:
For cases in which there are just a few spikes to deliver in this way, it may be easiest to use an FInitializeHandler to load all of the spike times into the event queue in the course of initializing a simulation. This approach is discussed in NEURON's FAQ list
http://www.neuron.yale.edu/neuron/faq#playevents
If there are more than a few dozen precomputed spikes, it is best to fill a Vector with the spike times before the simulation run, and use an NMODL-defined artificial spiking cell that generates spike events at the times stored in that Vector. For an example of this strategy, see the files vecevent.hoc, vecevent.ses, and vecevent.mod in NEURON's installation tree under nrn/examples/nrniv/netcon (UNIX/Linux/OS X users: the complete tree is nrn/share/nrn/examples...).
vecevent.mod specifies the properties of an artificial cell class called VecStim. Each instance of the VecStim class has a play() method that can be used to specify the Vector from which that instance will read its "spike times" in the course of a simulation. Every VecStim instance may have its own different Vector.
vecevent.ses is a session file that recreates a model constructed with the Network Builder. This model consists of a single instance of the VecStim class. The VecStim class is a class of artificial spiking cell whose spike times are specified by the elements in a Vector.
vecevent.hoc illustrates the usage of a VecStim object; here's the file with comments added by me:
Code: Select all
load_file("nrngui.hoc")
load_file("vecevent.ses") // creates a VecStim object called vs_VecStim[0]
objref evec
evec = new Vector(100) // will hold times at which the VecStim should generate an event
evec.indgen // evec's elements are now 0, 1 . . . 99
vs_VecStim[0].pp.play(evec) // the VecStim object generates events at t = 0, 1 . . . 99 ms