Hi! I am new to the forum and also relatively new to computational neuroscience research. I am currently working on converting the McIntyre MRG axon model from Hoc to Python as part of my initial task as a researcher. In the midst of this process, I realized I needed to convert the following HOC code into Python:
insert extracellular xraxial=Rpn0 xg=1e10 xc=0
However, in Python I believe I have to provide an index (0 or 1) for each xraxial, xg, and xc to specify the layer they are in. I looked over the documentation and the diagram within the documentation for extracellular but am still not quite sure to determine which index to assign since the original HOC code does not provide any such info. I was wondering if one could explain how to determine and/or think about this?
Converting HOC extracellular to Python
Moderator: hines
-
- Posts: 267
- Joined: Fri Nov 28, 2008 3:38 pm
- Location: Yale School of Public Health
Re: Converting HOC extracellular to Python
In HOC, if foo is an array, assigning to foo is a syntactic shortcut for assigning to foo[0].
-
- Site Admin
- Posts: 6303
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Converting HOC extracellular to Python
As ramcdougal notes, the hoc statement
insert extracellular xraxial=Rpn0 xg=1e10 xc=0
will affect xraxial[0], xg[0], and xc[0] of the currently accessed section. extracellular's "0" layer is the one that is right next to the external surface of the section, and it's usually the one whose parameters you would want to specify.
Suppose dend is the Python name of a section that already has extracellular. Then
dend.xraxial[0] = Rpn0
dend.xg[0] = 1e10
dend.xc[0] = 0
will do what you want.
And if you have a list of sections called somelist and you want to specify the values of these three parameters for each section in the list, thenshould do the job.
insert extracellular xraxial=Rpn0 xg=1e10 xc=0
will affect xraxial[0], xg[0], and xc[0] of the currently accessed section. extracellular's "0" layer is the one that is right next to the external surface of the section, and it's usually the one whose parameters you would want to specify.
Suppose dend is the Python name of a section that already has extracellular. Then
dend.xraxial[0] = Rpn0
dend.xg[0] = 1e10
dend.xc[0] = 0
will do what you want.
And if you have a list of sections called somelist and you want to specify the values of these three parameters for each section in the list, then
Code: Select all
for foo in somelist:
foo.xraxial[0] = Rpn0
foo.xg[0] = 1e10
foo.xc[0] = 0
Re: Converting HOC extracellular to Python
Thank you!