Morphology bug in recreating Power et al., 2008?

Managing anatomically complex model cells with the CellBuilder. Importing morphometric data with NEURON's Import3D tool or Robert Cannon's CVAPP. Where to find detailed morphometric data.
Post Reply
neilthawani

Morphology bug in recreating Power et al., 2008?

Post by neilthawani »

Hi. I'm trying to re-create a morphological model of Power et al.'s (2008) BLA neuron.

This is the bug:
Image

Code: Select all

numApical = 21
numBasal = 45
numAxon = 2

create soma, axon[numAxon], apical[numApical], basal[numApical]

/************************/
/* connect axon to soma */
/************************/
connect soma(1), axon[0](0)
connect axon[0](1), axon[1](0)


/*******************************/
/* connect apical tree to soma */
/*******************************/
connect soma(0), apical[0](0)

connect apical[0](0.5), apical[1](0) // oblique1
connect apical[0](0.75), apical[2](0) // oblique2
connect apical[0](1), apical[3](0) // secondary1
connect apical[0](1), apical[4](0) // secondary2

// tertiary branches
connect apical[3](1), apical[5](0)
connect apical[3](1), apical[6](0)
connect apical[4](1), apical[7](0)
connect apical[4](1), apical[8](0)

// quaternary branches
connect apical[5](1), apical[9](0)
connect apical[5](1), apical[10](0)
connect apical[8](1), apical[11](0)
connect apical[8](1), apical[12](0)

// quaternary branches (terminating)
connect apical[6](1), apical[13](0)
connect apical[6](1), apical[14](0)
connect apical[7](1), apical[15](0)
connect apical[7](1), apical[16](0)

// 5th-order branches (terminating)
connect apical[9](1), apical[17](0)
connect apical[9](1), apical[18](0)
connect apical[12](1), apical[19](0)
connect apical[12](1), apical[20](0)


/******************************/
/* connect basal tree to soma */
/******************************/
connect soma(0.5), basal[0](0)
for i = 1, 4 {
	connect soma(1), basal[i](0)
}

for i = 0, 4 {
	connect basal[9*i](1), basal[9*i+1](0)
	connect basal[9*i](1), basal[9*i+2](0)
	connect basal[9*i+1](1), basal[9*i+3](0)
	connect basal[9*i+1](1), basal[9*i+4](0)
	connect basal[9*i+3](1), basal[9*i+5](0)
	connect basal[9*i+3](1), basal[9*i+6](0)
	connect basal[9*i+5](1), basal[9*i+7](0)
	connect basal[9*i+5](1), basal[9*i+8](0)
}


/****************************/
/* define cell morphologies */
/****************************/
forall {
	Ra = 200
}

soma      { L = 15  diam = 1.5  nseg = 3          Cm = 1}

axon[0]   { L = 75  diam = 1.25 nseg = 5          Cm = 1   }

axon[1]   { L = 250 diam = 0.5  nseg = 11 Ra = 50 Cm = 1   }

apical[0] { L = 50  diam = 2    nseg = 5          Cm = 1.3 }

for i = 1, 2 {
	apical[i] { L = 120 diam = 0.8  nseg = 13 Cm = 2 }
}

for i = 3, 4 {
	apical[i] { L = 40  diam = 1.25 nseg = 5  Cm = 2 }
}

for i = 5, 8 {
	apical[i] { L = 75  diam = 0.75 nseg = 9  Cm = 2 }
}

for i = 9, 10 {
	apical[i] { L = 40  diam = 1.25 nseg = 5  Cm = 2 }
}

for i = 11, 20 {
	apical[i] { L = 120 diam = 0.5  nseg = 13 Cm = 2 }
}

for i = 0, 4 {
	basal[9*t]   { L = 15  diam = 1.5  nseg = 3  Cm = 1.5 }
	basal[9*t+1] { L = 40  diam = 1.25 nseg = 5  Cm = 2   }
	basal[9*t+2] { L = 150 diam = 0.5  nseg = 15 Cm = 2   }
	basal[9*t+3] { L = 40  diam = 0.75 nseg = 5  Cm = 2   }
	basal[9*t+4] { L = 150 diam = 0.5  nseg = 15 Cm = 2   }
	basal[9*t+5] { L = 40  diam = 0.5  nseg = 5  Cm = 2   }
	basal[9*t+6] { L = 75  diam = 0.5  nseg = 7  Cm = 2   }
	basal[9*t+7] { L = 150 diam = 0.5  nseg = 15 Cm = 2   }
	basal[9*t+8] { L = 150 diam = 0.5  nseg = 15 Cm = 2   }
}
Thank you.
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Morphology bug in recreating Power et al., 2008?

