Neuron morphologies with LFPy python module

Where are they and what do they have?

Moderator: tom_morse

Post Reply
Posts: 3
Joined: Tue Jun 19, 2018 9:40 am

Neuron morphologies with LFPy python module

Post by mildan »

Hello everyone. I am testing a Python module named LFPy ( which is supposed to work with Neuron-based morphology files by a simple one-liner import.
I have been adviced to see if I can get something from the 'Traub model' ( ... odel=45539) to work with the LFPy. However, this model, with its numerous built-in parameters and simulation variants, seems incomparably more complicated than what is offered in the LFPy examples (like one presented here:).

Code: Select all

		/* create sections */
create    soma[1],\
		  apic[83] //dend11[83]

proc geometry() { local i, j

						/* soma[0] geometry */
    soma[0] {
        nseg = 1
/* 	diam = 25 */
/* 	L = 35 */

					/* connect primary neurites */
    soma[0] connect dend1[0] (0), 0.5
    soma[0] connect dend2[0] (0), 0.5
		soma[0] connect apic[0] (0), 0.5    

					/* neurite geometry*/
    for i = 0,8 {
        dend1[i] {
            nseg = fscan()
            for j = 1, fscan() {
/* branching topology*/
    for i = 1,8 {
        dend1[fscan()] connect dend1[i] (0), fscan()

    for i = 1,12 {
        dend2[fscan()] connect dend2[i] (0), fscan()


    1 4
   -54.8      6.5      -25      3.5
     -49      5.2    -24.3      3.5
   -44.5        7    -23.7      3.5
   -42.8      7.2    -24.5      3.5
There aren't even any key phrases (that I am familiar with) like 'create soma' or 'geometry' in the entirety of the Traub model files.
Has anyone the faintest idea how could I extract a little 'fancier' structure form the Traub model that has any chance of working with the LFPy? Or is there any more compatible source of morphology files that you could propose? I might be completely misguided here, this is all extremely new to me. Thanks a lot.
Site Admin
Posts: 6317
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine

Re: Neuron morphologies with LFPy python module

Post by ted »

Here are some things to be aware of when reusing one or more model cells implemented by someone else. This list assumes that the code that specifies the properties of the model cell(s) you want to reuse contains no bugs.

1. Is all of the original model specification code (i.e. the statements that specify the anatomical and biophysical properties) in one place, or is it scattered over two or more locations in the source file(s)? Ideally the original model specification code will be contained in a class definition (called a "Template" in hoc), but if it isn't, you'll need to find all of the statements that assign properties to the cell model(s) you want to reuse. Sometimes you'll find property assignment statements inside an "initialization" procedure; this is often done if the model requires a custom initialization e.g. to force the model to have a particular resting potential or concentration of one or more ions.

2. If the model has temperature-sensitive biophysical properties, make sure to identify the value of celsius (h.celsius, for all you Python fans) and use it in your own program.

3. Some model source code assigns different values to the same parameter at several different points in the program. In such cases, the safest thing to do is forget about reusing it. Second safest is to revise it, in which case you will want to use NEURON's Model View tool to determine parameter values AFTER the model's setup and initialization code has been executed. See for a link to a tutorial about this tool.

4. If you're mixing model cells from different sources, be particularly careful about temperature, reversal potentials, resting potentials, and ionic concentrations. There's no guarantee that two different models, even from the same lab, assumed the same reversal potentials etc.. If you find it necessary to reuse two model cells that were implemented for different temperatures, first figure out a good explanation to provide to whomever reviews your manuscript. Then figure out how you're going to deal with this in your model, because celsius is a global parameter in NEURON (has the same value everywhere). Don't forget that celsius affects more than temperature-sensitive rate constants--it also affects NEURON's own calculations of reversal potential from ionic concentrations. If you need help with this, ask, but it's better to avoid this situation in the first place.
Post Reply