Running NEURON tutorials on webpage

Other approaches to using NEURON in neuroscience education.
Post Reply
bll5z6
Posts: 29
Joined: Thu May 26, 2016 10:27 am

Running NEURON tutorials on webpage

Post by bll5z6 »

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!

Ben
ramcdougal
Posts: 269
Joined: Fri Nov 28, 2008 3:38 pm
Location: Yale School of Public Health

Re: Running NEURON tutorials on webpage

Post by ramcdougal »

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 MyBinder.org

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 MyBinder.org to run it. If reliability is important (MyBinder.org 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: http://mybinder.org/repo/ahwillia/Willi ... -Transport. (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.

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

Re: Running NEURON tutorials on webpage

Post by bll5z6 »

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?
rgerkin
Posts: 10
Joined: Fri Oct 06, 2017 11:38 am

Re: Running NEURON tutorials on webpage

Post by rgerkin »

What is the status of this? I have students copying/pasting from https://neuron.yale.edu/neuron/static/d ... steps.html into Jupyter notebooks on our lab JupyterHub and it seems to work great. But just converting this directly to a notebook would be better. Has anyone done this?
ramcdougal
Posts: 269
Joined: Fri Nov 28, 2008 3:38 pm
Location: Yale School of Public Health

Re: Running NEURON tutorials on webpage

Post by ramcdougal »

We've started a process of redoing those tutorials, which are pretty old.

The new versions use more modern idioms and come as Jupyter notebooks.

We haven't moved these to the website because we don't have a full replacement, but here's a few:

https://neuron.yale.edu/ftp/ramcdougal/ ... rial.ipynb
https://neuron.yale.edu/ftp/ramcdougal/ ... sics.ipynb
https://neuron.yale.edu/ftp/ramcdougal/ ... ck-1.ipynb

There's nothing about using the plot method of RangeVarPlots and ShapePlots for plotting to Matplotlib/bokeh (bokeh is supported by RangeVarPlots only at this time). That's probably a better way to do things than using gui2.

We cover essentially the content of that tutorial as an interactive session every year during the NEURON courses, so it should not be that hard to turn those notebooks into a web tutorial...
rgerkin
Posts: 10
Joined: Fri Oct 06, 2017 11:38 am

Re: Running NEURON tutorials on webpage

Post by rgerkin »

Awesome, thanks Robert! Do you think these could be moved to a "NEURON-tutorials" GitHub repo? Then I could git clone whatever was in there everytime I build my server for teaching, and also submit PRs if I see potential improvements. I could set it up and then transfer ownership if you'd like. You can email me (rgerkin at asu dot edu) if you want to discuss further.
Post Reply