Mechanisms not accessible in template

Anything that doesn't fit elsewhere.
Post Reply
Yaeger
Posts: 33
Joined: Mon Aug 19, 2013 4:36 pm

Mechanisms not accessible in template

Post by Yaeger » Tue Nov 26, 2013 4:08 pm

Hi, I am trying to create a template of a cell class in hoc. The only variable that I am declaring as public is soma, which contains all of the channel mechanisms. When I create an object from the template in Neuron, it clearly only has a capacitor (i.e. Neuron is not "seeing" the channels inserted into the soma). Does anyone know how to fix this? Here is an abbreviated version of my code below:

Code: Select all

begintemplate granule
	public soma
	create soma
	soma {
		nseg=1
		diam=11.8
		L=11.8 
		Ra=100
		cm=1
		celsius = 30
		
		insert GRC_LKG1 
		insert GRC_NA 
		insert GRC_KV
	}

endtemplate granule

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

Re: Mechanisms not accessible in template

Post by ted » Wed Nov 27, 2013 1:55 pm

A lot of effort is involved in writing a template from scratch, including much detail that seems quite artibrary, and there are many opportunities to make mistakes. Save yourself a lot of time and use the CellBuilder or the Network Builder, either of which is capable of exporting a correctly structured template that defines a new cell class.

"But I want to grow the cell (or specify its biophysical properties) algorithmically, and neither the CellBuilder nor the Network Builder lets me do that."

So construct a toy model cell with just a few sections and modest membrane properties, and export a cell class based on that. Then with that toy example as your starting point, use a text editor to add the stuff you want, one bit at a time and testing at each step, until you have accomplished your goal. Be sure to save the original exported template of your toy example, because it's a pattern that you can follow to create additional cell classes.

"But I really want to do all of this by writing code."

Don't worry, there'll be plenty of programming to do.-

Yaeger
Posts: 33
Joined: Mon Aug 19, 2013 4:36 pm

Re: Mechanisms not accessible in template

Post by Yaeger » Wed Nov 27, 2013 2:16 pm

I believe that I have solved the problem by including an init command in the template file:

Code: Select all

begintemplate Granule

public soma
	
create soma

proc init() {	
	create soma
	soma {
		nseg=1
		diam=11.8
		L=11.8 
		Ra=100
		cm=1
		insert GRC_LKG1 
		insert GRC_NA 
		insert GRC_KV
		}
}

endtemplate Granule
Now, after creating a new cell from this template, when I call the init() procedure, the cell clearly has access to the channels inserted into the soma.

Yaeger
Posts: 33
Joined: Mon Aug 19, 2013 4:36 pm

Re: Mechanisms not accessible in template

Post by Yaeger » Wed Nov 27, 2013 2:17 pm

Thanks Ted. I am now testing the template against the otherwise identical non-templated hoc file specifying the cell.

Post Reply