"Procedure too long" error message

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
sanjaybioe
Posts: 14
Joined: Sun Apr 24, 2011 11:35 pm

"Procedure too long" error message

Post by sanjaybioe »

Dear Ted,

Further to your advice, I tried out a different way of making a template but am ending up in an error. From the model with accession number 101629 by Migliore, I took the geometry/morphology file alone(geo-cell1zr.hoc), and tried to create a template by adding appropriate lines of code, renaming it as Geometry.hoc. The whole code as of now is:

//changed axon and soma

load_file ("nrngui.hoc")

begintemplate CA3new

public soma, axon, dendrite, apical_dendrite

{create soma[1.]}
{create axon[1]}
{create dendrite[52.]}
{create apical_dendrite[81.]}

proc init(){

{access soma[0.]}
{pt3dclear()}
{pt3dadd(-1.135,21.,1.702,13.21)}
{pt3dadd(-1.135,21.,12.92,13.21)}

{soma[0] connect axon[0](0), 1}
{access axon[0]}
{pt3dclear()}
{pt3dadd(-0.568,-1,-0.023,1.5)}
{pt3dadd(3.5,7,7,1)}
{pt3dadd(5.5,14,7,1)}
{pt3dadd(6.5,22.5,6,1)}
{pt3dadd(6,29.5,7,1)}
{pt3dadd(1.5,36,12,1)}
{pt3dadd(-2.5,41,14,1)}
{pt3dadd(-7.5,45,15.5,1)}
{pt3dadd(-9,45,19.5,1)}
{pt3dadd(-13.5,45.5,22.5,1)}
{pt3dadd(-16.5,47,25.5,1)}
{pt3dadd(-11.5,51.5,30,1)}
{pt3dadd(-11.5,54.5,36.5,1)}
{pt3dadd(-11,57.5,40.5,1)}
{pt3dadd(-8.5,60.5,44.5,1)}

{soma[0.] connect apical_dendrite[0.](0), 1}
{access apical_dendrite[0.]}
{pt3dclear()}
{pt3dadd(-1.135,21.,1.692,13.21)}
{pt3dadd(-0.5,41.5,-9.5,7.8)}
{pt3dadd(-0.5,49.5,-8.5,7.2)}
{pt3dadd(-1.5,55.,-6.,7.3)}
{pt3dadd(-0.5,59.5,-11.5,7.3)}
.
.
.
//morphology continues here//
.
.
.
{pt3dadd(-148.,-136.5,50.,0.6)}
{pt3dadd(-150.5,-136.5,50.,0.6)}

{dendrite[49.] connect dendrite[51.](0), 1}
{access dendrite[51.]}
{pt3dclear()}
{pt3dadd(-65.5,-62.,18.,0.8)}
{pt3dadd(-67.5,-66.,18.,0.6)}
{pt3dadd(-68.5,-70.5,18.,0.6)}
{pt3dadd(-69.5,-72.,18.,0.6)}
{pt3dadd(-70.5,-75.,17.,0.6)}
{pt3dadd(-71.5,-80.,18.,0.6)}
{pt3dadd(-73.5,-85.,18.,0.6)}
{pt3dadd(-75.5,-88.5,18.,0.6)}
{pt3dadd(-77.,-93.5,18.,0.6)}
{pt3dadd(-75.,-96.,18.,0.6)}
{pt3dadd(-76.5,-101.,27.5,0.6)}
{pt3dadd(-76.5,-106.5,28.5,0.6)}
{pt3dadd(-78.5,-112.,27.5,0.6)}
{pt3dadd(-79.5,-118.,30.,0.6)}
{pt3dadd(-80.5,-120.,30.,0.6)}
{pt3dadd(-80.5,-122.,30.,0.6)}
{pt3dadd(-84.,-128.,28.5,0.6)}
{pt3dadd(-83.,-132.5,33.,0.6)}
{pt3dadd(-84.,-137.,33.,0.6)}
{pt3dadd(-86.,-136.,36.,0.6)}
{pt3dadd(-85.5,-139.5,37.,0.4)}
{pt3dadd(-87.5,-139.5,37.,0.4)}

}

endtemplate CA3new


// CREATING THE NUMBER OF CELLS

nCA3bnew = 2

objectvar CA3bnew[nCA3bnew]

for i = 0, nCA3bnew-1 {
CA3bnew = new CA3new()
}

access CA3bnew[0].soma
run()


I wrote another hoc file named Mainfile.hoc with the following statements:

load_file("nrngui.hoc")
xopen("Geometry.hoc")

Both of them are put in a single folder. When I run the main file, it gives me an error message :

NEURON -- VERSION 7.2 (524+:1a4443872b11+) 2011-06-14
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2008
See http://www.neuron.yale.edu/credits.html

1
1
nrniv: procedure too big
in Geometry.hoc near line 458
{pt3dadd(-4.,69.5,-11.5,6.4)}
^
xopen("Geometry.hoc" )
oc>

Why does this happen? Without the proc init () being put, if I look the shape plot I just see a set of short lines alone stacked in space. There doesn't seem to be any other syntax error, though there were quite a few ones which I corrected myself.

I have a basic question as well. When the xterm shows the error, is it exactly at the point where the arrow points or could it be anywhere in the said line.Now itself when I post this query the arrow pointing under 69.5 gets shifted to the leftend below the opening brace.

In a very long code how can we easily identify the line where the error is notified, say, line 506 in a code having 2234 lines?

Kindly help.

Sanjay.
ted
Site Admin
Posts: 6299
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: "Procedure too long" error message

Post by ted »

Break the procedure into several smaller procedures. Parse errors usually generate messages that refer to the line where the error occurred and may even contain specific clues about the nature of the error itself. Runtime errors may not, but instead might require you to insert comments that bracket suspicous code in order to track down the cause.

In this particular case, the fix is to break the long procedure into two or more shorter procedures. "How long should each be?" I'd suggest a "binary strategy"--

Code: Select all

Repeat
  cut the long procedure(s) in half, more or less
  try the revised program
until the error message disappears
Post Reply