Exploit NEURON's GUI tools

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

Moderators: wwlytton, tom_morse

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

Exploit NEURON's GUI tools

Post by ted » Thu Sep 08, 2005 5:52 pm

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 hoc, 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 ugly, nasty old hoc, 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 syntax. It's a triumph of computerese over cognition, that's what it is.

The problem lay partly in the organization (or disorganization) of NEURON's Documentation page on the web. Prior to about 2005, the first item on that page was a link to a multi-part tutorial on how to develop a network model. It was very sound, and quite informative, but it made very little use of the GUI. Links to tutorials on NEURON's GUI tools were farther down the page, so many users got stuck on that network tutorial, which immersed them in in lots of hoc code, and even some NMODL code.

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 code. I wish I had a nickel (a bit less than 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 hoc programming, 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 hoc code (e.g. by exporting hoc from the CellBuilder, ChannelBuilder, or NetworkBuilder). Its VariableTimeStep control does an excellent job of customizing error tolerance scale factors for use in adaptive integration (see Secrets of the GUI: VariableStepControl https://www.neuron.yale.edu/phpBB/viewtopic.php?f=28&t=3232). It also has many tools for analyzing models, even those that have been created with hoc code (e.g. the ModelView tool). hoc, on the other hand, is 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.

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

Post Reply