Post by ted »

First, thank you for using NEURON in your research.

Next a question: was it not possible to copy the messages from NEURON's terminal window and paste them into the Forum? That should have worked for version 7.1.

Quoting from the Programmer's Reference entry on "connect"
http://www.neuron.yale.edu/neuron/stati ... ml#connect
SYNTAX
connect section(0or1), x
connect section(0or1), parent(x)

DESCRIPTION
The first form connects the section at end 0 or 1 to the currently accessed section at position x. An alternative syntax is the second form in which the parent section is explicitly indicated. If a section is connected twice a Notice is printed on the standard error device saying that the section has been reconnected (the last connection takes precedence).
Your code contains many statements that attempt to connect an internal location on the child section to its parent. These are syntax violations, and they will generate error messages of the form
"foo must connect at position 0 or 1"

An aside: a child section can be attached to any location on the parent, but attachment at locations other than 0 or 1 is generally employed only in special cases such as spines on dendrites.


Now three recommendations. The first is to use the latest release of NEURON 7.2, which has many bug fixes compared to 7.1. The other two are very strong suggestions for how to set up the branched topology of a model cell.

* Start with the root section (the root of a tree is the section that has no parent) and build outward from that. Example:

Code: Select all

create soma, axon dend // soma will be the root of the branched tree that constitutes this model cell
connect axon(0), soma(0)
connect dend(0), soma(1)
DON'T do this

Code: Select all

connect soma(1), dend(0)
connect axon(0), soma(0)
unless you really intend for dend to be the root of the tree.

* Always connect the 0 end of the child to its parent. Yes, connect allows the 1 end to be connected to the parent, but doing that will cause problems later. "What kind of problems?" It will mess up shape plots (read chapter 6 of The NEURON Book to discover how), and it will cause you endless confusion about whether
for (x)
iterates toward or away from the root section.
neilthawani

Re: Morphology bug in recreating Power et al., 2008?

Post by neilthawani »

ted wrote:First, thank you for using NEURON in your research.

Next a question: was it not possible to copy the messages from NEURON's terminal window and paste them into the Forum? That should have worked for version 7.1.
You're welcome. I enjoy NEURON very much.

I am so used to taking screenshots of my programming errors that I didn't think to try this. However, for your viewing pleasure, I have a new error when running my main.hoc file:
Neuron Error Code wrote: NEURON -- Release 7.1 (359:7f113b76a94b) 2009-10-26
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2008
See http://www.neuron.yale.edu/credits.html

loading membrane mechanisms from nrnmech.dll
Additional mechanisms from files
cal2.mod h.mod kadist.mod kaprox.mod kdrca1.mod na3.mod nax.mod
1
1
0
1
nrniv: graph : Redeclaring at top level
in C:/Users/Neil/Desktop/My Sah template/main.hoc near line 11
objref mainBox, graph
^
Here is the code:

Code: Select all

// Stylized BLA neuron template based upon Power et al., 2008

load_file("stdgui.hoc")
load_file("sah_morphology.hoc")
load_file("sah_biophysics.hoc")


/******************/
/* initialize GUI */
/******************/
objref mainBox, graph
mainBox = new VBox()
mainBox.intercept(1)
graph = new Graph()
graph.size(200,1200,-80,40)
graph.family(1)
graph.xaxis(0,1200)
graph.yaxis(-100,100)


/*****************************/
/* initialize pyramidal cell */
/*****************************/
objref pyramidal
pyramidal = new Cell()


/****************************/
/* initialize current clamp */
/****************************/
tstop = 1200

objref stepStim

pyramidal.soma stepStim = new IClamp(0.5)

stepStim.del = 300
stepStim.dur = 600
for i = 0, 6 {
	stepStim.amp = 0.05*i-1
	run()
}

nrncontrolmenu()
Ideas on what might be wrong with my objref?
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Morphology bug in recreating Power et al., 2008?

Post by ted »

Have you looked in the Programmer's Reference to see if there is already a keyword called "graph"?
neilthawani

Re: Morphology bug in recreating Power et al., 2008?

Post by neilthawani »

ted wrote:Have you looked in the Programmer's Reference to see if there is already a keyword called "graph"?
Hah. Foolish. Thank you.
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Morphology bug in recreating Power et al., 2008?

Post by ted »

Anyone who doesn't have this happen now and then is probably not writing much code.
Post Reply