FUHOC!

Suggestions for improvements to the NEURON Forum.
Post Reply
Martenzi
Posts: 34
Joined: Thu Feb 28, 2013 4:17 am

FUHOC!

Post by Martenzi »

Frequently Used HOC!

I was thinking, why not post common usage of code such as the example structure of a simple neuron with one branch each? A common way to use save to vector/graph etc?

As I´m under time pressure to deliver result and I´m more interested in optimising my work than to become a fully taught programmer, I find the GUI to be very useful in fast occasion but when I want to record / plot results it gets tedious with the mouse.

I understand that one can copy paste from the tutorial but it would be even more useful to have it in more qualitative examples and explanation of them.

Just to clarify my concept:

CODE:

All hoc code needed to create a simplistic cell with different properties

All code needed to create a save to graph (where the user can just change the naming for their use)

The documentation provides a more debunked version of this. That means I have to figure out how to build it. Anyways, it would help me lot=)
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: FUHOC!

Post by ted »

when I want to record / plot results it gets tedious with the mouse
Have you tried the Vector class's record and plot methods? Discussed in several places in the Forum, examples available in the Programmer's Reference.

For more software patterns, there's
--the NEURON Book
--the Programmer's Reference
--the tutorials and other documentation on the web site's Documentation page
--links from that page to tutorials written by others
--the FAQ list (see link on the Documentation page)
--the exercises from the 2008 NEURON summer course, available from the web site's Courses page
--the Forum's "Hot tips" and "NEURON hacks" discussion areas
--source code for 385 published NEURON models in ModelDB
--the CellBuilder's "export" feature, which writes a very clean, well organized hoc file based on the model cell specification contained in the CellBuilder
--the Network Builder's "export" feature which does the same for network models
Martenzi
Posts: 34
Joined: Thu Feb 28, 2013 4:17 am

Re: FUHOC!

Post by Martenzi »

Dear Ted,

I was afraid you would answer like that. As I am highly grateful for the activity of this forum on how much work you guys have put into this, the suggestions I was making is actually so much more simple.

I assume that most of you computational modellers have several HOC files with different topologies, instrumentations and different procedures etc. My suggestions was simply to put these codes in a separate part of the forum where beginners like myself can copy paste the most common uses and learn and understand from these. I have studied Java before and familiar with with some other languages, tried some Python for Neuron etc. When I debunk an already complete HOC code I get much better understanding, different learning style I guess. Plus I don´t have the ambition to become a programmer, it is more of a side bonus in the goal of getting my Neuron results.

This is a good example from the tutorial by KEM:

Code: Select all

create soma
access soma

nseg = 1
diam = 100
L = 100

insert hh

objectvar stim
stim = new IClamp(0.5)

stim.del = 0
stim.dur = 0.1
stim.amp = 30
Just by looking at this code and having the author explain with // bla bla bla. A beginner can get a head start.
You may think this is already implemented in the references you provided but they require the beginner to search and to understand the more fundamental parts before starting the actual coding. Again, just a suggestion. If ppl posted their favorite HOC file with explanation in // for every line that would be amazing!
The Hot Tips section contains tips and trix which can be overwhelming to someone new to the field. It is the overwhelming feeling Im trying to ease at this point.

I could be wrong=)
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: FUHOC!

Post by ted »

Martenzi wrote:I have studied Java before and familiar with with some other languages
Then you understand the value of "programming by example" and are familiar with the practice of incremental development and the cycle of revision and testing.
I assume that most of you computational modellers have several HOC files with different topologies, instrumentations and different procedures etc. My suggestions was simply to put these codes in a separate part of the forum where beginners like myself can copy paste the most common uses and learn and understand from these.
Suggest you look in ModelDB for any model on which I was an author or implementer.
Post Reply