Hi,
I would appreciate your advice on how to access/modify the settings of a pointprocess object such as an Exp2Syn present in a section. In simple terms, I have a neuron model with many sections. Some of these sections have synapses (Exp2Syn), while others do not. I am iterating over the sections (using the forall statement) and want to do the following:
1- Check if this section has an Exp2Syn object present
2- If yes, get the name of this Exp2Syn object
3- Get access to the NetCon linked to this synapse so that I can change its settings (e.g., its weight)
I have read the documentation sections on Pointprocesses and NetCon and tried some code with no success so far. The documentation of some functions was not clear to me at some points.
Thanks
-Sherif
Accessing pointprocesses present in a section
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Accessing pointprocesses present in a section
That means the documentation is improving.The documentation of some functions was not clear to me at some points.
The MechanismType class has some nice methods for discovering what mechanisms are present in a section. Particularly useful for your purpose are its pp_begin() and pp_next() methods. Check them out here
http://www.neuron.yale.edu/neuron/stati ... l#pp_begin
It is also possible to discover what density mechanisms have been inserted into a section--see this helpful post by Jose Ambros-Ingerson: viewtopic.php?f=16&t=1292
Re: Accessing pointprocesses present in a section
Hi Ted,
Wow. This is exactly what I wanted. Thanks Ted very much. It was not clear, at least for me, from the description of MechanismType Class that the created list will have the mechanisms available at the currently accessed section. I thought it will have the mechanisms available in all sections of the model; thus, this class didn't attract my attention. I used "pp_begin()" and "pp_next()" functions, in conjunction with the "netconlist" function and I was able to access the NetCon connections linked to the pointprocess available at the accessed section.
Speaking of the NetCon class, can you give me a clearer definition, or an example, on "precell" and "postcell" terms? It says in the documentation:
Again, thanks.
Wow. This is exactly what I wanted. Thanks Ted very much. It was not clear, at least for me, from the description of MechanismType Class that the created list will have the mechanisms available at the currently accessed section. I thought it will have the mechanisms available in all sections of the model; thus, this class didn't attract my attention. I used "pp_begin()" and "pp_next()" functions, in conjunction with the "netconlist" function and I was able to access the NetCon connections linked to the pointprocess available at the accessed section.
Speaking of the NetCon class, can you give me a clearer definition, or an example, on "precell" and "postcell" terms? It says in the documentation:
Can you show me an example on "a section declared in an object "?Postcell
SYNTAX
cellobj = netcon.postcell()
DESCRIPTION
If the synaptic point process is located in a section which was declared in an object (defined in a cell template), a reference to the postsynaptic cell (object) is returned.
Again, thanks.
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Accessing pointprocesses present in a section
Better than that--you can make one yourself with a CellBuilder. On the Management page, click on Cell Type. Then click on "Save hoc code in file" (you may have to drag the bottom edge of the CellBuilder down to see that button). The resulting hoc file will contain a template that defines a new object class. That object class will contain sections that are public and can be accessed from hoc via dot notation, e.g.Can you show me an example on "a section declared in an object "?
Code: Select all
objref foo
foo = new MyCellClass()
foo.soma print secname() // assuming MyCellClass has a section called soma
Modeling networks
area of the Forum.
Re: Accessing pointprocesses present in a section
Continuing the theme - is there an easy way (in ~ one line of code) to know how many point processes of particular type are present in particular section ?? I know it's possible just to go over all the point processes with MechanismType and count them, but a one built-in function would be much more elegant and less time-consuming.
Thanks.
Thanks.
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Accessing pointprocesses present in a section
Reviewing loose ends in the Forum, I came across this question which deserves an answer. There is no built-in function for this, but it's not hard to create one.delarue wrote:is there an easy way (in ~ one line of code) to know how many point processes of particular type are present in particular section ??
Code: Select all
// Usage: numpp(classname) where classname is a string
// Returns number of instances of point processes attached to the currently accessed section
// that belong to the class called classname
func numpp() { local i localobj mt,pp
mt = new MechanismType(1)
mt.select($s1)
i = 0
for (pp = mt.pp_begin(); object_id(pp) != 0; pp = mt.pp_next()) i+=1
return i
}
Code: Select all
soma {
print "number of instances of a given class attached to ", secname(), ":"
print "IClamp ", numpp("IClamp")
print "ExpSyn ", numpp("ExpSyn")
print "Exp2Syn ", numpp("Exp2Syn")
}
Code: Select all
number of instances of a given class attached to soma:
IClamp 0
ExpSyn 3
Exp2Syn 1
Elegance aside, in the interval since the question was first posted, there have been no reports that counting the number of point processes attached to sections has been a significant computational bottleneck.a built-in function would be much more elegant and less time-consuming.