Netcon source

The basics of how to develop, test, and use models.
Post Reply
Cal

Netcon source

Post by Cal »

So I want to create converging synaptic inputs onto a single compartment neuron.
I have spike times for each of these inputs so I believe I should be using FInitializeHandler and the NetCon event() method (from reading the FAQ). Also, the synapses will have a form of use-dependent synaptic plasticity.

From what I have learned so far from reading through the forum and the Programmer's reference, my target should be a point_process (for now, it will be an alpha function).

So what should I be using as my NetCon 'source'? NetStim?

Thanks, Cal
ted
Site Admin
Posts: 6384
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Netcon source

Post by ted »

The source should be a NULLObject--see the documentation of NetCon
http://www.neuron.yale.edu/neuron/stati ... tml#NetCon

You can create a NULLObject simply by declaring an objref, e.g.
objref nil
Cal

Re: Netcon source

Post by Cal »

Well, that was easy enough. Thanks Ted!
ted
Site Admin
Posts: 6384
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Netcon source

Post by ted »

Using an FInitializeHandler to stuff the event queue during initialization does work, and it may be fine for your particular application, but it doesn't scale particularly well as the number of events grows large. Event queue overhead is proportional to the logarithm of the number of events in the queue, so if there are lots of events, you may not want to stuff them all at once. And you probably don't want to do it via an interpreted loop in hoc (or python, for that matter). For such cases, it is much better to use an NMODL-specified (therefore compiled) artificial spiking cell that passes one spike at a time to the event delivery system. This is what VecStim does--see vecstim.mod, which is provided (along with vecstim.hoc and vecstim.ses you you can easily see how to use it) in share/nrn/examples/nrniv/netcon (UNIX/Linux/OS X; c:\nrnxx\examples\nrniv\netcon\ for MSWin users).

If you are dealing with a network model that has been parallelized as described in
Hines, M.L. and Carnevale, N.T.
Translating network models to parallel hardware in NEURON.
J. Neurosci. Methods 169:425-455, 2008
(preprint available from http://www.neuron.yale.edu/neuron/bib/nrnpubs.html)
then you will be glad to know about PatternStim, an artificial spiking cell class that is built into NEURON and defined by c:\nrnxx\examples\nrniv\netcon\pattern.mod (UNIX/Linux/OS X users will have to expand the nrn...tar.gz file, then look in nrn-x.x/src/nrnoc for pattern.mod). This uses (gid, t) data to load the queue, 100 events at a time (after which the simulation will run until it is time to load another 100 events). For more info about PatternStim see viewtopic.php?f=31&t=1581&p=5647#p5647
Cal

Re: Netcon source

Post by Cal »

ted wrote:For such cases, it is much better to use an NMODL-specified (therefore compiled) artificial spiking cell that passes one spike at a time to the event delivery system. This is what VecStim does--see vecstim.mod, which is provided (along with vecstim.hoc and vecstim.ses you you can easily see how to use it) in share/nrn/examples/nrniv/netcon (UNIX/Linux/OS X; c:\nrnxx\examples\nrniv\netcon\ for MSWin users).
I don't see a 'vecstim', but I do find a 'vecevent'. Would this be what I'm looking for?
ted
Site Admin
Posts: 6384
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Netcon source

Post by ted »

You guessed right. Whaddaya know, I can't even copy & paste without making a mistake. The mechanism is called VecStim, but for reasons known only to the mighty gods of entropy, the mod, hoc, and ses files are called vecstim.* . Go figure.
Cal

Re: Netcon source

Post by Cal »

Okay. New question. So now I have multiple vectors of spike times. Now I've figured out that one spike time vector can drive multiple netcons - but what if I wanted groups of netcons driven by different spike time vectors??

Actually...

Code: Select all

numinputs = 5

objref rf
objref rsp[numinputs]
objref a[numinputs]
objref b[numinputs]
objref nc[numinputs]
objref nc2[numinputs]
objref fih
objref nil
strdef filename
strdef dumbfile

proc loadspikes() { local ii,numss,jj
jj = $1
numss = $2
for ii=0,numss {
nc[jj].event((rsp[jj].x[ii] + delay))
nc2[jj].event((rsp[jj].x[ii] + delay))
}}

rf = new File()

for iii = 0,numinputs-1 {
sprint(filename,"dumbfile%d.dat",iii)
dumbfile = filename
rf.ropen(dumbfile)


rsp[iii] = new Vector()
n = rsp[iii].scanf(rf)
numspiking = rsp[iii].size()
rf.close
nums = numspiking - 1

a[iii] = new IC_AMPA(0.5)
nc[iii] = new NetCon(nil,a[iii],0,1,ampaconduct)
nc[iii].weight = ampaconduct

b[iii] = new IC_NMDA(0.5)
nc2[iii] = new NetCon(nil,b[iii],0,1,nmdaconduct)
nc2[iii].weight = nmdaconduct

fih = new FInitializeHandler("loadspikes(iii,nums)")
}

This sort of works, well... it appears only the last vector of spike times are working. Any suggestions?
ted
Site Admin
Posts: 6384
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Netcon source

Post by ted »

one spike time vector can drive multiple netcons
Strictly speaking, this isn't quite the correct way to express what's going on, because it might lead someone to think that there is some kind of connection between a Vector and a NetCon, like there is between a Vector and a variable with the Vector class's play() method.
it appears only the last vector of spike times are working
Yep. Each time the code reaches the end of the for iii = 0,numinputs-1 { } there is an fih = new F... that steps on the F... that was set up on the previous pass.

A convenient idiom for dealing with multiple objects is to use Lists rather than arrays of objects. For example

Code: Select all

objref fihlist
fihlist = new List()
for ... {
  . . . all that other stuff . . .
  fihlist.append(new FInitializeHandler("..."))
}
At exit from the loop, fihlist contains references to all of the F... you created.

You might also want to use Lists to keep track of your synaptic mechanisms and NetCons.
Post Reply