Getting Started

(Difference between revisions)
Jump to: navigation, search
(Made the tutorial more high profile)
(Quick example)
Line 18: Line 18:
  
 
#create a sequence object of some DNA
 
#create a sequence object of some DNA
my_seq = Seq('CATGTAGATAG')
+
my_seq = Seq.Seq('CATGTAGATAG')
  
 
#print out some details about it
 
#print out some details about it

Revision as of 23:47, 18 December 2007

Contents

Download

See Getting BioPython

Installation

See Installing BioPython

Tutorial

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

Quick example

Executing this:

from Bio.Seq import Seq,translate
 
#create a sequence object of some DNA
my_seq = Seq.Seq('CATGTAGATAG')
 
#print out some details about it
print 'seq is %i bases long' % len(my_seq)
print 'reverse complement is %s' % my_seq.reverse_complement().tostring()
 
#or see the whole record
print 'sequence record:', my_seq
 
#translate the sequence into a protein
my_protein = translate(my_seq)
 
print 'protein translation is %s' % my_protein.tostring()
print 'protein record:', my_protein

Produces:

seq is 11 bases long
reverse complement is CTATCTACATG
sequence record: Seq('CATGTAGATAG', Alphabet())
protein translation is HVD
protein record: Seq('HVD', HasStopCodon(IUPACProtein(), '*'))

Reading and writing Sequence Files

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

Beginners

Further reading

  • Use the Wiki Search tools to find more information on specific topics.
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox