Using h.APCount with the extracellular mechanism

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
andrewq
Posts: 1
Joined: Mon Jun 21, 2021 12:54 pm

Using h.APCount with the extracellular mechanism

Post by andrewq »

Hello all,

I am currently working on a model that uses the McIntyre MRG axon converted from hoc to python. In this model, I am looking for the threshold current value that would generate an action potential within the axon. The stimulation in this setup comes from a single point source electrode located 2 mm above the middle node of the axon that is generating a singular rectangular current pulse.

The basic setup code for the stimulation is found below, where the electrode_current variable is an array that represents the stimulus over time, used to scale the extracellular potential at each time step. I have checked to make sure that the entirety of the array is used within the run-time parameters.

Code: Select all

h.tstop = 40
h.dt = 0.02
h.v_init = -80
h.finitialize(h.v_init)
while h.t < h.tstop:
    for i in range(0, 21):
        axon1.nodes[i].e_extracellular = node_voltages[i]*test_current*(electrode_current[stim_counter])
    for i in range(0, 40):
        axon1.MYSA[i].e_extracellular = MYSA_voltages[i]*test_current*(electrode_current[stim_counter])
    for i in range(0, 40):
        axon1.FLUT[i].e_extracellular = FLUT_voltages[i]*test_current*(electrode_current[stim_counter])
    for i in range(0, 120):
        axon1.STIN[i].e_extracellular = STIN_voltages[i]*test_current*(electrode_current[stim_counter])
    stim_counter += 1
    h.fadvance()
Currently, when I use the method h.APCount on a node of ranvier far from the point electrode, the APCount.n method returns a value of 0, indicating that the threshold is never passed and an action potential is never generated. Is there any culprit that most likely would be causing this issue? Notably, I recorded and plotted the voltage value in the middle node of ranvier (axon1.nodes[10].v), a graph which showed that the voltage level remained at -80 mV until the moment when the stimulus was applied, at which the voltage value dropped all the way to -1600 mV.
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Using h.APCount with the extracellular mechanism

Post by ted »

You're sure that
1. the axon is excitable and can propagate a spike
2. you're allowing the simulation to run for long enough that a spike has time to propagate from its point of initiation to the location of the APCount
?

Here's a couple of questions for you:
Do you know what fraction of run time is consumed by all those for loops?
The code indicates that e_extracellular in every compartment is the product of two terms k and f, where k is a time-independent function of spatial location, and f(t) is a location-independent function of time--is this correct?
Post Reply