How to NMODL?

NMODL and the Channel Builder.
Post Reply
pnainar
Posts: 8
Joined: Fri Jun 03, 2016 11:36 am

How to NMODL?

Post by pnainar » Mon Aug 22, 2016 8:12 am

Hi Ted,

I apologise in advance if my question is being posted in wrong place. Is it not possible to model ion channels on hoc itself without NMODL?
Also would I then be able to plug the ion channel model into the cell that I am building?

The reason I am considering this option is: I am not able to create a mod file through the bash - overtime I enter something it closes down. I am obviously doing something wrong - but I don't know where my mistake lies.

Below is the generic message with which the bash open:

"-e
drag a folder or set of mod files onto the modlunit script
model 1.1.1.1 1994/10/12 17:22:51
Usage:modl prefixto.mod [inputfile]
Press 'return' key to close"

Any entry I make followed by 'enter' key leads to the shell being closed.

Thanks in advance for your help.

Kind regards,
Padma

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

Re: How to NMODL?

Post by ted » Mon Aug 22, 2016 12:44 pm

pnainar wrote:I apologise in advance if my question is being posted in wrong place.
Indeed, it belonged in the topic area
Adding new mechanisms and functions to NEURON, which is where I just put it.

Now for the problem you encountered.
I am not able to create a mod file through the bash . . .
Below is the generic message with which the bash open:
First, what operating system are you using--MSWin, OS X, or Linux? If OS X, what version? If Linux, what distribution and version?

Second, I've never seen that message before. Exactly what did you do to get it (what command line did you enter?).

Third, does neurondemo work properly? What happens when you enter the command
neurondemo
at the bash prompt?

Fourth, a quick way to learn more about compiling mod files is to read
Adding new mechanisms to NEURON
and
Where to learn about mod files and NMODL
You'll find these posts among the other "announcement posts" at the top of the Adding new mechanisms and functions to NEURON topic area.

pnainar
Posts: 8
Joined: Fri Jun 03, 2016 11:36 am

Re: How to NMODL?

Post by pnainar » Tue Aug 23, 2016 5:11 am

Good morning Ted!

Firstly,
I am using Mac OS X Yosemite.
Second, I've never seen that message before. Exactly what did you do to get it (what command line did you enter?).
This is what I typed:

Code: Select all

dyn1232-34:~ pg6$ cd /Applications/NEURON-7.4/
dyn1232-34:NEURON-7.4 pg6$ ls
idraw.app      mknrndll.app   mos2nrn.app    nrn
iv             modlunit.app   neurondemo.app nrngui.app
dyn1232-34:NEURON-7.4 pg6$ open modlunit.app/
dyn1232-34:NEURON-7.4 pg6$ 
and this is what I got:
-e
drag a folder or set of mod files onto the modlunit script
model 1.1.1.1 1994/10/12 17:22:51
Usage:modl prefixto.mod [inputfile]
Press 'return' key to close

I noticed later that I face the same issue & message with mos2nrn.app as well. However my nrngui.app itself opens fine - though I have not yet figured out how to save what hoc code I type there.

Though from your email, I wonder if I should have been using neurondemo.app instead. I have just tried it - it opened fine. My single attempt to simulate an IClamp worked. Is this what I should have done in the first place?

As always thank you for the resources that you have pointed out - will read them too.

Kind regards,
Padma

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

Re: How to NMODL?

Post by ted » Tue Aug 23, 2016 11:38 am

1. Please answer this question: what happens if you enter the command
neurondemo
at the bash prompt?

2. All of your guesses are incorrect. Don't do any of that. Read the posts that I mentioned in my message from Monday, Aug. 22.

pnainar
Posts: 8
Joined: Fri Jun 03, 2016 11:36 am

Re: How to NMODL?

Post by pnainar » Tue Aug 23, 2016 11:58 am

It opens a Neuron mail menu, Run control, Temperature, Neuron Demonstrations and converts the same bash hoc-eligible.

I am reading the material that you have suggested.

Thanks.
Padma

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

Re: How to NMODL?

Post by ted » Tue Aug 23, 2016 12:32 pm

pnainar wrote:It opens a Neuron mail menu, Run control, Temperature, Neuron Demonstrations
Click on the radio button labeled "Release" and then click on Init & Run in the RunControl panel. The graphs should now show the time course of membrane potential, various calcium currents, and various calcium concentrations. If that's what happens, it means NEURON is able to compile mod files.
and converts the same bash hoc-eligible.
I have no idea what you mean by "converts the same bash hoc-eligible". Could you please explain?

pnainar
Posts: 8
Joined: Fri Jun 03, 2016 11:36 am

Re: How to NMODL?

Post by pnainar » Tue Aug 23, 2016 8:32 pm

This is what I meant :

Code: Select all

Last login: Tue Aug 23 13:31:00 on ttys002
dyn1232-34:~ pg6$ cd /Applications/NEURON-7.4/
dyn1232-34:NEURON-7.4 pg6$ ls
idraw.app      mknrndll.app   mos2nrn.app    nrn
iv             modlunit.app   neurondemo.app nrngui.app
dyn1232-34:NEURON-7.4 pg6$ open nrngui.app/
dyn1232-34:NEURON-7.4 pg6$ 
dyn1232-34:NEURON-7.4 pg6$ 
dyn1232-34:NEURON-7.4 pg6$ neurondemo
NEURON -- VERSION 7.4 (1380:90539e842093) 90539e842093
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015
See http://www.neuron.yale.edu/neuron/credits

loading membrane mechanisms from /Applications/NEURON-7.4/nrn/share/nrn/demo/release/x86_64/.libs/libnrnmech.so
Additional mechanisms from files
 cabpump.mod cachan1.mod camchan.mod capump.mod invlfire.mod khhchan.mod mcna.mod nacaex.mod nachan.mod release.mod
oc>
oc>
oc>
I did as per your advise re radio button labeled "Release". The graphs now show the time course of membrane potential, calcium current and concentrations. But I still don't know where I should be compiling the text file - a special text editor? I see that I cannot use the same command line as I would for hoc commands. This is what happened when I tried to do so:

Code: Select all

oc>: Three state kinetic scheme for HH-like Potassium channel
/Applications/NEURON-7.4/nrn/x86_64/bin/nrniv: syntax error
 near line 4
 : Three state kinetic scheme for HH-like Potassium channel
 ^
oc>
Look forward to your help. Thanks ever so much in advance.

Kind regards,
Padma

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

Re: How to NMODL?

Post by ted » Thu Aug 25, 2016 5:41 pm

Before proceeding further, let's be perfectly clear about something: I have told you where to learn how to compile mod files. If you are still uncertain about this, do what I advised before: read these posts
Adding new mechanisms to NEURON
and
Where to learn about mod files and NMODL
which you will find with the other "announcement posts" at the top of the Adding new mechanisms and functions to NEURON topic area.
pnainar wrote:This is what I meant :

Code: Select all

Last login: Tue Aug 23 13:31:00 on ttys002
dyn1232-34:~ pg6$ cd /Applications/NEURON-7.4/
dyn1232-34:NEURON-7.4 pg6$ ls
idraw.app      mknrndll.app   mos2nrn.app    nrn
iv             modlunit.app   neurondemo.app nrngui.app
dyn1232-34:NEURON-7.4 pg6$ open nrngui.app/
. . . etc. . . 
Stay out of there. Don't do that. Never do anything inside of NEURON's installation tree (the set of directories that are created when NEURON is installed)--you might break something.

Installing NEURON should adjust your operating system's PATH environment variable so that nrngui, modlunit, mknrndll, and neurondemo can be launched straight from the operating system's prompt, regardless of what the current working directory is.

So where should you put your own source code for NEURON models?

cd to your own home directory, make a directory where you will put all your modeling projects, and do your work there. Example: executing this sequence of statements at the system prompt
cd
mkdir mymodels
cd mymodels
mkdir pyr
cd pyr
will create a subdirectory called mymodels in your home directory, then create subdirectory inside mymodels called pyr, and finally leave you in ~/mymodels/pyr
That's where you should put all of the hoc, mod, and ses files related to your "pyr" modeling project. Whenever you want to compile the mod files in that directory, just execute
mknrndll
and if you want to launch NEURON and make it read the contents of some file called myfile.hoc that exists in ~/mymodels/pyr, just do
nrngui myfile.hoc
I still don't know where I should be compiling the text file
You edit hoc and mod files with any plain text editor. These files must be ASCII files, not Unicode files. You don't compile hoc--hoc is an interpreted language. mod files are the only files you have to compile, and you do that with mknrndll.

pnainar
Posts: 8
Joined: Fri Jun 03, 2016 11:36 am

Re: How to NMODL?

Post by pnainar » Fri Aug 26, 2016 12:19 pm

Oh! okay. Thank you. I will do that.

Kind regards,
Padma

Post Reply