Programming with Python and Biopython

This lesson is an introduction to programming Python, using Biopython applications as motivation. It is designed to be used in Software Carpentry workshops. Like most Software Carpentry Python lessons, it references Jupyter Notebooks, but can be taught using a regular Python interpreter as well. Please note that this lesson uses Python 3 rather than Python 2.

Prerequisites

Learners need to understand the concepts of files and directories (including the working directory) and how to start a Python interpreter before starting this lesson.

Learners must install Python and download the gapminder data before class starts: please see the setup instructions for details.

Schedule

13:00 Running and Quitting How can I run Python programs?
13:15 Variables and Assignment How can I store data in programs?
13:25 Data Types and Type Conversion What kinds of data do programs store?
How can I convert one type to another?
13:35 Built-in Functions and Help How can I use built-in functions?
How can I find out what they do?
13:55 Error Messages What kind of errors can occur in programs?
How can I identify errors when they occur?
14:10 Libraries How can I use software that other people have written?
How can I find out what that software does?
14:20 Afternoon Coffee Break
14:35 Lists and Indexing How can I store multiple values?
14:55 For Loops How can I make a program do many things?
15:15 Conditionals How can programs do different things for different data?
15:30 Sets What is a set, and how do I use it?
15:40 Night Break
08:40 Biopython How do I handle sequence files?
09:00 Writing Functions How can I create my own functions?
09:25 Programming Style How can I make my programs more readable?
How do most programmers format their code?
09:50 Debugging How can I debug my program?
10:15 Defensive Programming What sorts of things frequently go wrong in programs?
How can I make my programs more robust?
10:30 Morning Coffee Break
10:45 Reading Tabular Data into Data Frames How can I read tabular data?
11:00 Pandas Data Frames How can I do statistical analysis of tabular data?
11:20 Next Steps What else is out there and where do I find it?
11:35 Wrap-Up What have we learned?
11:50 Finish