Im having some trouble inserting a custom model (that Ive tested and it works) into the soma, and Id appreciate some help. Here it the definition of my cell template. The big change has been that Im now dynamically determining the type of synapse I want used (see synapses() definition). After Ive made this change, I get a run time error stating that there is a syntax error at "insert IAF":
nrniv: syntax error
in cellsIAF.template.oc near line 33
insert IAF // includes
^
Code: Select all
begintemplate CellSoma // create a new template object...
public soma, synlist
public init, connect2target
external nSyn
external nEx
objref synlist
create soma
proc init() {
synlist = new List() // Instantiate list of netcons
soma {
Ra = 35 // Axial Resistivity
nseg = 1
diam = 10 // diameter in um: L and diam are used to calculate area
L = 10 // length in um: relevant because g_pas is in mho/cm2
cm = 2 // capacitance
insert IAF // includes
}
synapses($o1)
}
obfunc connect2target() { localobj nc //$o1 target point process, optional $o2 returned NetCon
soma nc = new NetCon(&spike_IAF(0.5), $o1)
nc.threshold = 0.5
if (numarg() == 2) { $o2 = nc } // for backward compatibility
print "connecting cell"
return nc
}
proc synapses() { local j
for(j=0;j<nSyn;j=j+1) {
if ($o1.x[j] < nEx) {
synlist.append(new Syn())
} else {
synlist.append(new IFixSyn())
}
soma synlist.object(j).loc(0.5)
synlist.object(j).precell = $o1.x[j]
synlist.object(j).postcell = -1
}
}
endtemplate CellSoma
Code: Select all
dummy = rand.discunif(0,(nEx+nInh)-1)
objref preCellInds = new Vector(nSyn)
for(j=0;j<nSyn;j=j+1) {
preCellInds.x[j] = rand.repick()
}
objectvar Cell = new CellSoma(preCellInds)
Best,
Vishwa