Giter Site home page Giter Site logo

berenslab / cbc_inference Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 0.0 281.34 MB

Code etc. for CBC inference paper of Oesterle el al. 2020

License: GNU General Public License v3.0

Jupyter Notebook 6.89% C 7.22% Shell 1.29% Perl 2.22% HTML 13.56% Yacc 0.43% Makefile 0.31% Roff 16.51% Objective-C 0.41% M 0.12% C++ 37.38% Nemerle 0.10% EQ 11.58% PostScript 0.01% POV-Ray SDL 1.75% Logos 0.03% MATLAB 0.01% Ruby 0.01% AGS Script 0.10% TeX 0.07%

cbc_inference's Introduction

Information

This is the code for the paper "Bayesian inference for biophysical neuron models enables stimulus optimization for retinal neuroprosthetics" by Oesterle et al. 2020 (DOI:ย 10.7554/eLife.54997).

This repo can be used to reproduce the data and figures shown in the paper. It also provides a python wrapper for some of the NeuronC functionality.

Code-structure

While the core python code can be found here, the experiments performed in the paper are described in jupyter notebooks (see below). The experiments' code is structured similar to the paper. Since most experiments depend on the previous steps, they should be run in order. However, the data can also be loaded from zenodo, which allows to skip experiments or single (time-consuming) steps in single experiments. Either way you have to download the data to get full functionality.

Setup

Download this repo and install the requirements. You may not have to install the specified package versions.
Execute the makefile in NeuronC and in Retsim to compile NeuronC and Retsim.
In addition, if you want to generate rendered cell images, you need to install povray.
Follow the experiments in the indicated order, starting with the download of the data.

Experiments

The experiments are ordered as follows:

After running the experiments or downloading the data, you can generate the figures and the animations animations.

NeuronC

The NeuronC [1] version (6.3.14) used here was downloaded from http://retina.anatomy.upenn.edu/~rob/neuronc.html and used with minor modifications.

Electrical stimulation

The simulation of the electrical stimulation in the paper uses the software COMSOL Multiphysics. The notebooks clearely indicate when a step requires COMSOL. If you don't have access to COMSOL, you can skip these steps and use the precomputed data.

Stimulus optimization

To optimize the stimuli we created a pipeline such that COMSOL can be run on a machine where it is installed, while SNPE and NeuronC can be run on a different machine. For this we created two directories COMSOL2retsim_COMSOL and COMSOL2retsim_interface. The former should be moved to a computer that can run both COMSOL and jupyter notebooks. The notebook run on this computer will communicate with COMSOL and save the COMSOL output to the COMSOL2retsim_interface, i.e. it needs read and write permission. Then you can run step4_optimize_stimulus.ipynb on the second machine, that also needs read and write permission for COMSOL2retsim_interface. It will load the COMSOL output, use it to run SNPE and NeuronC, and tell the other notebook when and how to create new COMSOL outputs.

Similarily, this can be done for the optimization of the electrical parameters of the retina.

References

[1] Smith, Robert G. (1992). NeuronC: a computational language for investigating functional architecture of neural circuits. J. Neurosci. Methods 43: 83-108.

cbc_inference's People

Contributors

jonathanoesterle avatar

Stargazers

 avatar Saeed Taghavi avatar A. Ziaeemehr avatar

Watchers

Sophie Laturnus avatar James Cloos avatar Philipp Berens avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.