Getting Started

(Difference between revisions)
Jump to: navigation, search
m (Quick example: Use translate method)
m (Quick example: Fixed silly error introduced in the last revision)
Line 27: Line 27:
print 'seq %s is %i bases long' % (my_seq, len(my_seq))
print 'seq %s is %i bases long' % (my_seq, len(my_seq))
print 'reverse complement is %s' % my_seq.reverse_complement()
print 'reverse complement is %s' % my_seq.reverse_complement()
print 'protein translation is %s' % my_protein.translate()
print 'protein translation is %s' % my_seq.translate()

Revision as of 10:36, 3 February 2009


Download and Installation

For Windows we provide click-and-run installers. Most Linux distributions will include an optional Biopython package (although this may be out of date). Otherwise you typically download and uncompress the archive, and install from source. See our downloads page for details including the prerequisites.

You can check your installation has worked at the python prompt:

>>> import Bio

If that gives no error, you should be done. If you get something like "ImportError: No module named Bio" something has gone wrong.


The Biopython Tutorial and Cookbook (HTML, PDF) contains the bulk of our documentation. See Documentation for more links.

Quick example

Try executing this in python:

from Bio.Seq import Seq
#create a sequence object of some DNA
my_seq = Seq('CATGTAGACTAG')
#print out some details about it
print 'seq %s is %i bases long' % (my_seq, len(my_seq))
print 'reverse complement is %s' % my_seq.reverse_complement()
print 'protein translation is %s' % my_seq.translate()

You should get the following output:

seq CATGTAGACTAG is 12 bases long
reverse complement is CTAGTCTACATG
protein translation is HVD*

Reading and writing Sequence Files

If you are using Biopython 1.43 or later, try out the new SeqIO module.


Further reading

  • Use the Wiki Search tools to find more information on specific topics.
Personal tools