MOD file compiling error

Moderator: wwlytton

Post Reply
yashavantha

MOD file compiling error

Post by yashavantha »

1. I have done hippocampal CA1 network of 500 cells (single compartment) using .hoc codes. I am using HH mod file modified by traub for hippocampal neurons (hh2.mod) for my simulation. While compiling mod file it gives error and resets the ek (-90), ena(50) and celsius(36) value to its default of -77 , 50 and 6.3. I tried giving the value in the template and out side the template. But it did not work out...., no error statement too on initialising simulation. Later i tried setting the value by
forall{
ek = -90 ena= 50
}

it worked..... why is this . Is it because of error in .mod file or .hoc programming error.

2. Is there any method to improve the simulation speed in my network of single compartment neurons. [os:win XP,P-IV ( 2Ghz) , 256 MB RAM.]
Which is the best integration method which is used for simulation like mine.

3. I am using random network connections for my simulation, is there any method to visualise the (pattern of) synaptic connections between the neurons. (on shape plot i get a series of boxes arranged in a line with no connections between)

4. Is it is justified to use Exp2Syn with forward and backward rate constants of AMPA receptor and reversal potential set to '0' as excitatory synapse (I had trouble inserting AMPA and NMDA in network neurons, so had to settle with Exp2syn).

5. Why is neuron default setting of celsius is 6.3 deg C. Why do i get a small amplitude Action Potential on setting the temperature to 37 deg C which is normal human body temperature.
ted
Site Admin
Posts: 6299
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: MOD file compiling error

Post by ted »

Lots of good questions here. Some belong under the topic
Adding new mechanisms and functions to NEURON--NMODL and the Channel Builder
and others belong elsewhere.

It may be didactically appropriate for me to come back and split up this reply.
1. I have done hippocampal CA1 network of 500 cells (single compartment) using .hoc codes. I am using HH mod file modified by traub for hippocampal neurons (hh2.mod) for my simulation. While compiling mod file it gives error
and resets the ek (-90), ena(50) and celsius(36) value to its default of -77 , 50 and 6.3. I tried giving the value in the template and out side the template. But it did not work out...., no error statement too on initialising simulation. Later i tried setting the value by
forall{
ek = -90 ena= 50
}

it worked..... why is this . Is it because of error in .mod file or .hoc programming error.
What was the error message that appeared during compilation?

Equilibrium potential assertions in a mod file have no effect, and when you compile
such code you will get a message that says so. You'll probably want to read
Chapter 8 of the NEURON book, which discusses initialization in general and
initialization of equilibrium potentials in particular.
http://www.neuron.yale.edu/ftp/ted/book ... xedref.pdf

To give a more specific answer, I would have to see your NMODL and hoc code.
If you are using a mod file that comes out of ModelDB, it would be very
helpful for you to provide the URL for that model. Anybody can give any name
they like to any mod file, so it is not uncommon to encounter files with the same
name that have very different contents.
2. Is there any method to improve the simulation speed in my network of single compartment neurons. [os:win XP,P-IV ( 2Ghz) , 256 MB RAM.]
Which is the best integration method which is used for simulation like mine.
Double or quadruple your RAM. I'm surprised you can even boot XP
with only a quarter gig.
Close _all_ other applications, including any nonessential stuff that MSWin
likes to load "to run in the background" when it boots up.
Don't graph anything during a simulation, or if you must plot stuff,
cut Points plotted/ms

