Optimizing single cells programmatically

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
bll5z6
Posts: 27
Joined: Thu May 26, 2016 10:27 am

Optimizing single cells programmatically

Post by bll5z6 » Thu Feb 07, 2019 1:24 pm

Hi all,

I'm trying to adopt the Allen Institute's single-cell model creation workflow: https://www.nature.com/articles/s41467-017-02718-3

However, during the "passive fitting" stage of the process (i.e. determining the optimal capacitance and leak conductance for the model), they use NEURON's MultipleRunFitter tool with the GUI (in HOC). I would like to do this step entirely using Python as the interpreter. Here are the steps I need to perform (ideally in a Jupyter Notebook):

1) Create a passive model (import SWC file, insert leak channels)
2) Use MultipleRunFitter to fit the passive model to experimental data just like in the HOC tutorial https://www.neuron.yale.edu/neuron/stat ... tline.html

I found this ancient post using HOC that essentially does what I need to do: viewtopic.php?t=805
But not sure how to do it in Python.

Any help is appreciated! Thank you.

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

Re: Optimizing single cells programmatically

Post by ted » Mon Feb 11, 2019 2:05 pm

Code: Select all

they use NEURON's MultipleRunFitter tool with the GUI (in HOC). I would like to do this step entirely using Python as the interpreter
Did they really? Actually use the MRF's graphical user interface? Or did they just create an instance of a class, then call that class's methods from Python? After browsing through their article and associated code, it seems to me that they did the latter. The MRF and its related classes are just convenient features that set up data structures and create variables that can be accessed from either hoc or Python. And ultimately it's NEURON's computational engine, implemented in C, FORTRAN etc., that does most of the work. If you want to write your own complete replacement for any of that existing code, go ahead. But in the end you won't be gaining any functionality. Or have I mostly missed the point of your query?

bll5z6
Posts: 27
Joined: Thu May 26, 2016 10:27 am

Re: Optimizing single cells programmatically

Post by bll5z6 » Mon Feb 11, 2019 2:21 pm

Hi Ted,

I believe you may be right.. I had assumed they were using the GUI because they have multiple .ses files here: https://github.com/AllenInstitute/bioph ... ze/passive

But upon closer inspection, it looks like they do create some reference to h.MulRunFitter() here: https://github.com/AllenInstitute/bioph ... ive_fit.py

Thanks for your help, as always!

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

Re: Optimizing single cells programmatically

Post by ted » Mon Feb 11, 2019 2:32 pm

If their workflow doesn't require actual fiddling with the old InterViews-based graphical interface, the code should work even on hardware that doesn't have a graphical interface, or under an OS that doesn't have its own GUI--the non-gui objects, variables, methods etc. will still work and be fully accessible from Python.

Post Reply