Dear ted / Raj,
based on PartC of the tutorial (Gillies and Sterratt) I made my subthalamic network model (using my own treeA and treeB data).
Just to cite a part of it: (similar to the code of partC)
Code: Select all
load_file("nrngui.hoc")
objref cvode
cvode = new CVode(0)
begintemplate SThcell
public soma, treeA, treeB, nclist
create soma, treeA[1], treeB[1]
objectvar f, nclist
proc init() {local i, me, child1, child2
create soma
nclist = new List()
soma {
nseg = 1
diam = 18.8
L = 18.8
Ra = 123.0
insert hh
ena = 71.5
ek = -89.1
gnabar_hh=0.25
gl_hh = .0001666
el_hh = -60.0
// channels
insert Na
insert NaL
insert Ih
insert Cacum
insert sKCa
insert CaN
insert CaT
.....................
}
f = new File()
f.ropen("treeA.dat")
ndendA = f.scanvar()
create treeA[ndendA]
for i = 0,ndendA-1 {
me = f.scanvar() - 1
child1 = f.scanvar() - 1
child2 = f.scanvar() - 1
treeA[me] {
nseg = 1
diam = f.scanvar()
L = f.scanvar()
Ra = 123
// initialise and clear the 3D information
pt3dclear()
pt3dadd(f.scanvar(),f.scanvar(),f.scanvar(),diam)
pt3dadd(f.scanvar(),f.scanvar(),f.scanvar(),diam)
// channels
................................
if (child1 >= 0) {
printf("connecting tree A dendrite %d (0 end) to parent %d (1 end)\n",child1,me)
connect treeA[child1](0), 1
}
if (child2 >= 0) {
printf("connecting tree A dendrite %d (0 end) to parent %d (1 end)\n",child2,me)
connect treeA[child2](0), 1
}
}
}
f.close()
f.ropen("treeB.dat")
//the same for treeB
.................................................................
// Connect trees to the soma
connect treeA[0](0), soma(1)
connect treeB[0](0), soma(0)
}
endtemplate SThcell
tstop = 800
ndend = 2
nSThcells = 4
objectvar SThcells[nSThcells]
for i = 0, nSThcells-1 {
SThcells[i] = new SThcell()
}
objectvar stim[nSThcells]
//the stimuli
.......................................................
// SThcells[0] -> SThcells[1].soma
maxsyn = 10
objectvar syn[maxsyn]
SThcells[1].treeA[1] syn[0] = new ExpSyn(0)
SThcells[0].soma SThcells[1].nclist.append(new NetCon(&v(0), syn[0], -20, 1, 0.8))
access SThcells[0].soma
// SThcells[1] -> SThcells[2].soma
SThcells[2].treeA[2] syn[1] = new ExpSyn(0)
SThcells[1].soma SThcells[2].nclist.append(new NetCon(&v(1), syn[1], -18, 1, 0.8))
access SThcells[1].soma
// SThcells[2] -> SThcells[3].soma
SThcells[3].soma syn[2] = new ExpSyn(0)
SThcells[2].soma SThcells[3].nclist.append(new NetCon(&v(2), syn[2], -18, 1, 0.9))
access SThcells[2].soma
xopen("SthNet.ses")
run()
Your code specifies L and diam, and does not use pt3dadd statements.
Now just from curiosity about an older question:
my code above uses pt3dclear and pt3dadd statements is it now possible to make it 'top-level' and import the topology into CellBuilder even though losing diam and L?
If yes ,apart from removing template statements what else can I modify?
Referring to the lower part of the code I tried to connect the four cells together by making three synaptic objects guided by "dealing with lists " of partC. So I made the consecutive connections: sthcells[0] -> sthcells[1] -> sthcells[2]->sthcells[3]
Although I have to admit that I haven't tottaly grasped the function and syntax form of lists,nclist,append and netcon objects,I have some questions referring to the lower part of the code :
1)If I guess right, ExpSyn[0] refers to a kind of synapse with exponential decay but I don't understand where the subscript [0] refers to?
2)The same question about Syn[?],
I put Syn[0] Syn[1] Syn[2] respectively as you can see.
3)About the argument of ......new NetCon(
&v(), syn[1],.........))
I see that "&v()" refers to the voltage source but for example in my first synapse:
// SThcells[0] -> SThcells[1].soma
SThcells[1].treeA[1] syn[0] = new ExpSyn(0)
SThcells[0].soma SThcells[1].nclist.append(new NetCon(&v
(0), syn[0], -20, 1, 0.8))
what this (0) means?
Was it right to put v(1) v(2) v(3) for each one?
4)I understand this: SThcells[1].treeA[1] syn[0] = new ExpSyn(0)
as a synapse of expDecay attached to treeA[1] branch of SThcells[1]
but what about this part of the code:
.nclist.append(new NetCon(&v(0),... of the next line?what does this
nclist offer?
P.S. I tried to understand them from the examples of Chapter 11:modeling networks but I didn't make it,
Have you anywhere any tutorial or index for these statements lists,nclist,append and netcon (their function and syntax form) similar to that you have for NMODL statements?