The "best" integration method depends on the nature of your model
and the simulation results.
It is always a matter of experimentation, but there are some rules of thumb.
If things are highly synchronous, try adaptive integration ("variable dt") with
global timestep.
If the cells are very asynchronous, and most have long interspike intervals,
try adaptive integration with local variable timestep (click on the
VariableTimeStep tool's Details button and select Local step).
Accuracy may be improved, at the cost of some slowing, by choosing
2nd order threshold.
When using adaptive integration, it's a good idea to use the Atol Scale Tool
to properly scale the error criteria for all states.
It's also a good idea to try a finer Absolute Tolerance just to see if it causes
a significant qualitative change in simulation results.
3. I am using random network connections for my simulation, is there any method to visualise the (pattern of) synaptic connections between the neurons. (on shape plot i get a series of boxes arranged in a line with no connections between)
Bill Lytton <billl@neurosim.downstate.edu> has done this under Linux.
I don't know if his tools for doing this will work under MSWin.
4. Is it is justified to use Exp2Syn with forward and backward rate constants of AMPA receptor and reversal potential set to '0' as excitatory synapse (I had trouble inserting AMPA and NMDA in network neurons, so had to settle with Exp2syn).
An Exp2Syn with proper time constants and equilibrium potential is kinetically identical
to an AMPAergic synapse.
It can also be used for an NMDA synapse, again with proper time constants and
equilibrium potential, but the conductance will not depend on voltage or Mg.

There is no technical reason why Exp2Syn's NMODL code could not
be modified to make its conductance sensitive to voltage and Mg.
Such a mechanism may already exist--have you checked ModelDB?
If it doesn't, it shouldn't be hard to create one. Synaptic mechanisms with
voltage and Mg sensitive conductance have been implemented before the
advent of NEURON's event delivery system. All you have to do is steal
the right code and stick it into a renamed copy of exp2syn.mod
(get exp2syn.mod by downloading the source code for NEURON and
expanding it, then look in nrn-5.7/src/nrnoc )
5. Why is neuron default setting of celsius is 6.3 deg C.
Squid axon.
Why do i get a small amplitude Action Potential on setting the temperature to 37 deg C which is normal human body temperature.
Good question.

To change v you have to charge cm.
Heating makes channels open & close faster.
Inward current is on for a shorter time.
Less time means less charge.
Less charge means less change of v.
See for yourself--bring up some graphs and plot
ina and ik in one
gna and gk in another
yashavantha

Error during mod file compilation

Post by yashavantha »

I Thank you Sir, for answering my questions,

the error or warning which i was getting while compiling the mod file( i tried in both windows and

fedora, error was same)

windows:
----------------------------------------
gcc -mno-cygwin -I/cygdrive/c/nrn57/src/scopmath -I/cygdrive/c/nrn57/src/nrnoc -

I/cygdrive/c/nrn57/src/oc -I/cygdrive/c/nrn57/lib -I/cygdrive/c/nrn57/mingw -c m

od_func.c
nocmodl exp2syn1
Translating exp2syn1.mod into exp2syn1.c
gcc -mno-cygwin -I/cygdrive/c/nrn57/src/scopmath -I/cygdrive/c/nrn57/src/nrnoc -

I/cygdrive/c/nrn57/src/oc -I/cygdrive/c/nrn57/lib -I/cygdrive/c/nrn57/mingw -c e

xp2syn1.c
rm exp2syn1.c
nocmodl hh3
Translating hh3.mod into hh3.c
Notice: This mechanism cannot be used with CVODE
Warning: Default 36 of PARAMETER celsius will be ignored and set by NEURON.
Warning: Default -90 of PARAMETER ek will be ignored and set by NEURON.
Warning: Default 50 of PARAMETER ena will be ignored and set by NEURON.
VECTORIZED
gcc -mno-cygwin -I/cygdrive/c/nrn57/src/scopmath -I/cygdrive/c/nrn57/src/nrnoc -

I/cygdrive/c/nrn57/src/oc -I/cygdrive/c/nrn57/lib -I/cygdrive/c/nrn57/mingw -c h h3.c
rm hh3.c
ld -d -S -x -r -o nrnmech.dll mod_func.o exp2syn1.o hh3.o -L/cygdrive/c/nrn57/li b

-lscpmt

nrnmech.dll was built successfully.
Press Return key to exit
----------------------------------------

I am using Intel P-IV 2GHz, 256 MB RAM with dual booting Windows XP and Fedora 3. I could get better speed by using Fedora OS.The maximum time was spent on saving the .ps file from the graphs obtained. Is there any way i can save the file in .jpeg or .png format which i think may take less time. Now i am using screen capture tools for the same, which are less efficient in getting a clear image.(I am planning to increase my RAM shortly).

--------------------------------------------
I tried using variable time step method as you suggested, the error was

nrniv: hh3 cannot be used with CVODE near line 2
{isvar()}
^
CVode[0].active(1 )
NumericalMethodPanel[0].iscvode( )
NumericalMethodPanel[0].isvar( )
---------------------------------------------
ted
Site Admin
Posts: 6299
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Error during mod file compilation

Post by ted »

This message
Notice: This mechanism cannot be used with CVODE
usually means that the mod file contains an expression that depends on dt,
probably because it empolys the analytincal solution to one or more ODEs
that govern voltage-dependent rate constants or gating variables. This was
a nice trick in the days of slow CPUs, and it works well with fixed time step
integration, but it is not compatible with NEURON's adaptive integrators. The
solution is to rewrite the mechanism to use a DERIVATIVE or KINETIC block
with an appropriate SOLVE statement (usually cnexp or sparse, respectively).

This message
nrnmech.dll was built successfully.
means that your mechanism will work.

It just won't work with adaptive integration.

If you need help fixing this, I'll have to see your code; you may email it to
me directly if you like, or if you picked it up from ModelDB, send me the URL
for the model and tell me which mod file it is.

These messages
Warning: Default 36 of PARAMETER celsius will be ignored and set by NEURON.
Warning: Default -90 of PARAMETER ek will be ignored and set by NEURON.
Warning: Default 50 of PARAMETER ena will be ignored and set by NEURON.
mean just what they say. You can try to specify particular values for celsius or
ionic concentrations or equilibrium potentials in the PARAMETER block--in fact,
some people do, just to remind themselves of the "normal values" for whatever
organism the experiments were done in--but such statements won't have any
effect.

You can set celsius with a hoc statement
celsius = whatever
or by using the GUI--
NEURON Main Menu / Tools / Distributed Mechanisms / celsius

If you don't have any ion accumulation mechanisms (diffusion, buffers, pumps),
you can also specify ionic equilibrium potentials with hoc statements.
Example:

Code: Select all

create soma, dend, axon
access soma
forall insert hh  // now everybody has ena and ek
forall print secname(), " ", ena
forall ena = 45
forall print secname(), " ", ena
You may find it useful to read the section on ion concentrations and equilibrium
potentials in
http://www.neuron.yale.edu/ftp/ted/book ... xedref.pdf
The maximum time was spent on saving the .ps file from the graphs obtained. Is there any way i can save the file in .jpeg or .png format which i think may take less time.
Don't bother with jpeg--it surrounds lines and characters with annoying little clouds
of dots that blur everything.
Instead of PostScript, just save to Idraw format--
in the Print & File Window Manager, select the graphs you want, then
Print / Idraw
Idraw is actually a variant of encapsulated PostScript. You can open these
with idraw if you're using Linux, and edit them to your heart's content. See
http://www.neuron.yale.edu/neuron/docs/ ... grafex.htm

You can also read idraw files into any vector graphics program under MSWin
that can read encapsulated PostScript, e.g. CorelDraw. Just make sure the
file has an eps extension. If you save more than one graph to a file, you'll
find them all piled up on top of each other when you open them with CorelDraw.
Just click and drag them off the pile and then you can edit them individually.
yashavantha

Post by yashavantha »

Thank you sir for answering my questions and giving valuable suggestions. I will definitely keep these points in mind while writing NEURON codes.
Post Reply