Page 1 of 1

Optimizing single cells programmatically

Posted: Thu Feb 07, 2019 1:24 pm
by bll5z6
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.

Re: Optimizing single cells programmatically

Posted: Mon Feb 11, 2019 2:05 pm
by ted

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?

Re: Optimizing single cells programmatically

Posted: Mon Feb 11, 2019 2:21 pm
by bll5z6
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!

Re: Optimizing single cells programmatically

Posted: Mon Feb 11, 2019 2:32 pm
by ted
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.