Running NEURON tutorials on webpage

Other approaches to using NEURON in neuroscience education.

Running NEURON tutorials on webpage

Postby bll5z6 » Sun Mar 05, 2017 2:27 pm

Hey everyone,

Our lab uses some tutorials we developed with NEURON to teach undergraduate neuroscience. We also disseminate these tutorials to other instructors. The tutorials are very popular because they are interactive i.e. they allow students to "block" sodium channels and see the effect on currents and membrane potential, for instance.

We would like these tutorials to be available in a sort of web-based interactive form so that students can simply visit a website and interact with them instead of needing to download NEURON and compile the .mod files. Alternatively, being able to generate an .exe would be another option.

Does anyone know the best way to do this conversion? We don't really have experience in web programming so I'm not sure what the standard is for developing interactive web-based tutorials. Any pointers would be greatly appreciated!

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

Re: Running NEURON tutorials on webpage

Postby ramcdougal » Fri Mar 10, 2017 11:34 am

Sounds like a great project!

There are two main approaches that I'm aware of for sharing interactive NEURON simulations on the web:

Approach 1: Jupyter notebook, GitHub, and

Jupyter notebook provides a rich web-based approach for running Python programs, including NEURON. Put the bulk of the code in a file you import and use Jupyter's widgets and matplotlib-based graphics (PyNeuron-Toolbox can help by providing shape-plot like functionality) to allow interactively triggering simulations and exploring the results.

If you share your code in GitHub, you can then use to run it. If reliability is important ( is a free service by a biology research lab not a company), they provide instructions for creating your own version to host locally.

Williams et al 2016 used this strategy (without the widgets and with prominent code visibility) by sharing their NEURON code on GitHub (see, e.g. this file) which when mybinder is available can be run at: (Warning: at the time of writing this post, deploying mybinder solutions is down; you can check the status of mybinder.)

A strength of this approach is that users have full access to NEURON (in a container, so they can't corrupt your system or anyone else's experience) and can explore anything they want by creating a new cell in Jupyter and running arbitrary Python code.

Approach 2: Custom web interface

Alternatively, we have experimented with building custom interfaces for models; see the picture below.

The nice thing about this approach is that (1) you have full control over how things look and can use the latest approaches such as webgl (which enables the rotatable and zoom-able mitral cell here) and can make sure things look great on both mobile and desktop, and (2) you can cleanly separate the science (whatever your interface allows them to do) from the code.

The downsides: (1) you need to know a little about jQuery and websockets, (2) you need to have a server that you control and can run arbitrary Python services on.

Posts: 94
Joined: Fri Nov 28, 2008 4:38 pm
Location: Yale School of Medicine

Re: Running NEURON tutorials on webpage

Postby bll5z6 » Wed Mar 22, 2017 9:31 am

Thank you for the information! I think what I'm looking for is closer to the second approach. Do you know of any resources for learning about jquery & websockets as they relate to making an interactive web page like you describe?
Posts: 12
Joined: Thu May 26, 2016 10:27 am

Return to Other ways of using NEURON in neuroscience education

Who is online

Users browsing this forum: No registered users and 1 guest