I am new to NEURON and I want to simulate axo-axonal gap junctions in a convenient object-oriented way. As a toy model, I use 2 axons coupled to each other at both ends, and an IClamp in the center of one axon. Below I list my code (parts of it are taken from other posts), and it seems to work. But I need a robust code for large network simulations, so I wonder what is the best way to define gap junctions in specified positions of axons.
Any recommendations how to improve it? This is my first NEURON model, and I will appreciate any comments. Thanks!
axon.hoc
Code: Select all
load_file("nrngui.hoc")
begintemplate Cell
public axon
create axon
proc init(){
create axon
axon {
nseg = 100
diam = 25
L = 5000
insert pas
insert hh
}
}
endtemplate Cell
begintemplate gapjunction
public g, pos1, pos2
objref con1, con2
proc init() {
objref con1, con2
pos1=$2
pos2=$4
$o1.axon con1 = new Gap(pos1)
$o3.axon con2 = new Gap(pos2)
setpointer con1.vgap, $o3.axon.v(pos2)
setpointer con2.vgap, $o1.axon.v(pos1)
}
proc breakgap() {
con1.g = 0.000
con2.g = 0.000
}
endtemplate gapjunction
naxons=2
ngaps=2
objectvar Cells[naxons]
objectvar Gaps[ngaps]
for i=0,naxons-1{
Cells[i]=new Cell()
}
Gaps[0]=new gapjunction(Cells[0],0.9,Cells[1],0.9)
Gaps[1]=new gapjunction(Cells[0],0.1,Cells[1],0.1)
objectvar stim
Cells[0] stim=new IClamp(0.5)
stim.del=1.0
stim.dur=1.0
stim.amp=100.0
access Cells[0].axon
Code: Select all
NEURON {
POINT_PROCESS Gap
POINTER vgap
RANGE g, i
NONSPECIFIC_CURRENT i
}
PARAMETER { g = 1.0 (microsiemens) }
ASSIGNED {
v (millivolt)
vgap (millivolt)
i (nanoamp)
}
BREAKPOINT { i = (v - vgap)*g }