Learn/Course
Linux and Programming Languages for Bioinformatics
Three parts. The first gives you the environment, the second gives you programming, and the third brings them together on real work.
- Level
- Beginner
- Length
- 15 weeks, 3 parts
- Each week
- 2 h lecture + 2 h practice
- Assessment
- Course project
What you will learn
- Work confidently on a remote Linux server over ssh.
- Answer questions about sequencing files with grep, cut, sort and pipelines.
- Automate repeated steps with shell scripts.
- Write, test and debug Python programs that parse real bioinformatics files.
- Use Biopython and pandas, and know when your own code is the better choice.
- Keep a project reproducible with git and conda or pixi.
Your progress
0 of 15 weeks done
Progress is saved in this browser. Mark a week as done at the end of each lesson.
Syllabus
Part 1The environment
4 weeksThe command line, text processing and shell scripts: the tools every analysis runs on.
- Week 01
The command line, and why it exists at all
Connecting to a remote machine over ssh. The file system, paths and moving around. Permissions. How to look for help.
Open the materials - Week 02
Files and text
Viewing, counting, cutting. Redirecting input and output. Pipelines. Why the pipeline is the central idea of UNIX.
Open the materials - Week 03
Searching and processing text
grep, cut, sort, uniq, sed. Regular expressions. A short introduction to awk for working with columns.
On this site: Reading a FASTQ file, line by line - Week 04
Repetition without manual work
Shell scripts. Variables, loops, command-line arguments. When a script is enough and when you need a real language.
Part 2Programming
8 weeksPython from the first line to parsing real files, finding bugs and using libraries.
- Week 05
Python: first steps
Values, types, variables. How to run code. How to read an error message.
- Week 06
Conditions and loops
Boolean expressions. if, for, while. When to use which.
- Week 07
Data structures
Lists, dictionaries, sets, tuples. Which one for what, and why the choice matters.
- Week 08
Functions
Breaking a task down. Arguments and return values. Name scope. Why repeated code is a problem.
- Week 09
Files and parsing text
Reading and writing. Splitting on a delimiter. Converting strings to numbers and back.
- Week 10
Parsing real files
Processing a large file line by line without loading all of it. Writing your own reader. What to do when a line does not look the way you expect.
On this site: File formats in the glossary - Week 11
Errors, tracebacks, tests
Kinds of errors. Reading a traceback. Finding a bug with print statements and with a step debugger. Writing a simple test that tells you whether the code still works correctly.
- Week 12
Libraries
The standard library: argparse, os, collections. Then pandas for tables. When someone else's library saves time and when it hides what is going on.
Part 3Real work
3 weeksBioinformatics libraries, reproducible projects and a finished tool of your own.
- Week 13
Biopython
What it covers and what it does not. Comparing your own reader with the library's on the same task. When it is worth it and when it is not.
On this site: Biopython in the software directory - Week 14
Reproducibility
git: why, and the essentials. Environments and dependency management with conda or pixi. Laying out a project so it can be rerun a year later.
- Week 15
Putting it together
Finishing and presenting the course project. A review of the ground covered.
Course project
A small tool that solves a real problem on real data.
For example: it reads a file of variants, filters them by given conditions and prints a summary.
Requirements
- Runs from the command line, with arguments.
- Has at least one test.
- Lives in a git repository with a description of how to run it.
The goal is not complexity but completeness: something another person can download and run.
Reading
Core
- Bioinformatics Data Skills
Vince Buffalo · 2015
Written for exactly this kind of course: the command line, git, pipelines, reproducibility and working with data. The content has not aged, because Unix and git have not changed.
- Think PythonFree online
Allen B. Downey · 3rd ed., 2024
For the programming itself, starting from zero.
- Practical Computing for Biologists
Steven H. D. Haddock, Casey W. Dunn · 2011
For biologists sitting down at a command line for the first time, there is still nothing better.
Further
- Data Science at the Command LineFree online
Jeroen Janssens · 2nd ed., 2021
Modern and practical.
Istvan Albert et al. · updated regularly
Written for the same audience and kept up to date.
- Python for Data AnalysisFree online
Wes McKinney · 3rd ed., 2022
For the part on pandas.