Welcome to my Homepage!
Welcome to my Homepage!
Programming Guides for Computational Neuroscience, Journaling, etc. #%% md
Stuff I’m Working On
- An end-to-end tutorial for getting a “neurosim” environment (Linux VM + NEURON + Anaconda) running here
- A tutorial for converting older code into NEURON+Python+NetPyNE here
- My single cell characterization and optimization scripts are still a WIP
My Journaling
- I follow myself on Twitter here and my favorite Twitter users are here
- 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.
Links
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
- Start Windows PowerShell as an administrator
- Use Windows PowerShell to install Linux
wsl --install
- Reboot your system
- 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,
- Get the Linux Anaconda Installer here: https://www.anaconda.com/
- Open your file explorer
- In the file explorer search bar navigate to:
\\wsl$\Ubuntu\tmp
- Move your Linux Anaconda Installer to your Ubuntu\tmp directory
- Start Ubuntu on Windows
- In your Linux VM perform the following steps:
- Navigate to your tmp directory using:
cd /tmp
- bash Anaconda3-xxxx.xx-Linux-x86_64.sh
you can autocomplete the line by using the Tab button - Restart your Linux VM shell with:
source ~/.bashrc
- Install NEURON and NetPyNE with Python’s built-in installer:
pip install neuron
pip install netpyne
- Run Python
- 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
- After cloning your repository initialise it as an nbdev repo
nbdev_new
- Install the nbdev hooks
nbdev_install_hooks
- View your site in your web-browser
nbdev_preview
- 00_core.ipynb
- index.ipynb
- Before pushing your repository prepare your site:
nbdev_prepare
- your site will be on
https://{user}.github.io/{repo}
Installing pandocs on your Linux VM
You can install pandocs with the following commands:
- navigate to an appropriate repository to store your pandocs installer:
cd /home/<user>
- get the linux installer
wget https://github.com/jgm/pandoc/releases/download/<ver>/pandoc-<ver>-<architecture>.deb
- use the installer (requires administrator rights)
sudo dpkg -i pandoc-<ver>-<architecture>.deb
- remove the linux installer
rm pandoc-<ver>-<architecture>.deb