Question about tutorial

The basics of how to develop, test, and use models.
Post Reply
nianwosuh
Posts: 39
Joined: Tue Jul 27, 2010 11:00 pm

Question about tutorial

Post by nianwosuh »

I am new in using neuron and working my way through the tutorial. I have encountered two problems while doing so and I'll appreciate your help.

(i) In section B of the tutorials , (blocking the sodium channel)
This code (below) is supposed to block the sodium channel completely;

proc block_sodium() {
soma gnabar_hh = 0
}

block_sodium

This secod code is supposed to block the sodium channel partially

proc block_sodium() {
sodium gnabar_hh = $1 * 0.25
}
block_sodium(0.15)

I typed these two codes repeatedly but for both cases, the sodium channel was completely blocked.
I wonder why I have the same result for two different codes. That was suposed to block the channel at different degrees

In part C of the tutorial
Defining source events for synapse, the code written in the tutorial is:

"new NetCon(&source_v, synapse, threshold, delay, weight)"

When I run the simulation with this code, it gives me error.

I thought the error is because the object NetCon, has not been previously defined. I'm not sure how to define an event, but I defined the object as;
objectvar NetCon
before the above code, it still gives me error saying the source is not defined.

Please could you help me to resolve these two concerns, so I can continue with the tutorial

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

Re: Question about tutorial

Post by ted »

There are a lot of tutorials. Which one do you mean?
nianwosuh
Posts: 39
Joined: Tue Jul 27, 2010 11:00 pm

Re: Question about tutorial

Post by nianwosuh »

The tutorial written by Andrews Gillies and David Sterrat and this is the web address for the tutorial :http://www.anc.ed.ac.uk/school/neuron/

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

Re: Question about tutorial

Post by ted »

nianwosuh wrote:(i) In section B of the tutorials , (blocking the sodium channel)
This code (below) is supposed to block the sodium channel completely;

proc block_sodium() {
soma gnabar_hh = 0
}

block_sodium

This secod code is supposed to block the sodium channel partially

proc block_sodium() {
sodium gnabar_hh = $1 * 0.25
}
block_sodium(0.15)

I typed these two codes repeatedly but for both cases, the sodium channel was completely blocked.
I'm surprised that this

Code: Select all

proc block_sodium() {
    sodium gnabar_hh  = $1 * 0.25
}
block_sodium(0.15)
didn't generate an error message, because there is no section called "sodium".
In part C of the tutorial
Defining source events for synapse, the code written in the tutorial is:

"new NetCon(&source_v, synapse, threshold, delay, weight)"

When I run the simulation with this code, it gives me error.
Authors often make assumptions about what their readers know. Sometimes they assume too much knowledge, and provide explanations that may be adequate for readers who already know a lot, but are confusing for readers who are at an early stage of learning. To quote from the tutorial
To create a new NetCon object, we use the command format:
new NetCon(&source_v, synapse, threshold, delay, weight)
The authors appear to assume that
(A) you understand that
new NetCon(&source_v, synapse, threshold, delay, weight)
is only an abstract, partial example of the actual code that is required to create an instance of the NetCon class, and
(B) you know more about object oriented programming in hoc than you do.

To understand what they meant to say, you would have to read the following:
1. Object Oriented Programming in OC
http://www.neuron.yale.edu/neuron/stati ... n/obj.html
2. Documentation of the keyword "objref" in the Programmer's Reference
http://www.neuron.yale.edu/neuron/stati ... tml#objref
3. Documentation of the NetCon class in the Programmer's Reference
http://www.neuron.yale.edu/neuron/stati ... etcon.html

That's a big reading assignment--especially item 1--and you should read all of it, sooner rather than later. But sometimes the quickest way to gain understanding is to see a real example of how something is done, especially when you're learning a new language. In fact, if you were learning the grammar and vocabulary of a new language, you wouldn't just be reading a textbook on grammar. You'd also look at real examples of literature, articles, stories, to see how the words are actually used. Well, learning a programming language is very similar. Let me suggest that you look at the source code that GIllies and Sterratt provide, and examine every statement that uses the keyword "NetCon". Also read the relevant entries in the Programmer's Reference, especially if you come across a keyword that is new to you.
nianwosuh
Posts: 39
Joined: Tue Jul 27, 2010 11:00 pm

Re: Question about tutorial

Post by nianwosuh »

Thank you for your responses. I have read those references you quoted earlier. but still wasn't sure what do. Hopefully someday I'll come across a program that actually implements the code.

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

Re: Question about tutorial

Post by ted »

nianwosuh wrote:Hopefully someday I'll come across a program that actually implements the code.
Well, today's your lucky day. The Gillies & Sterratt tutorial comes with code--check out its home page
http://www.anc.ed.ac.uk/school/neuron/
where the fifth and sixth links are
Download Zipfile of Tutorial Code
and
Download Zipfile of Entire Tutorial (including HTML and images)
nianwosuh
Posts: 39
Joined: Tue Jul 27, 2010 11:00 pm

Re: Question about tutorial

Post by nianwosuh »

I have looked at those codes but they were not helpful. I suppose the detailed codes where written in txt format and then saved as hoc file. When that is done, the detail codes do not appear when one runs the hoc file. The txt file is not included in the codes.

Following the "abstract example" which you called my attention to, I reversed the code to read
new NetCon(SThcells[1].soma, syn[0], -20, 1, 0.5)

SThcells[1].soma SThcells[0].nclist.append(new
NetCon(SThcells[1], syn[0], -20, 1, 0.5))
Since according to the tutorial the source is the action potential from cell 1. It still gives me error message.

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

Re: Question about tutorial

Post by ted »

nianwosuh wrote:I have looked at those codes but they were not helpful.
Please do the following:

1. Go to
http://www.anc.ed.ac.uk/school/neuron/
and download the zipfile of tutorial code. The file is called nrntut.zip

2. Put nrntut.zip in an empty directory and unzip it.

3. Use a text editor to open and examine each of the hoc files until you find one that contains the keyword NetCon
ShangbinChen
Posts: 1
Joined: Wed Mar 25, 2020 11:39 pm

Re: Question about tutorial

Post by ShangbinChen »

Dear Ted,

The link http://www.anc.ed.ac.uk/school/neuron/ doesn't work any more. How can I get the zipfile of tutorial code (nrntut.zip). I need the data of TreeA and TreeB for practice.

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

Re: Question about tutorial

Post by ted »

You'll have to contact that tutorial's authors.

If you are starting a new modeling project with NEURON, it would be best for you to use Python to create the model specification etc.. Please see the link Scripting NEURON with Python on the Documentation page https://neuron.yale.edu/neuron/docs
Post Reply