Best practices for cell template

The basics of how to develop, test, and use models.
Post Reply
dave_arthurs
Posts: 6
Joined: Fri Jun 25, 2010 6:52 pm

Best practices for cell template

Post by dave_arthurs »

Hi,

I'm very new to neuron, having just gone through the tutorial by Gillies and Sterratt (http://www.anc.ed.ac.uk/school/neuron/). I'm trying to build a complex neural network that has multiple neuron types. For each neuron, I would like to have both a constant injected current (IClamp) and also a Poisson synaptic input (NetStim object connecting to an ExpSyn).

My question is, what are the best practices for doing this? Since each neuron will have its own Poisson source, it would make sense to me to stick these in the cell template as below. This seems to work; however, I wasn't able to find any examples of code online with people doing this, so I was wondering if it is taboo in NEURON for some reason. For example, could there perhaps be issues with the Poisson events not being independent?

Last question: Is there any way to avoid setting pp.number = 1e9, and instead just force the NetStim to just spike indefinitely?

Thanks a lot!

Dave



Code: Select all


begintemplate LTS_L5cell
	public soma, nclist, ncpp

	create soma
	objectvar nclist
	
	// for Poisson input
	objref pp, ncpp
	objectvar ppsyn

	proc init() {

	    create soma

	    nclist = new List()

	    soma {
	      nseg = 1
	      diam = 18.8 //these values shouldn't matter
	      L = 18.8    //these values shouldn't matter
	      insert hh_in
	      ena = 50					//From Lee 2013
	      ek = -95					//From Lee 2013
              gnabar_hh_in = 0.100 
	      gkbar_hh_in = 0.080

	      insert pas
	      e_pas=-67					//From Lee 2013
              g_pas = 0.0001		//From Lee 2008

	      insert KM
              gkmbar_KM = 0.004
              

	      cm=1.0                 // units uF/cm2
	    }
	    
	    // Poisson input soma
		ppsyn = new ExpSyn(0)
	    
	    // for Poisson input
	    pp = new NetStim(.5)
		pp.interval = 10
		pp.number = 1e9			//hack - better way to do this?
		pp.start = 10
		pp.noise = 1
		
		ncpp = new NetCon(pp,ppsyn)
		ncpp.weight = 0.5
		ncpp.delay = 1
	}
	
endtemplate LTS_L5cell


nLTS_L5cells = 1

objectvar LTS_L5cells[nLTS_L5cells]

for i = 0, nLTS_L5cells-1 {
    LTS_L5cells[i] = new LTS_L5cell()
}

objectvar LTS_L5stim[nLTS_L5cells]
for i = 0, nLTS_L5cells-1 {
	LTS_L5cells[i].soma {
	    LTS_L5stim[i] = new IClamp(0.5)
	    LTS_L5stim[i].del = 1000
	    LTS_L5stim[i].dur = 1000
	    LTS_L5stim[i].amp = 0.003
	    
	}
}

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

Re: Best practices for cell template

Post by ted »

dave_arthurs wrote:having just gone through the tutorial by Gillies and Sterratt (http://www.anc.ed.ac.uk/school/neuron/)
Two suggestions:
1. Use Lists to manage collections of objects. That applies to cells too. Yes, I know that G&S use "array notation" e.g. CellName to refer to the i+1th cell of the CellName class, but Lists allow one to write code that scales easily and avoids magic numbers.
2. This paper (avalable from a link at http://www.neuron.yale.edu/neuron/nrnpubs) illustrates the use of Lists, and presents other helpful strategies for constructing and managing network models. Its code contains reusable parts and is available from ModelDB.
Hines, M.L. and Carnevale, N.T.
Translating network models to parallel hardware in NEURON.
J. Neurosci. Methods 169:425-455, 2008.
One of the strategies that it presents is the answer to half of your next question:
For each neuron, I would like to have both a constant injected current (IClamp) and also a Poisson synaptic input (NetStim object connecting to an ExpSyn).
You may also find it helpful to read Randomness in NEURON models (see the link on the Documentation page http://www.neuron.yale.edu/neuron/docs).
Since each neuron will have its own Poisson source, it would make sense to me to stick these in the cell template as below.
Not really--that would violate the principle of modularity, producing the programmer's equivalent of one of those Swiss Army pocket knives that has dozens of "blades" but is too burdened with baroque complications to be much use for anything.
I wasn't able to find any examples of code online with people doing this
Right, and a good thing too. Not all code in ModelDB is of exemplary high quality, but at least there are a few bad examples that it does not yet contain.
Is there any way to avoid setting pp.number = 1e9, and instead just force the NetStim to just spike indefinitely?
1e9 is generally big enough. If not, try 1e10, or 6.0221e23, or maybe declare
FOREVER = 1e99
then do
pp.number = FOREVER
Post Reply