Unbounded Membrane Voltage Increase

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

Moderator: hines

Post Reply
ajpc6d
Posts: 23
Joined: Mon Oct 24, 2022 6:33 pm

Unbounded Membrane Voltage Increase

Post by ajpc6d »

This may be a long-shot, but I'm hoping I can get some help with a new issue.

I've written a Python script to automate cell creation. The script worked perfectly for a cell with Hodgkin-Huxley-like governing equations stimulated by an 'activating function' approach. Now, I'm trying to change to model extracellular stimulation. To this end, I've included a segment.insert('extracellular') statement in the script. The result: membrane voltage skyrockets, I get overflow warnings, etc. There is no stimulation source inserted, no h.NetStim() or h.ExpSyn(), etc. The cell should be completely inert. I've tried both leaving 'extracellular' to its defaults and explicitly setting xraxial/xg=1e9 and e/xc=0.

Trying to diagnose what's going on, I manually created a cell using the same steps the script goes through, but I can't reproduce the behavior. The manually-created cell works perfectly.

I'm at a loss. The only difference is (should be) that my script is encapsulated in a Python class. This doesn't make sense to me as a culprit since using h.load_file('import3d.hoc') also wraps itself in a class. Has anyone witnessed this behavior before? Any ideas to fix or even to diagnose?
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Unbounded Membrane Voltage Increase

Post by ted »

Well, "insert" isn't something that hapens to a segment--it happens to a section. Example: if soma is a section,
this statement
soma.insert('pas')
would insert the pas mechanism into soma.

If you try to insert a mechanism into a segment under Python, you should get an error message similar to

Code: Select all

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'nrn.Segment' object has no attribute 'insert'
Without being able to reproduce the error (which would require that I have all necessary source code), there's no way I could even guess what would cause the symptom you encountered. If you zip up all of the necessary source code (that would probably be hoc, mod, and ses files, unless your program also needs swc, csv, txt, or dat files--but no .o or .c or .dll files) and email them to
ted dot carnevale at yale dot edu
along with usage instructions (e.g. what is the main file, are any command line options necessary etc.), I will tell you what I find out.
ajpc6d
Posts: 23
Joined: Mon Oct 24, 2022 6:33 pm

Re: Unbounded Membrane Voltage Increase

Post by ajpc6d »

I found the issue - bad model data. Just in case anyone else finds themselves with the same behavior, I was using swc data that defined the soma as a single point (in other words, soma_section.n3d()=1). By adding another xyz set to that section, the issue vanished.

My guess is that 'extracellular' was trying to calculate the potential change across a spatial discontinuity, thus causing the infinite membrane potential? (And for anyone interested, this also corrected the inordinate membrane voltage equilibration period I referenced in another of my posts.)

(And yes, my original post incorrectly referenced segment.insert() instead of section.insert() -- oops!)
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Unbounded Membrane Voltage Increase

Post by ted »

Thanks for the quick followup on that. If that particular swc file is available on line, could you please point me to it? I thought that problems with "one point somas" had been resolved a while ago, but apparently not.
ajpc6d
Posts: 23
Joined: Mon Oct 24, 2022 6:33 pm

Re: Unbounded Membrane Voltage Increase

Post by ajpc6d »

I did get the file online, but it was quite a while ago and I'm not sure of the source. The cell is the layer 5 pyramid from https://www.nature.com/articles/382363a0, but I had to do some searching to find it. Also, I believe I did some light re-formatting at some point; it's entirely possible I'm the real culprit here.
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Unbounded Membrane Voltage Increase

Post by ted »

That paper would correspond to ModelDB entry 2488 (modeldb.yale.edu/2488, modeldb.science/2488). The associated source code does not include any swc files. The "Overview" page of the ModelDB entry mentions http://www.cnl.salk.edu/~zach/methods.html and http://www.cnl.salk.edu/~zach/, but those URLs no longer point to anything. And the original publication in Nature says nothing about the origins of these morphologies (an unexplained failure of Nature's generally stringent review process).

So the online location of the swc in question is shrouded in mystery.

The following has nothing to do with the problem you encountered, but it needs to be stated:

This is an important caveat regarding the source code for this particular model entry: for each of the four model cells used in this paper,
the model setup code accounts for the contribution of spines to cell surface area by distorting the lengths and diameters of the sections. The amount of distortion varies from branch to branch, so you end up with peculiar looking models. Is there a way to avoid that? Yes. Use a model that accounts for the contribution of spines to cell surface area without stretching the model cell's branches.

. . . it would be inadvisable to use any of these models if you are interested in studying either extracellular stimulation or generation of local field potential by cellular activity. NeuroMorpho.org contains many neuronal morphologies that include axonal reconstructions, and at least some of them may be suitable for use in computational modeling.
This quote is from one of my posts on the NEURON Forum.
Post Reply