hoc file is not a template

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

Moderator: hines

Post Reply
alexandrapierri
Posts: 25
Joined: Wed Jun 17, 2015 5:31 pm

hoc file is not a template

Post by alexandrapierri »

Hello NEURON team

I want to instantiate the izhekevic neuron Izhi2003a.hoc attached, but I get the error: "Izhi2003a is not a template"
I did some basic troubleshooting and I added "load_file("import3d.hoc") and load_file("nrngui.hoc")" at the beginning of the file but the issue persists.
I would very much appreciate any guidance on this.

Code: Select all

loading membrane mechanisms from C:\Users\Alexandra\Desktop\nrnmech.dll
Additional mechanisms from files
 izhi2019.mod
        1
        1
        1
        1
        1
nrniv: Izhi2003a is not a template
 in izhi2004a-1.hoc near line 16
 izh=new Izhi2003a() // 2003 and 2004 papers shared same parameterizations
                   ^
oc>quit()
Here is the beginning of the script. I can send it all if needed.

Code: Select all

load_file("stdgui.hoc")
load_file("import3d.hoc")
load_file("nrngui.hoc") // always a good idea
load_file("subiter.hoc")
nrnmainmenu()
objref g[10]
tstop=500

//* setup the cell
create acell
access acell
objref izh,stim,nc,fih[2]
cvode_local(1)
acell izh=new Izhi2003a() // 2003 and 2004 papers shared same parameterizations

//* parameters for different cell types
objref avec,bvec,cvec,dvec,vviv,tstv,butnl,bub
avec=new Vector()
{bvec=avec.c cvec=avec.c dvec=avec.c vviv=avec.c tstv=avec.c}
// parameters a,b,c,d for different models
avec.append(0.02,0.02,0.02,0.02,0.02,0.01,0.02,0.2,0.02,0.05,0.1,0.02,0.03,0.03,0.03,0.1,1,0.02,-0.02,-0.026)
bvec.append(0.2,0.25,0.2,0.25,0.2,0.2,-0.1,0.26,0.2,0.26,0.26,-0.1,0.25,0.25,0.25,0.26,0.2,1,-1,-1)
cvec.append(-65,-65,-50,-55,-55,-65,-55,-65,-65,-60,-60,-55,-60,-52,-60,-60,-60,-55,-60,-45)
dvec.append(6,6,2,0.05,4,8,6,0,6,0,-1,6,4,0,4,0,-21,4,8,-2)
objref playvec,playtvec
{playvec=new Vector() playtvec=new Vector()}
tom_morse
Posts: 44
Joined: Wed May 18, 2005 10:23 pm
Location: Yale University School of Medicine
Contact:

Re: hoc file is not a template

Post by tom_morse »

Maybe you meant to compile the mod files in this 39948 entry and then run your code? (The is not a template error is misleading since having Izhi2003a as a suffix in a mod file is a possible solution to resolving the error).

https://senselab.med.yale.edu/ModelDB/s ... mod#tabs-2

When I did that (storing your Izhi2003a.hoc file in the same folder as the above) your hoc file started OK:
nrngui Izhi2003a.hoc
NEURON -- VERSION 7.8.0-99-gda5790d7 master (da5790d7) 2020-03-19
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2019
See http://neuron.yale.edu/neuron/credits

loading membrane mechanisms from /home/morse/tmp/tmp/izhikevich_simple_nrn/x86_64/.libs/libnrnmech.so
Additional mechanisms from files
izhi2003a.mod izhi2003b.mod izhi2007a.mod izhi2007b.mod izhi2007bS.mod
1
1
1
1
1
Vector[3]
Vector[4]
Vector[5]
Vector[6]
oc>
alexandrapierri
Posts: 25
Joined: Wed Jun 17, 2015 5:31 pm

Re: hoc file is not a template

Post by alexandrapierri »

thank you! I was originally under the impression that the hoc file relies on fewer mod files and not most of the box. I am getting a better sense of the model now. Regarding the same repository I downloaded the 39948 entry and tried to run the "izhi2004a.hoc" according to the README instructions. I want to plot/recreate the voltage output of the different izhikevic cells.The GUI loads successfully but as I select spike patters for the izhikevic neuron I get the error:

Code: Select all

oc>nrniv: We were unable to associate a PlayRecord item with a RANGE variable
 near line 2
 {hoc_pointer_(&izh.V)}
                       ^
        finitialize(-65)
      init()
    stdinit()
  run()
and others
I'd appreciate any guidance on troubleshooting this error.
salvadord
Posts: 86
Joined: Tue Aug 18, 2015 3:49 pm

Re: hoc file is not a template

Post by salvadord »

Hi Alexandra,

I just tested the model and I was able to instantiate the izh2003 cell. I'm on Mac OS and what I did is just compile the mod files and then run the simple.py script. I noticed you are using hoc code, so just curious to know if you tried the python version (simple.py) and if that one works for you?

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

Re: hoc file is not a template

Post by ted »

With regard to the problem that occasioned your first post in this thread, which opened with
I want to instantiate the izhekevic neuron Izhi2003a.hoc attached, but I get the error: "Izhi2003a is not a template"
That post included the output that NEURON printed to its terminal, from which I quote the diagnostically important part:

Code: Select all

loading membrane mechanisms from C:\Users\Alexandra\Desktop\nrnmech.dll
Additional mechanisms from files
 izhi2019.mod
        1
        1
        1
        1
        1
nrniv: Izhi2003a is not a template
 in izhi2004a-1.hoc near line 16
 izh=new Izhi2003a() // 2003 and 2004 papers shared same parameterizations
                   ^
And there's the answer to your original question. Your hoc code contained a statement that expected the existence of a class called Izhi2003a. No such class is built into NEURON. None of your hoc code defined such a class. And furthermore, the solitary mod file that was compiled to create nrnmech.dll was called izhi2019.mod, a name that suggests that it defines a class called Izhi2019. To eliminate the error message, just put a file that defines the Izhi2013a class in the same directory as your hoc code, run mknrndll (or nrnivmodl) in that directory, and the next time you execute your hoc code, the error message will not appear.

A side-comment: the Desktop is not a good location for software development. It's generally best to create a special directory in which you put all the directories of your various software projects.
ted
Site Admin
Posts: 5897
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: hoc file is not a template

Post by ted »

salvadord wrote: Fri Feb 26, 2021 2:26 pm Hi Alexandra,

I just tested the model and I was able to instantiate the izh2003 cell. I'm on Mac OS . . .
After compiling the mod files, I was able to execute
nrngui izhi2004a.hoc
without problems.

Also, starting nrngui without any command line options, I was able to create an instance of Izhi2003a by entering the following commands at NEURON's oc> prompt:

Code: Select all

create dummy // needed since Izhi2003a is a POINT_PROCESS
access dummy
objref foo
foo = new Izhi2003a()
Either approach should work regardless of your OS.
ted
Site Admin
Posts: 5897
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: hoc file is not a template

Post by ted »

I want to plot/recreate the voltage output of the different izhikevic cells.The GUI loads successfully but as I select spike patters for the izhikevic neuron I get the error
How were you "selecting spike patterns"?
Post Reply