I am building a template of CA1 neuron, on the basis of the model of Jarsky. I have a template of Synapse that i would like to instantiate on this neuron, so that i can build an encapsulated and "clean" code.
My spine template :
Code: Select all
begintemplate SPINE
public PSD, CYTOSOL, NECK
create PSD
create CYTOSOL
create NECK
// section list
public spine
objref spine
//new spine(\ // example of call
// 0.2, // LSPINE=um \
// 0.2 , // diamSPINE=um \
// 0.5, // LNECK=um \
// 0.1, // diamNECK=um \
// 200, // Ra = ohm.cm // cytoplasmic resistivity : from Jarsky_gating_init.hoc \
// 0.75, // Cm = uF.cm-2 - specific membrane capacitance : from Jarsky_gating_init.hoc\
// -65, // e_pas = mV - leak potential \
// 40e3, // Rm = mV - specific membrane resistivity : from Jarsky_gating_init.hoc \
proc init(){
PSD{
L = 0.1*$1 // thivkness of PSD = 10% of total spine length ?
diam = $2
Ra = $5
Cm = $6
nseg = 1 // lambda_f(100)
insert pas
e_pas=$7
g_pas=1.0/$8
}
CYTOSOL{
L = 0.9*$1
diam = $2
Ra = $5
Cm = $6
nseg = 9 // lambda_f(100)
insert pas
e_pas=$7
g_pas=1.0/$8
}
NECK{
L = $3
diam = $4
nseg = 5
Ra = $5
Cm = $6
nseg = 9 // lambda_f(100)
insert pas
e_pas=$7
g_pas=1.0/$8
}
connect PSD(1), CYTOSOL(0)
connect CYTOSOL(1), NECK(0)
spine = new SectionList()
PSD spine.append
CYTOSOL spine.append
NECK spine.append
}
endtemplate SPINE
Code: Select all
// ALE - 2012.07.11 - template de neurone CA1 from Jarsky
load_file("SPINE_template.hoc")
begintemplate CA1
// All Dendrites
public dendA5_0, dendA5_00
create dendA5_0, dendA5_00
//spines
public spineA5_0, spineA5_00
objref spineA5_0, spineA5_00
// section lists
public all_apicals, all
objref all_apicals, all
// parameters
public global_ra // internal resistivity in ohm-cm
public Cm // specific membrane capacitance in uF/cm^2
public Rm // specific membrane resistivity in ohm-cm^2
public Vleak // leak reversal -66 in Cs+
proc init(){
// loads morphology
xopen("CA1_morpho.nrn")
// definition of lists of sections
initlists()
// initialize biophysics of the neuron
initchannels()
// populate dendrites with spines
initspines(all_apicals, 0.2)
}
proc initchannels(){
// parameters
global_ra=200.00 /* internal resistivity in ohm-cm */
Cm=0.75 /* specific membrane capacitance in uF/cm^2 */
Rm=40000 /* specific membrane resistivity in ohm-cm^2 */
Vleak=-70 /* leak reversal -66 in Cs+*/
// init all sections
forsec all {
insert pas
g_pas=1/(Rm)
Ra=global_ra
e_pas=Vleak
insert vmax
}
print "CA1 properties and channels are initialized"
}
proc initlists(){
all_apicals = new SectionList()
dendA5_0 all_apicals.subtree()
// all sections : forsec all is faster than forall - it is better to build this section list once at init
all = new SectionList()
forall all.append
}
proc initspines(){ localobj seclist, positions, strobj, tmplist, S
seclist = $o1
density = $2
forsec seclist {
positions = new Vector()
Nspines = cpt_positions(positions, L, density)
print Nspines
tmplist = new List()
for i=0, positions.size()-1 {
S = new SPINE(2, 2, 0.5,0.1, 200, 0.75, -65, 40e3)
tmplist.append(S)
secname() connect S.NECK(1), positions.x[i]
}
strobj = new StringFunctions()
strdef tmpstr, spineID
strobj.tail(secname(), "dend", tmpstr)
sprint(spineID,"spine%s", tmpstr)
sprint(tmpstr, "%s = new List()", spineID)
for i=0, tmplist.count - 1 {
sprint(tmpstr,"%s.append(tmplist.object(%d))", spineID, i)
print tmpstr
execute(tmpstr)
}
// execute(tmpstr) // error arising here
}
}
func cpt_positions(){
length = $2
density = $3
NSPINES = int(length*density)
if (NSPINES != 0){
dinter = 1.0/NSPINES
middle = 0.5
if(NSPINES%2==0) { // NSYN pair
// en aval
current_pos = middle + dinter/2.0
$o1.append(current_pos)
while (current_pos < (1.0-dinter)){
current_pos+=dinter
$o1.append(current_pos)
}
// en amont
current_pos = middle - dinter/2.0
$o1.append(current_pos)
while (current_pos > dinter){
current_pos-=dinter
$o1.append(current_pos)
}
}else{ // NSYN impair
current_pos = middle
$o1.append(current_pos)
// en aval
while (current_pos < (1.0-dinter)){
current_pos+=dinter
$o1.append(current_pos)
}
// en amont
current_pos = middle
while (current_pos > dinter){
current_pos-=dinter
$o1.append(current_pos)
}
}
}
$o1.sort()
return $o1.size()
}
endtemplate CA1
Code: Select all
// ALE - 10/07/2012
// loads the CA1 template several times and place it in different points of space
xopen("CA1_template.hoc")
objref N1
N1 = new CA1()
objref s
s = new Shape()
s.view(-50,-150,500,550,800,0,840,1050) //view(mleft, mbottom, mwidth, height, sleft, stop,swidth, sheight)
s.exec_menu("Show Diam")
s.exec_menu("Zoom in/out")
//s.exec_menu("3D Rotate")
s.exec_menu("View Axis")
//N1.dendA5_0 s.color(2)
forsec N1.all_apicals s.color(3)
1> I doubt that i can attach an object spine to a section like dendAX_Y, but i would like you to confirm this. This would indeed make the 'dot' notation impossible, am i right
I tried to tackle the problem another way. Creating public members spineAX_Y, attached to each section dendAX_Y, i may be able to retrieve each spine, using stringFunctions (split,tail,...), sprintf and execute(). The problem using the code above comes with the execute statement, that returns me a syntax hoc error :
Code: Select all
NEURON: syntax error
in test.hoc near line 7
{spineA5_0.append(tmplist.object(0))}
^
CA1[0].execute("spineA5_0.append(tmplist.object(0))")
CA1[0].initspines(SectionList[0], 0.2)
CA1[0].init()
xopen("test.hoc")
I am pretty sure that that can be done in an effecient way, but i admit that i am locked with that problems, as i tried several things without success. I am not very satisfied with the solution using string manipulations, so i was hoping you could suggest me language elements that i might have misunderstood.
Thanks for your help and suggestions.
Arnaud.