New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
biophysical models: convert .json parameters to .hoc #107
Comments
Hi @caparvulus -- there's no way to convert our .json files to .hoc files. You can see in this file how we use NEURON to initialize the model: https://github.com/AllenInstitute/AllenSDK/blob/master/allensdk/model/biophysical/utils.py Can I ask why you're trying to perform this conversion? |
Hi @dyf , thank you for your reply. Because I want to simulate LFPs with these biophysical models with some opensource modules like LFPy: https://github.com/LFPy. Most of these modules ask for .hoc files to work. I have tried to write a conversion but I hardly have ways to tell if my code is faithful with respect to the original parameters. I mostly copied and pasted the code from AllenSDK for initializing the model (creating the h object) and output these codes as a hoc script, but I still can' figure out a way to check if my conversion is really correct, and unfortunately for some models my .hoc converted doesn't even work (syntax errors when loaded). |
Hi @caparvulus - Unfortunately at the moment we don't have tools for conversion from our json files to hoc and other formats, although there are plan to in the future. However, if you want to simulate LFP using our Cell Types .json parameters files we do have a tool for that. Our BioNet simulator (part of the Brain Modeling Toolkit) will load in .json parameters files, run a simulation and record the LFP on a simulated MEA. We have examples for simulating LFP on one cell: or on a multi-cell network: |
Hi @kaeldai - Thank you so much for your information. However, after I checked the BioNet simulator, it looks like it does not use any morphology information from the original model but just treats each neuron as a point source. Is there any way to record LFPs at different locations based on the morphology information (more biophysically realistic)? |
Hi @caparvulus - BioNet will use the cell's morphology to calculate the LFP. Basically, it uses the distance from the center of each NEURON segment to the electrode to find a resistance coefficient for each segment in the cell. Then at each step during the simulation it takes the sum of seg-resistance * seg-potential for every segment to find LFP at a given electrode. When you run a simulation you can specify the location of the electrodes using a csv file. For the location of the cell(s) you can specify the x,y,z coordinates of the soma, plus optional rotational angles, in the nodes file. We use swc files to build the morphology of each cell, then translate and rotate into the correct position. From what I recall LFPy uses the absolute morphology built into hoc files. |
Do you want to move this conversation to BMTK? I will close if so. |
You can go ahead and close this. |
@kaeldai I actually have some questions about BioNet, because it does not seem to work at all. In fact, the examples you showed me as "1cell_all_active" would not work at all. there is no file called "318331342_fit.json", and also even if I changed to some existing file, it would still give me error TypeError: init() got multiple values for keyword argument 'network' do you have any other alternative way to do the task we discussed before? |
Is there any way to convert .json parameters to .hoc files? Do I have to rewrite the code loading parameters to generate the .hoc file? And how can I make sure my code is faithful in respect of parameters?
The text was updated successfully, but these errors were encountered: