Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Importing my own .hoc network file into the GUI

69 views
Skip to first unread message

Reza

unread,
Jan 9, 2024, 8:22:51 AM1/9/24
to NetPyNE Q&A forum
Hello all,
Hope everything is going well.

I have made a simple small network manually and looking for a way to implement it into the GUI to work on its biophysics, synaptic connections, plotting, and so on.

I tried File > Workspace > Upload to upload my .hoc file but that wasn't successful and nothing appeared! 

Just wanted to know if there is any way that we could implement our own built network into the GUI and apply some modifications.

Thanks in advance. 

Eugenio Urdapilleta

unread,
Jan 9, 2024, 5:45:23 PM1/9/24
to NetPyNE Q&A forum
Hi Reza,
 once uploaded into your workspace, try "File > Import > From Python" and specify your netParams and simConfig variables. The corresponding files would be located at "uploads" within your workspace. Best,

Eugenio

Reza

unread,
Jan 10, 2024, 4:21:56 AM1/10/24
to NetPyNE Q&A forum
Hi Eugenio,
Thanks for your reply!

I only have the .hoc file of my network, and I am not sure how I can have the netParams and simConfig files and also variables. 
Can you please tell me what exactly I should put in the netParams and simConfig variables and files?

I appreciate your help.
Reza

Eugenio Urdapilleta

unread,
Jan 10, 2024, 2:41:44 PM1/10/24
to NetPyNE Q&A forum
Hi Reza,
 with a hoc file you would only get information for cellParams. You still need to complete other entries to make a network. Can you provide us with a version of the hoc file (the one you defined or some related), so we can exactly figure out how to use it? Thanks

Eugenio

Reza

unread,
Jan 11, 2024, 6:21:23 AM1/11/24
to NetPyNE Q&A forum
Hi Eugenio
Please find the attached hoc file. 
Thank you. 
Reza

NewSmallNetwork.hoc

Eugenio Urdapilleta

unread,
Jan 18, 2024, 3:50:00 PM1/18/24
to NetPyNE Q&A forum
Hi Reza,
 from your hoc you should import cell templates into NetPyNE. All information related to network-like properties (connections between cells, for example) or recording vectors, etc, won't be uploaded. Right now, NetPyNE supports importation of cellular properties only.
 Here, I send you an example of building a basic netParams using import from hoc files and a simple config file. The hoc is one using information from your hoc (the morphology, not the channels as I don't have the associated mods). With these two, you can go to the GUI, upload them to your workspace and importing the information from the .py. I hope it helps. Best,

Eugenio
ECtemplate.hoc
NetPyNE_Specs.py

Reza

unread,
Jan 19, 2024, 8:06:32 AM1/19/24
to NetPyNE Q&A forum
Hi Eugenio
Thank you for your reply.

My main issue here is that I cannot even upload a .py file into my workspace yet
Not sure what might be wrong from my side! 
You can check the attached screen-recorded file. 

Assuming that the upload issue will be fixed, I encounter some other issues here.
As you mentioned: "Right now, NetPyNE supports importation of cellular properties only."
So, there is no chance to upload and have a made-up network from a hoc file?
As I noticed, we just keep one cell in the hoc file; we also eliminate all the proc (including proc subsets(), proc geom(), proc biophys(), proc synapses(),...) except the topology, proc topol(), shape3d, and proc init(), I assume because we are going to build them all in the NetPyNE GUI again. 

I am just wondering why we kept the "insert pas" in the proc init()?
So, can't we also keep the "insert hh" just like "insert pas"?
Also, wondering how/why we need to change the e_pas=-60 and g_pas=1/10000? Are these values specific to EC cells? I think the default values were e_pas = -70 and g_pas=0.001. 
"proc init(){
topol()
        basic_shape()
forall{
insert pas
e_pas=-70
g_pas=0.001
cm=1
Ra=100
}
}
"
I made up another hoc file (please see the attached, CA3_Cell.hoc) based on what you made as ECtemplate.hoc. Can you please check it up and see if it's good to go and be uploaded to GUI?
Thank you. 

Besides, the Python file seems a little tricky to me!
I am not sure if we are going to work in the GUI, why do we even need the Python file? 
As I remember from the tutorials, we can either build the network in the GUI, OR we can manually build the network in the Python file with writing codes. 
Please correct me if I'm wrong. 

I appreciate your time and support, Eugenio.

Best, 
Reza
Workspace_Upload_issue_2024-01-19.mov
CA3_Cell.hoc

Eugenio Urdapilleta

unread,
Jan 19, 2024, 6:34:43 PM1/19/24
to NetPyNE Q&A forum
Hi Reza,
 from your movie, I see that you have uploaded the files into your workspace. Next, you should import the .py file (File -> Import -> From python), where the netParams and the simConfig are. You can add the hh mechanism, and any mechanism you want, as long as you have the associated .mod files. In this case, when you import the network, you should specify where are the mods (previously uploaded to your workspace) and click "compile mod files". I made a simple hoc for clarity, but you can add all the information from your hoc (related to single cells properties of the EC cell). Yes, the CA3 can be uploaded fine although the sections are so thin that in the GUI is barely seen. Best,

Eugenio

Reza

unread,
Jan 22, 2024, 6:27:37 AM1/22/24
to NetPyNE Q&A forum
Hi Eugenio,

Thank you for your reply. 
I think I got it; We upload all the .hoc and .py files to the Workspace, first; Then we import the .py file. 

After I made a separate CA3_Cell.hoc, I decided to modify the .py file to have both cells in the GUI. 
I uploaded the CA3_Cell.hoc and ECtemplate.hoc plus the "NetPyNE_Specs-CA3EC.py" to the workspace, and then import the .py file but I just can see the "Pyr_EC" cell without CA3! It seems maybe my "NetPyNE_Specs-CA3EC.py" doesn't work properly. Can you please have a look at the attached .py file to see where I might have gone wrong?


I am a little confused regarding the "compile mod files". How can I have the .mod file? 
Should I make a .mod file for each cell? and then upload to the Workspace with its corresponding .hoc file? 
Now, when I ticked the "compile mod files", I got an error "FileNotFoundError: [Errno 2] No such file or directory: ''"
I would be grateful if you or other people could clarify this for me. 

Thank you for your time. 
Reza
NetPyNE_Specs-CA3EC.py

Eugenio Urdapilleta

unread,
Jan 31, 2024, 9:41:35 AM1/31/24
to NetPyNE Q&A forum
Hi Reza,
 try the next .py. Attached also a pic of the GUI implementation (upload + import).
 Regarding the mod, you only need to pick this option when you have additional mechanisms in your cell templates. Normally, when you build a cell (as in your original hoc), you need to specify processes other than passive and HH currents. These custom currents are specified in hoc language as .mod, which have to be compiled prior to NetPyNE instantiation. I hope it helps,

Eugenio

NetPyNE_Specs-CA3EC.py
gui.png
Reply all
Reply to author
Forward
0 new messages