Problem initializing with rxd.Rate
Posted: Wed Apr 22, 2020 2:50 pm
I'm working on a model that includes changes in intracellular calcium as a function of several calcium currents and a pump for calcium efflux. I've implemented calcium as a reaction-diffusion Species, the currents are defined in mod files using GHK permeability, and I was hoping to use a reaction-diffusion Rate for the pump/efflux. No problem simulating changes in concentration due to influx from the currents, but when I tried to add the Rate for the calcium efflux, I got an exception when initializing the model. Here's my code - I commented out the parts that are dependent on my mod files so it can be tested w/o them, but left the code there for context/clarity:
With the caPump declaration commented out, it runs as expected, both as shown and with the mechanisms inserted. When the caPump declaration is added in, I get this:
I'm running NEURON 7.7 with Python 3.7.6 on Windows 10 Pro. The declaration of the rxd.Rate is based on several examples I found in the forums and documentation, so I'm guessing that either this is weirdly platform-specific or I've just done something very silly and can't spot it. Any thoughts?
Code: Select all
import sys
import matplotlib.pyplot as plt
# to prevent errors caused by accidentally importing twice
if 'neuron' not in sys.modules:
from neuron import h, rxd
h.load_file('stdrun.hoc')
# build sections
soma = h.Section(name='soma')
soma.L = soma.diam = 25
# insert mechs
#soma.insert('naf')
#soma.insert('kdr')
#soma.insert('nal')
#soma.insert('cal')
#soma.insert('sk')
pumpTau = -0.01
cyt = rxd.Region(h.allsec(), name='cyt', nrn_region='i')
ca = rxd.Species(cyt, name='ca', charge=2, initial=5E-5)
caPump = rxd.Rate(ca,pumpTau,regions=cyt) # problem is here
# record time
t = h.Vector().record(h._ref_t)
# record membrane potential
#v = h.Vector().record(soma(0.5)._ref_v)
# record currents
#inaf = h.Vector().record(soma(0.5)._ref_ina_naf)
#ikdr = h.Vector().record(soma(0.5)._ref_ik_kdr)
#isk = h.Vector().record(soma(0.5)._ref_ik_sk)
# record intracellular ca
caDat = h.Vector().record(ca.nodes[0]._ref_concentration)
h.finitialize(-45)
h.continuerun(1000)
# plots
#plt.subplot(3,1,1)
#plt.plot(t,v)
#plt.ylabel('v (mV)')
#plt.subplot(2,1,2)
#plt.plot(t,inaf)
#plt.plot(t,ikdr)
#plt.plot(t,isk)
#plt.subplot(3,1,3)
plt.plot(t,caDat)
plt.ylabel('cai (mM)')
plt.show()
Code: Select all
runfile('C:/pathgoeshere/runCell.py', wdir='C:/pathgoeshere')
Traceback (most recent call last):
File "_ctypes/callbacks.c", line 232, in 'calling callback function'
File "c:\nrn\lib\python\neuron\rxd\rxd.py", line 536, in _setup
initializer._do_init()
File "c:\nrn\lib\python\neuron\rxd\initializer.py", line 52, in _do_init
rxd._init()
File "c:\nrn\lib\python\neuron\rxd\rxd.py", line 1498, in _init
_compile_reactions()
File "c:\nrn\lib\python\neuron\rxd\rxd.py", line 1333, in _compile_reactions
_c_compile(fxn_string))
File "c:\nrn\lib\python\neuron\rxd\rxd.py", line 595, in _c_compile
dll = ctypes.cdll['./%s.so' % filename]
File "C:\ProgramData\Anaconda3\lib\ctypes\__init__.py", line 439, in __getitem__
return getattr(self, name)
File "C:\ProgramData\Anaconda3\lib\ctypes\__init__.py", line 434, in __getattr__
dll = self._dlltype(name)
File "C:\ProgramData\Anaconda3\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
Traceback (most recent call last):
File "c:\nrn\lib\python\neuron\rxd\rxd.py", line 1498, in _init
_compile_reactions()
File "c:\nrn\lib\python\neuron\rxd\rxd.py", line 1333, in _compile_reactions
_c_compile(fxn_string))
File "c:\nrn\lib\python\neuron\rxd\rxd.py", line 595, in _c_compile
dll = ctypes.cdll['./%s.so' % filename]
File "C:\ProgramData\Anaconda3\lib\ctypes\__init__.py", line 439, in __getitem__
return getattr(self, name)
File "C:\ProgramData\Anaconda3\lib\ctypes\__init__.py", line 434, in __getattr__
dll = self._dlltype(name)
File "C:\ProgramData\Anaconda3\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
NEURON: Python Callback failed
near line 0
^
finitialize(-45)
Traceback (most recent call last):
File "C:\pathgoeshere\runCell.py", line 40, in <module>
h.finitialize(-45)
RuntimeError: hoc error