Random maximal conductances in template

NMODL and the Channel Builder.
Post Reply
lb5999
Posts: 56
Joined: Mon Oct 11, 2010 9:12 am

Random maximal conductances in template

Post by lb5999 »

Dear NEURON forum,

Everytime I call a template for a cell, I want it to pick parameters for certain membrane mechanisms from a distribution.

For example, I have the following code which creates a cell template and randomly assigns the parameter gbar_na from a normal distribution:

Code: Select all

begintemplate CellTemp
public soma
create soma

objref r

proc init() {
    create soma
	
	r = new Random()

	soma {
	nseg=1 
	L=15
	insert morphology {diam=15}
	insert na_ion {ena=60}
	insert ca_ion {eca=65}
	insert k_ion {ek=-75}
	insert capacitance {cm=4.2}
	insert na {gbar_na=r.normal(11e-2,11e-2)}
	insert kdr {gbar_kdr=0.1}
	insert cal {gbar_cal=0.7e-2}
	insert can {gbar_can=0.6e-2}
	insert cat {gbar_cat=0.4e-2}
	insert pas {e_pas=-10 g_pas=0.1e-2}
	}

	}
endtemplate CellTemp

objectvar cell[10]

for i=0, 10-1 {cell[i]=new CellTemp()}
However, when I check the parameter gbar_na it is the same for each cell. I want it to repick from the distribution at each call. Any help on this would be appreciated.

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

Re: Random maximal conductances in template

Post by ted »

Wrong way to introduce variance in model parameters because it violates the principle of modularity. Keep the template simple so it defines the properties of a "plain vanilla" model cell. Use an externally-defined procedure to add variance to each individual cell instance AFTER it has been created. Your code will be simpler and easier to debug. If you decide you want to change the rules that govern parameter variation, you don't have to change the template. Your cell instances will require less memory and model setup will be quicker (won't need to create a separate instance of Random for each cell).

"What if I want the individual cell instances to have different branching patterns?"

Write the template so that the number of sections created and how they are assembled are controlled by parameters that are passed when the cell instance is created. Selection of those parameters should be done by code that is EXTERNAL to the cell class template (e.g. a random number generator, or precalculated parameter values that are read from a file).
lb5999
Posts: 56
Joined: Mon Oct 11, 2010 9:12 am

Re: Random maximal conductances in template

Post by lb5999 »

Hi Ted,

Useful advice, thanks.

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

Re: Random maximal conductances in template

Post by ted »

Changing the properties of a model cell AFTER the cell instance is created is akin to what biologists call "posttranslational modification" (modification of a protein, not of the genetic sequence that coded for it). Very powerful way to tune the physiology of a system without having to expand the genome. There really is nothing new under the sun, is there?
Post Reply