The idea is that I can connect two cells by a gap junction by stating
objref gap[ngaps]
gap = new gapjunction(cell1, cell2)
then I can access that gap junctions conductance with gap.g, and I could access methods for that gap junction with gap.proc, and recall the two cells that makes it up with gap.cell1 and gap.cell2
So this is what I have generate
Code: Select all
ncells = 2
begintemplate cell
public soma
create soma
proc init() {
soma {
nseg = 1
L = 30
diam = 30
insert hh
}
}
endtemplate cell
begintemplate gapjunction
public cell1, cell2, g
proc init() {
objref con1, con2
cell1 = $o1
cell2 = $o2
cell1 con1 = new Gap(0.5)
cell2 con2 = new Gap(0.5)
con1.g = 0.001
con2.g = 0.001
setpointer con1.vgap, cell2.v(0.5)
setpointer con2.vgap, cell1.v(0.5)
}
proc break {
con1.g = 0.000
con2.g = 0.000
}
endtemplate gapjunction
//============
//MAKE THE CELLS AND CONNECT THEM
//============
objectvar c[ncells]
for i=0, ncells-1 { c[i] = new cell() }
objectvar gaps[2]
gaps[0] = new gapjunction(c[i].soma, c[i+1].soma)
Code: Select all
NEURON {
POINT_PROCESS Gap
NONSPECIFIC_CURRENT i
RANGE g, i
POINTER vgap
}
PARAMETER {
g = 0.001 (microsiemens)
v (millivolt)
vgap (millivolt)
}
ASSIGNED {
i (nanoamp)
}
BREAKPOINT {
i = g * (v - vgap)
}
nrniv: syntax error
in C:/nrn71/ctxnet/cell.hoc near line 26
cell1 con1 = new Gap(0.5)
Any thoughts on what I've done wrong? Also I'm a bit confused about the "external" statement. It's just so that I could access functions or variables i'd defined, from inside the init() statement right? I also don't quite get the init() statement. I understand the code in the init() block is executed when you instantiate a new version of the template, but why would you have anything OUTSIDE the init block (apart from the public, external etc statements)?
Also, even if I insert a new Gap in a cell such that I don't get any errors; I still can't access g, which is declared in the parameters block of the mod file. That is I can not do the following
Code: Select all
create soma
objref gaps[1]
soma gaps[0] = new Gap(0.5)
setpointer gaps[0].vgap, soma.v(0.5)
print gaps[0].g
Error: g not a public member of Gap