1 / 10

BioPython Tutorial

BioPython Tutorial. Joe Steele Ishwor Thapa. BioPython home page. http:// biopython.org/wiki/Main_Page http:// biopython.org/DIST/docs/tutorial/Tutorial.html. Content. Automatically parses files into python data structures, with support for : BLAST output Clustalw FASTA GenBank

maxine
Télécharger la présentation

BioPython Tutorial

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. BioPython Tutorial Joe Steele IshworThapa

  2. BioPython home page • http://biopython.org/wiki/Main_Page • http://biopython.org/DIST/docs/tutorial/Tutorial.html

  3. Content Automatically parses files into python data structures, with support for: BLAST output Clustalw FASTA GenBank PubMed and Medline SwissProt UniGene Interfaces to: Standalone Blast Clustalw EMBOSS command line tools BioSQL many others….

  4. Where? Requires python Installed on biobase.ist.unomaha.edu bio-linux.ist.unomaha.edu >python my_biopython_routine.py

  5. Handling Sequences from Bio.Seq import Seq #from Bio import * #from Bio import Entrez my_seq = Seq("AGTACACTGGTT") print my_seq print my_seq.alphabet print "my_seq complement" print my_seq.complement() print "my_seqreverse_complement" print my_seq.reverse_complement() print "Change the case." print my_seq.lower() print my_seq.upper()

  6. Sequences from Bio import SeqIO from Bio.Seq import Seq my_seq = Seq("AGTACACTGGTT") print "How many G's are in my_seq?" print my_seq.count("G") print "my_seq is an array. Print elements 2 to 7." print my_seq[2:8] print "Print every other element." print my_seq[0::2] print "Reverse it." print my_seq[::-1] print "I just want a regular string." print str(my_seq) print "Make the sequence longer." more_seq = Seq("GGGGGGGGG") print my_seq + more_seq

  7. Translate print "my_seq is a CDS. What protein does it make?" print my_seq.translate()

  8. Read a FASTA file print "Run over a fasta file:" for seq_record in SeqIO.parse("af193789.fasta","fasta"): print seq_record.id print repr(seq_record.seq) print len(seq_record)

  9. Read a GenBank file print "Run over a genbank file:" for seq_record in SeqIO.parse("ls_orchid.gbk","genbank"): print seq_record.id print repr(seq_record.seq) print len(seq_record) count = SeqIO.write(seq_record, "ls_orchid.fasta", "fasta") print "Converted %i records" % count

  10. Convert files count = SeqIO.convert("ls_orchid.gbk", "genbank", "ls_orchid.fasta", "fasta") print "Converted %i records" % count ##help(SeqIO.convert) Write out the reverse complement: records = (make_rc_record(rec) for rec in SeqIO.parse("ls_orchid.fasta", "fasta") if len(rec)<700) SeqIO.write(records, "rev_comp.fasta", "fasta")

More Related