Exploit NEURON's GUI tools

A collection of noteworthy items selected by our moderators from discussions about making and using models with NEURON.

Moderators: ted, wwlytton, tom_morse

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

Exploit NEURON's GUI tools

Post by ted »

There seems to be a widespread assumption that "if you're not writing code, you're not doing real compuational modeling." Sometimes this manifests as snobbery against using NEURON's GUI, a kind of nerd-machismo that keeps people from taking advantage of the powerful tools that are available via the NEURON Main Menu toolbar. Sometimes it manifests as the unspoken fear that "if I don't do everything by writing code, nobody will take my work seriously."

Bah to all such nonsense! Nothing could be farther from the truth. In the "real" world, software companies make big bucks selling "Rapid Application Development Environments" that are basically just GUI toolkits for constructing programs without having to write any code.

Is this some kind of scam, or are programmers in the real world just lazy?

In the real world nobody cares whether you write code or use a GUI toolkit; the measure of performance is that you get the job done, in time and under budget. RAD tools provide a very effective way for getting a lot of work done, very quickly. Get more done in less time, get more $$--got it?

So, with a few exceptions, RAD environments are not a scam. And, also with a few exceptions, programmers may be lazy--but you gotta be smart to be lazy like that.

NEURON's GUI is really a RAD environment. Why, then, are so many NEURON users (especially beginners) wrestling with hoc or Python when NEURON's GUI would help them do so much more, in far less time?

Now, I'm not talking about veteran NEURON users--you all know who you are--who picked up the program in the "old days" when NEURON didn't have enough of a GUI to be terribly useful. Mostly, I'm talking about the dozens, or hundreds, of less-experienced users who are trying to work with NEURON, but often getting lost in the oddities of hoc or Python syntax. It's a triumph of computerese over cognition, that's what it is.

The truth is that the NEURON Main Menu toolbar can spawn a host of powerful, convenient tools, whose functionality would be very difficult (if not impossible) for most users to reproduce, or even emulate, by writing their own hoc or Python. I wish I had a nickel (approximately 1/20 euro) for every user who asked a question that could be answered, quickly and easily, by applying one of NEURON's GUI tools.

A corollary of this truth is the fact that programming in hoc or Python, and NEURON's GUI tools, have complementary strengths and weaknesses. The GUI is great for exploratory simulations, and for quickly cobbling up small, prototype models that can then be mined for reusable code (e.g. by exporting hoc from the CellBuilder, ChannelBuilder, or NetworkBuilder, and yes it's hoc, but it's easy to use hoc from Python). Its VariableTimeStep control does an excellent job of customizing error tolerance scale factors for use in adaptive integration (see Secrets of the GUI: VariableStepControl viewtopic.php?f=28&t=3232). It also has many tools for analyzing models, whether they were created with hoc or Python or the GUI (e.g. the ModelView tool). hoc and Python, on the other hand, are great for anything that involves classical programming tasks like dealing with collections of things, specifying custom initializations or constructing complex simulation protocols, and filling in the holes that aren't covered by the GUI. In fact, with just a few hoc commands you can create your own GUI tools that give you convenient access to model parameters and simulation controls.

Here's the bottom line: the most powerful and flexible approach to using NEURON is to combine the strengths of both the GUI and programming. Those who stick with just programming or the GUI are depriving themselves of this power and flexibility. For most of us, this means "start exploiting the GUI."

Revised 20171107 by ted
Post Reply