Biopython Tutorial and Cookbook
236 pages
English

Biopython Tutorial and Cookbook

Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres
236 pages
English
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres

Description

Biopython Tutorial and Cookbook
Je Chang, Brad Chapman, Iddo Friedberg, Thomas Hamelryck,
Michiel de Hoon, Peter Cock, Tiago Antao, Eric Talevich, Bartek Wilczynski
Last Update – 2 April 2011 (Biopython 1.57+) Contents
1 Introduction 7
1.1 What is Biopython? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 What can I nd in the Biopython package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.3 Installing Biopython . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.4 Frequently Asked Questions (FAQ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2 Quick Start – What can you do with Biopython? 12
2.1 General overview of what Biopython provides . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.2 Working with sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.3 A usage example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.4 Parsing sequence le formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.4.1 Simple FASTA parsing example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.4.2 Simple GenBank parsing example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.4.3 I love parsing – please don’t stop talking about it! . . . . . . . . . . . . . . . . . . . . 15
2.5 Connecting with biological databases . . . . . . . ...

Sujets

Informations

Publié par
Nombre de lectures 150
Langue English
Poids de l'ouvrage 1 Mo

Extrait

Biopython Tutorial and Cookbook Je Chang, Brad Chapman, Iddo Friedberg, Thomas Hamelryck, Michiel de Hoon, Peter Cock, Tiago Antao, Eric Talevich, Bartek Wilczynski Last Update – 2 April 2011 (Biopython 1.57+) Contents 1 Introduction 7 1.1 What is Biopython? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.2 What can I nd in the Biopython package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.3 Installing Biopython . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.4 Frequently Asked Questions (FAQ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2 Quick Start – What can you do with Biopython? 12 2.1 General overview of what Biopython provides . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.2 Working with sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.3 A usage example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.4 Parsing sequence le formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.4.1 Simple FASTA parsing example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.4.2 Simple GenBank parsing example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.4.3 I love parsing – please don’t stop talking about it! . . . . . . . . . . . . . . . . . . . . 15 2.5 Connecting with biological databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.6 What to do next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3 Sequence objects 17 3.1 Sequences and Alphabets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.2 Sequences act like strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.3 Slicing a sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.4 Turning Seq objects into strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.5 Concatenating or adding sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.6 Changing case. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.7 Nucleotide sequences and (reverse) complements . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.8 Transcription . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.9 Translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.10 Tr Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.11 Comparing Seq objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.12 MutableSeq objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 3.13 UnknownSeq objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 3.14 Working with directly strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 4 Sequence Record objects 31 4.1 The SeqRecord object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 4.2 Creating a SeqRecord . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 4.2.1 SeqRecord objects from scratch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 4.2.2 SeqRecord objects from FASTA les . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 4.2.3 SeqRecord objects from GenBank les . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 4.3 SeqFeature objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 1 4.3.1 SeqFeatures themselves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 4.3.2 Locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 4.3.3 Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 4.4 Location testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 4.5 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 4.6 The format method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 4.7 Slicing a SeqRecord . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 4.8 Adding SeqRecord objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 5 Sequence Input/Output 46 5.1 Parsing or Reading Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 5.1.1 Reading Sequence Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 5.1.2 Iterating over the records in a sequence le . . . . . . . . . . . . . . . . . . . . . . . . 47 5.1.3 Getting a list of the records in a sequence le . . . . . . . . . . . . . . . . . . . . . . . 48 5.1.4 Extracting data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 5.2 Parsing sequences from the net . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 5.2.1 Parsing GenBank records from the net . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 5.2.2 Parsing SwissProt sequences from the net . . . . . . . . . . . . . . . . . . . . . . . . . 52 5.3 Sequence les as Dictionaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 5.3.1 Sequence les as Dictionaries – In memory . . . . . . . . . . . . . . . . . . . . . . . . 53 5.3.2 Sequence les as Dictionaries – Indexed les . . . . . . . . . . . . . . . . . . . . . . . . 55 5.3.3 Sequence les as Dictionaries – Database indexed les . . . . . . . . . . . . . . . . . . 57 5.3.4 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 5.4 Writing Sequence Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 5.4.1 Round trips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 5.4.2 Converting between sequence le formats . . . . . . . . . . . . . . . . . . . . . . . . . 60 5.4.3 Converting a le of sequences to their reverse complements . . . . . . . . . . . . . . . 61 5.4.4 Getting your SeqRecord objects as formatted strings . . . . . . . . . . . . . . . . . . . 62 6 Multiple Sequence Alignment objects 63 6.1 Parsing or Reading Sequence Alignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 6.1.1 Single Alignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.1.2 Multiple Alignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 6.1.3 Ambiguous Alignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 6.2 Writing Alignments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 6.2.1 Converting between sequence alignment le formats . . . . . . . . . . . . . . . . . . . 71 6.2.2 Getting your alignment objects as formatted strings . . . . . . . . . . . . . . . . . . . 73 6.3 Manipulating Alignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 6.4 Alignment Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 6.4.1 ClustalW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 6.4.2 MUSCLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 6.4.3 MUSCLE using stdout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 6.4.4 MUSCLE using stdin and stdout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 6.4.5 EMBOSS needle and water . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 7 BLAST 84 7.1 Running BLAST over the Internet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 7.2 Running BLAST locally . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 7.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 7.2.2 Standalone NCBI “legacy” BLAST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 7.2.3 Standalone NCBI BLAST+ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 7.2.4 WU-BLAST and AB-BLAST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 2 7.3 Parsing BLAST output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 7.4 The BLAST record class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 7.5 Deprecated BLAST parsers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 7.5.1 Parsing plain-text BLAST output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 7.5.2 Parsing a plain-text BLAST le full of BLAST runs . . . . . . . . . . . . . . . . . . . 93 7.5.3 Finding a bad record somewhere in a huge plain-text BLAST le . . . . . . . . . . . . 94 7.6 Dealing with PSI-BLAST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 7.7g with RPS- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 8 Accessing NCBI’s Entrez databases 96 8.1 Entrez Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 8.2 EInfo: Obtaining information about the Entrez databases . . . . . . . . . . . . . . . . . . . . 98 8.3 ESearch: Searching the Entrez databases. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 8.4 EPost: Uploading a list of identi ers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 8.5 ESummary: Retrieving summaries from
  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents