Biopython Tutorial and Cookbook
Jeff Chang, Brad Chapman, Iddo Friedberg, Thomas Hamelryck, Michiel de Hoon, Peter Cock
Last Update–15 June 2008
Contents
Introduction
What is Biopython?
Installing Biopython
FAQ
Quick Start – What can you do with Biopython?
General overview of what Biopython provides
Working with sequences
A usage example
Parsing sequence file formats
Connecting with biological databases
What to do next
Sequence objects
Sequences and Alphabets
Sequences act like strings
Slicing a sequence
Turning Seq objects into strings
Nucleotide sequences and (reverse) complements
Concatenating or adding sequences
MutableSeq objects
Transcribing and Translation
Working with directly strings
Sequence Input/Output
Parsing or Reading Sequences
Parsing sequences from the net
Sequence files as Dictionaries
Writing Sequence Files
Sequence Alignment Input/Output
Parsing or Reading Sequence Alignments
Writing Alignments
BLAST
Running BLAST locally
Running BLAST over the Internet
Saving BLAST output
Parsing BLAST output
The BLAST record class
Deprecated BLAST parsers
Dealing with PSIBlast
Accessing NCBI’s Entrez databases
Entrez Guidelines
EInfo: Obtaining information about the Entrez databases
ESearch: Searching the Entrez databases
EPost
ESummary: Retrieving summaries from primary IDs
EFetch: Downloading full records from Entrez
ELink
EGQuery: Obtaining counts for search terms
ESpell: Obtaining spelling suggestions
Examples
Swiss-Prot, Prosite, Prodoc, and ExPASy
Bio.SwissProt: Parsing Swiss-Prot files
Bio.Prosite: Parsing Prosite records
Bio.Prosite.Prodoc: Parsing Prodoc records
Bio.ExPASy: Accessing the ExPASy server
Cookbook – Cool things to do with it
PubMed
GenBank
Dealing with alignments
Substitution Matrices
BioSQL – storing sequences in a relational database
BioCorba
Going 3D: The PDB module
Bio.PopGen: Population genetics
InterPro
Advanced
The SeqRecord and SeqFeature classes
Regression Testing Framework
Parser Design
Substitution Matrices
Where to go from here – contributing to Biopython
Maintaining a distribution for a platform
Bug Reports + Feature Requests
Contributing Code
Appendix: Useful stuff about Python
What the heck is a handle?
This document was translated from L
A
T
E
X by
H
E
V
E
A
.