I just want to make each neuron connect randomly with the others in a small network with their synapses in the soma of the postsynaptic cell and of my great concern that the produced combinations from hoc to be automatically launched in the object instances Sthcells.soma SthCells[i+1].soma SthCells[i+2].soma inside my code so as to have the random network and run it directly. It is desired but not necessary to be able to choose the number of participating neurons and each one to make synapses with the 1/4 of nSThcells.For example in an 8 neurons net each one to make 2 synapses.
If it is not feasible to be compatible with the current code,
suppose I have a network of 8 subthalamic neurons how can I use random() to generate for me the random connections each one makes.Can you help me icorporate it inside the code ?
Code: Select all
SThcells[1].soma syn[0] = new ExpSyn(0)
SThcells[0].soma SThcells[1].nclist.append(new NetCon(&v(0), syn[0], -20, 1, 0.5))
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 = 150.224
// channels
......................................................................................
......................................................................................
// 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]
i=0
SThcells[i].soma {
stim[i] = new IClamp(0.5)
stim[i].del = 0
stim[i].dur = 0
stim[i].amp = 0
}
i=1
SThcells[i].soma {
stim[i] = new IClamp(0.5)
stim[i].del = 0
stim[i].dur = 0
stim[i].amp = 0
}
i=2
SThcells[i].soma {
stim[i] = new IClamp(0.5)
stim[i].del = 0
stim[i].dur = 0
stim[i].amp = 0
}
i=3
SThcells[i].soma {
stim[i] = new IClamp(0.5)
stim[i].del = 0
stim[i].dur = 0
stim[i].amp = 0
}
//synapse1 attach source:SThcells[0] -> target: SThcells[1] at point treeA[1]
maxsyn = 10
objectvar syn[maxsyn]
SThcells[1].soma syn[0] = new ExpSyn(0)
SThcells[0].treeB[1] SThcells[1].nclist.append(new NetCon(&v(0), syn[0], -20, 1, 0.5))
access SThcells[0].soma
//synapse2 attach source: SThcells[1] -> target:SThcells[2]at point treea[7]
SThcells[2].soma syn[1] = new ExpSyn(0)
SThcells[1].treeA[7] SThcells[2].nclist.append(new NetCon(&v(0), syn[1], -18, 1, 0.5))
access SThcells[1].soma
// synapse3 attach source: SThcells[2] -> target: SThcells[3] at soma
SThcells[3].soma syn[2] = new ExpSyn(0)
SThcells[2].soma SThcells[3].nclist.append(new NetCon(&v(0), syn[2], -18, 1, 0.5))
access SThcells[2].soma
...................................................................
xopen("sthE2.ses")
run()
Code: Select all
SThcells[i].soma syn[2] = new ExpSyn(0)
Can I modify the following?
Code: Select all
makeRandomSynapses(nSThcells)
nSynapses=countSynapses()
print nSynapses
objectvar synapsesCells[nSynapses]
proc attachCells() {
synapsesCells[$1]=new ExpSyn(0)
synapsesCells[$1].tau1=0.05
synapsesCells[$1].tau2=0.1
synapsesCells[$1].e=-30
SThcells[$2].soma SThcells[$3].nclist.append(new NetCon(&v(0),synapsesCells[$1],30,1,0.01))
Thank you in advance,
George.