I am trying to make a network of passive tubes connected all on one side by gap junctions. I am hoping to have one central tube and the rest on the periphery.
When I attempt to connect them with gap junctions, I can record the gap junction voltage 'vgap' and that is as expected, but it doesn't seem to flow through to the other side of the gap junction. Am I missing a step here?
Code: Select all
from neuron import h
from neuron.units import ms, mV
from neuron import gui
import matplotlib.pyplot as plt
from math import sin, cos, pi
h.nrn_load_dll("C:\\Users\\Sophia Wienbar\\Documents\\ConeModel\\mod\\nrnmech.dll")
class ConeObj:
def __init__(self, gid, cellLength):
self.gid = gid
self.cellLength = cellLength
self.__morphology()
self.__conductances()
def __morphology(self):
self.tube = h.Section(name='tube', cell=self)
self.tube.L = self.cellLength
self.tube.diam = 1
self.all = [self.tube]
def __conductances(self):
for sec in self.all:
sec.Ra = 100 # Axial resistance in Ohm * cm
sec.cm = 1 # Membrane capacitance in micro Farads / cm^2
self.tube.insert('pas')
for seg in self.tube:
seg.pas.g = 0.001 # Passive conductance in S/cm2
seg.pas.e = -65 # Leak reversal potential mV
def __repr__(self):
return 'ConeObj[{}]'.format(self.gid)
def ConeNetwork(N, cellLength, Gj):
# construct a circle of N - 1 cones around a central cone
rad = 2 # um, radius of circle
cones = []
gapJ_toCenter = [0]*(N-1)
gapJ_fromCenter = [0]*(N-1)
# append central cone
cones.append(ConeObj(0, cellLength))
# make peripheral cones
for i in range(N-1):
cones.append(ConeObj(i+1, cellLength))
# connect the central cone to the outer cones via gap junctions
if N > 1:
for j in range(N-1):
print(j)
# connect central cone to peripheral
cones[0].tube.push()
gapJ_fromCenter[j] = h.gap(cones[0].tube(0.999))
gapJ_fromCenter[j].g = Gj # uS
h.pop_section()
cones[j+1].tube.push()
gapJ_toCenter[j] = h.gap(cones[j+1].tube(0.999))
gapJ_toCenter[j].g = Gj # uS
h.pop_section()
gapJ_fromCenter[j]._ref_vgap = cones[0].tube(0.999)._ref_v
gapJ_toCenter[j]._ref_vgap = cones[j+1].tube(0.999)._ref_v
return cones, [gapJ_fromCenter, gapJ_toCenter]
[Cones, GapJ] = ConeNetwork(6, 500, 10) # 6 cones that are 500 um long with Gj 10 nS
# define stimulus at one end
stim = h.IClamp(Cones[0].tube(0))
stim.delay = 2 # ms
stim.dur = 1 # ms
stim.amp = 0.1 # nA
CenterBeginV = h.Vector().record(Cones[0].tube(0)._ref_v)
CenterEndV = h.Vector().record(Cones[0].tube(1)._ref_v)
CenterGJ = h.Vector().record(GapJ[0][1]._ref_vgap)
NeighEndV = h.Vector().record(Cones[1].tube(1)._ref_v)
NeighBeginV = h.Vector().record(Cones[1].tube(0)._ref_v)
t = h.Vector().record(h._ref_t)
# begin stim
h.finitialize(-65 * mV)
h.continuerun(10 * ms)
# plot results
fig = plt.figure()
plt.plot(t, CenterBeginV, 'b')
plt.plot(t, CenterEndV, 'r')
plt.plot(t, CenterGJ, 'k')
plt.plot(t, NeighEndV, 'g')
plt.plot(t, NeighBeginV, 'm')
plt.ylabel('Voltage (mV)')
plt.xlabel('Time (ms)')
plt.show()
Code: Select all
NEURON {
SUFFIX gap
POINT_PROCESS gap
RANGE g, i
POINTER vgap
NONSPECIFIC_CURRENT i
}
PARAMETER { g = 1 (nS)}
ASSIGNED {
v (millivolt)
vgap (millivolt)
i (nanoamp)
}
BREAKPOINT { i = (vgap - v)*g*(1e-3) }