Membrane mechanisms xtra, extracellular collide with VecStim
Posted: Fri Feb 19, 2016 5:50 pm
Hello,
I am trying to use VecStim to input a spike train into an axon. I also need to record the membrane currents (via extracellular) and want to additionally stimulate the axon externally (via xtra). When inserting nothing but Hodgkin-Huxley (hh) channels into the membrane, everything is fine. BUT:
- extracellular causes the axon to only receive the first spike of the inserted series and
- xtra gives error 139.
Is there a way to get around this? Thank you very much for any help. Here the code:
Oh, and hello all! Great community, learned a lot by just reading. I could not find any thread addressing my issue though and hope this hasn't already been answered somewhere else.
I am trying to use VecStim to input a spike train into an axon. I also need to record the membrane currents (via extracellular) and want to additionally stimulate the axon externally (via xtra). When inserting nothing but Hodgkin-Huxley (hh) channels into the membrane, everything is fine. BUT:
- extracellular causes the axon to only receive the first spike of the inserted series and
- xtra gives error 139.
Is there a way to get around this? Thank you very much for any help. Here the code:
Code: Select all
import neuron
from neuron import h
import neuron.gui
import numpy as np
from matplotlib import pyplot
# set neuron simulation parameters
h.celsius = 33 # set temperature in celsius
h.tstop = 3e1 # set simulation duration (ms)
h.dt = 0.0025 #0.0005 # set time step (ms)
h.finitialize(-65) # initialize voltage state
# define axon
axonTest = h.Section(name='unmyelinated_axon')
axonTest.nseg = 20
axonTest.L = 1000
axonTest.diam = 1
# insert channels. Hodgkin-Huxley needed
axonTest.insert('hh')
# !!! ATTENTION
# here the problems arise, comment out for testing.
axonTest.insert('extracellular')
axonTest.insert('xtra')
# configure ExpSyn synapse
stim = h.ExpSyn(0, axonTest)
stim.e = 10
stim.i = 0.2
stim.tau = 3
# configure input to synapse
vecStim = h.VecStim()
vec = h.Vector([5, 25])#[1, 2])
vecStim.play(vec)
# connect synapse and VecStim input
netCon = h.NetCon(vecStim, stim)
netCon.weight[0] = 1
#observe synapse current
iSynVec = h.Vector()
iSynVec.record(stim._ref_i)
# and observe axon potentials
vAxonVec0 = h.Vector()
vAxonVec0.record(axonTest(0)._ref_v)
vAxonVec1 = h.Vector()
vAxonVec1.record(axonTest(1)._ref_v)
# record time, too
timeVector = h.Vector()
timeVector.record(h._ref_t)
# run simulation
h.run()
# convert recorded signals to numpy arrays
timeArray = np.array(timeVector)
iSynArr = np.array(iSynVec)
vAxonArr0 = np.array(vAxonVec0)
vAxonArr1 = np.array(vAxonVec1)
# plot synapse currents and axon potentials
pyplot.plot(timeVector,vAxonArr0, label='Axon potential at start-position')
pyplot.plot(timeVector,vAxonArr1, label='Axon potential at end-position')
pyplot.plot(timeVector,iSynArr, label='Synapse current')
pyplot.legend()
pyplot.show()