python for biologists
Home
About
Python Tutorial
Python tutorial
About
Articles
29 common beginner Python errors
Counting non-DNA bases in a sequence
Five things I hate about teaching Python
Inventing new animals with a neural network
Python for complete beginners
Randomly sampling reads from a FASTQ file
3 steps to readable code
Simple sequence similarity search
A six line genome assembler
Sorting DNA sequences by length
Tools for tabular data
What you have in common with the Wright brothers
Machine learning series
Machine learning for biology part 1
Machine learning for biology part 2
Machine learning for biology part 3
Machine learning for biology part 4
Machine learning series
Python Tutorial
1 - Introduction
2 - Manipulating text
3 - Working with files
3 - Lists and loops
5 - Conditions
6 - Writing functions
7 - Regular expressions
8 - Dictionaries
9 - Working with the filesystem
Python tutorial
Site Stuff
Biological data exploration book
Exercise files
Python for biologists online course
Training Courses
Advanced Python for Biologists training course
Biological data exploration with Python training course
Python for Biologists training course
Python training courses
Python Tutorial
Python tutorial
Python tutorial
featured
Follow these links to get started with Python
1 - Introduction
The importance of programming languages is often overstated. What I mean by that is that people who are new to programming tend to worry far too much about what language to…
2 - Manipulating text
Open the first page of a book about learning Python, and the chances are that the first examples of code you’ll see will involve numbers. There’s a good reason for that…
3 - Lists and loops
Think back over the examples that we’ve seen in the previous two pages – they’ve all involved dealing with one bit of information at a time. In the first section, we used…
3 - Working with files
As we start this section, we find ourselves once again doing things in a slightly different order to most programming books. The majority of introductory programming books…
5 - Conditions
If we look back at the examples in previous sections, something that stands out is the lack of decision making. We’ve gone from doing simple calculations on individual bits…
6 - Writing functions
Here’s a piece of code which prints the AT content (the proportion of a DNA sequence which is either A or T) of a given DNA sequence:
7 - Regular expressions
A lot of what we do when writing programs for biology can be described as searching for patterns in strings. The obvious examples come from the analysis of biological…
8 - Dictionaries
Suppose we want to count the number of As in a DNA sequence. Carrying out the calculation is quite straightforward:
9 - Working with the filesystem
Reading from and writing to files was one of the first things we looked at. For some programs, however, we’re not just concerned with the contents of files, but with files…
No matching items