View on GitHub

NEUS642

Files for NEUS642

NEUS 642: Python Programming in Experimental Neuroscience

Overview

NEUS 642 is a hands-on course on the basics of Python programming for analysis of neuroscience-related data. By the end of the course, students will have learned basic programming tasks, including loading and manipulating data sets, signal processing, image processing, and plotting. The course will be highly interactive. Students (with the support of TAs and instructors) will be expected to design and lead exercises during the class, and they are encouraged to bring their own data and/or analysis problem to the course. The course is open to students of all skill levels; however, a basic knowledge of programming is encouraged.

Time and location

Course staff

Course directors:

Teaching assistants:

Preparing for the course

Before we meet for the first time, please do the following:

Assessment

Grading

This is a pass/no pass course with two credits. Grading will be based on the following:

Developing an exercise

All exercises will follow the format established in the Python Neurobootcamp(days 2 through 4) and last year’s course.

Material for this course will be made freely available as a learning resource for future scientists, both at OHSU and elsewhere. Therefore, we ask that all datasets and materials be licensed under a Creative Commons license and the BSD license.

You’ll be asked to develop a two-hour exercise based on a dataset you’d like to work with. This dataset can be from your own work or obtained from a lab. The exercise will be formatted as a Jupyter Notebook and uploaded to the NEUS642 webpage prior to the start of class. If you require additional third-party packages for running the exercise, please check with the course instructors so that instructions for installing the packages can be provided to students in advance.

All exercises must contain sufficient background to the problem that gives your classmates sufficient background to understand the problem. Your classmates are neuroscientists, but will need some additional, domain-specific knowledge to understand the problem. Do not skip this step, or you will lose your classmates!

First, identify a dataset you’d like to work with. If you need help identifying a dataset pertinent to your area of interest, please contact a TA or course instructor. The dataset should be of reasonable size (i.e., no 10 gigabyte confocal images). You may need to do some post-processing of the data to get the file down to a reasonable size.

Next, think of a reasonable problem that you can walk the class through in two hours. The exercise should load the data, perform some processing and/or summary of the data and then plot the results.

Now, write the code to perform these steps and generate your plot. Once the code works, break it down into individual cells for a Jupyter Notebook. Above each code cell, add a Markdown cell explaining what’s happening in the block below. Identify four or five cells that may serve as exercises. You’ll remove the code from these cells and add some explanation above the blank cell instructing the class what problem needs to be solved before they can move onto the next step. They will then have 5-15 minutes (depending on the complexity of the problem) to try and figure out the code that solves the problem.

Throughout the entire process, you will be expected to consult with the TAs and course organizers to ensure that your exercise is of appropriate level and scope for the class. It’s better to be a little short than to go over time!

Python

All students are expected to have a basic knowledge of programming. If you haven’t worked with Python before, please take an online introductory course prior to the start of class such as those offered by codecademy and udacity. A Byte of Python is a free eBook; however, you will need your own copy of Python to run and test the code.

We will be using Python 3.7 for the course. Some of you may be familiar with older versions of Python such as Python 2.7. However, many popular third-party packages that you may use in your research (e.g., Numpy, Scipy and Pandas) longer support Python 2. If you have been using Python 2, take a few minutes to familiarize yourself with the differences between Python 2 and 3.

Python server

There are several ways to write and run Python code. For this class, we will use Jupyter notebooks. Notebooks are documents that contain live code, equations, visualizations and narrative text. Prior to each class you will need to download the files and potentially update some packages.

We have a cheat sheet for using the Jupyter notebooks.

Installing Python

These days I recommend the Anaconda Python Distribution since it is free to use (both for commercial and academic use), can be installed on computers without administrative privileges and makes it easy to install various third-party Python packages. To get started with your own copy of Python::

Code editors

You need a way to write Python code. The best way to do this is to use a dedicated code editor. There are many options out there, so if you already have a preferred one feel free to use it. For new programmers, I suggest the following options (which can be launched from the Anaconda Navigator application):

Course-specific resources

Other resources

There are many resources available online for learning Python. Here are a few.