Welcome to my Homepage!

Programming Guides for Computational Neuroscience, Journaling, etc. #%% md

Stuff I’m Working On

  1. An end-to-end tutorial for getting a “neurosim” environment (Linux VM + NEURON + Anaconda) running here
  2. A tutorial for converting older code into NEURON+Python+NetPyNE here
  3. My single cell characterization and optimization scripts are still a WIP

My Journaling

  1. I follow myself on Twitter here and my favorite Twitter users are here Twitter URL
  2. My longer journal entries still a WIP

tut0

Creating a NEURON+NetPyNE project with Jupyter & Google Colab on GitHub #%% md

Nota Bene

The suggestions contained herein will be at least X days out of date, depending on when the last push was. Maybe this will cause headaches or scary things. However, at the time of the last push, at least one person thought that the steps below were improved enough from prior documented knowledge that they thought it worthwile to update the repo.

This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.

Anaconda
https://www.anaconda.com
GitHub
https://github.com
Jupyter
https://jupyter.org
nbdev
https://nbdev.fast.ai
NetPyNE
http://www.netpyne.org
NEURON
https://neuron.yale.edu/neuron/
Windows Subsystem Linux
https://docs.microsoft.com/en-us/windows/wsl/

Steps

How to set up your Virtual Machine

  1. Start Windows PowerShell as an administrator
  2. Use Windows PowerShell to install Linux
    wsl --install
  3. Reboot your system
  4. Start Ubuntu on Windows
    Thats it! You now have access to your Linux VM through Ubuntu on Windows, go celebrate!

NOTE: Running Linux VM as an administrator, or use sudo within your VM

Sometimes you may run into permission errors due to permission rights within your Linux VM.
Ssing sudo before the command to resolve the issue, if that does not work
Try starting Ubuntu as an administrator and executing the command, it may resolve the issue

NOTE: Accessing your Windows/Linux files

Within your Linux VM, you can access your Windows files under the directory /mnt
Within your Windows machine, you can access your Linux files under the directory \\wsl$

Setting up your Python environment - Anaconda installation,

  1. Get the Linux Anaconda Installer here: https://www.anaconda.com/
  2. Open your file explorer
  3. In the file explorer search bar navigate to:
    \\wsl$\Ubuntu\tmp
  4. Move your Linux Anaconda Installer to your Ubuntu\tmp directory
  5. Start Ubuntu on Windows
  6. In your Linux VM perform the following steps:
  7. Navigate to your tmp directory using:
    cd /tmp
  8. bash Anaconda3-xxxx.xx-Linux-x86_64.sh
    you can autocomplete the line by using the Tab button
  9. Restart your Linux VM shell with:
    source ~/.bashrc
  10. Install NEURON and NetPyNE with Python’s built-in installer:
    pip install neuron
    pip install netpyne
  11. Run Python
  12. Execute the following lines of code: from neuron import h
    from netpyne import specs
    Thats it! You now are running NetPyNE and NEURON on your Linux VM

Compiling a custom cell using nrnivmodl

The nbdev sequence

  1. After cloning your repository initialise it as an nbdev repo
    nbdev_new
  2. Install the nbdev hooks
    nbdev_install_hooks
  3. View your site in your web-browser
    nbdev_preview
  4. 00_core.ipynb
  5. index.ipynb
  6. Before pushing your repository prepare your site:
    nbdev_prepare
  7. your site will be on
    https://{user}.github.io/{repo}

Installing pandocs on your Linux VM

You can install pandocs with the following commands:

  1. navigate to an appropriate repository to store your pandocs installer:
    cd /home/<user>
  2. get the linux installer wget https://github.com/jgm/pandoc/releases/download/<ver>/pandoc-<ver>-<architecture>.deb
  3. use the installer (requires administrator rights) sudo dpkg -i pandoc-<ver>-<architecture>.deb
  4. remove the linux installer rm pandoc-<ver>-<architecture>.deb