Tutorial.pdf

(2603 KB) Pobierz
Biopython Tutorial and Cookbook
Jeff Chang, Brad Chapman, Iddo Friedberg, Thomas Hamelryck,
Michiel de Hoon, Peter Cock, Tiago Antao, Eric Talevich, Bartek Wilczy´ski
n
Last Update – 17 December 2014 (Biopython 1.65)
Contents
1 Introduction
1.1 What is Biopython?
. . . . . . . . . . . .
1.2 What can I find in the Biopython package
1.3 Installing Biopython
. . . . . . . . . . . .
1.4 Frequently Asked Questions (FAQ)
. . . .
8
8
8
9
10
14
14
14
15
16
16
17
17
17
18
19
19
20
21
22
22
24
24
25
26
28
29
30
32
33
34
34
35
35
36
37
38
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
2 Quick Start – What can you do with Biopython?
2.1 General overview of what Biopython provides
. . . . . . .
2.2 Working with sequences
. . . . . . . . . . . . . . . . . . .
2.3 A usage example
. . . . . . . . . . . . . . . . . . . . . . .
2.4 Parsing sequence file formats
. . . . . . . . . . . . . . . .
2.4.1 Simple FASTA parsing example
. . . . . . . . . . .
2.4.2 Simple GenBank parsing example
. . . . . . . . .
2.4.3 I love parsing – please don’t stop talking about it!
2.5 Connecting with biological databases
. . . . . . . . . . . .
2.6 What to do next
. . . . . . . . . . . . . . . . . . . . . . .
3 Sequence objects
3.1 Sequences and Alphabets
. . . . . . . . . . . . .
3.2 Sequences act like strings
. . . . . . . . . . . . .
3.3 Slicing a sequence
. . . . . . . . . . . . . . . . .
3.4 Turning Seq objects into strings
. . . . . . . . . .
3.5 Concatenating or adding sequences
. . . . . . . .
3.6 Changing case
. . . . . . . . . . . . . . . . . . . .
3.7 Nucleotide sequences and (reverse) complements
3.8 Transcription
. . . . . . . . . . . . . . . . . . . .
3.9 Translation
. . . . . . . . . . . . . . . . . . . . .
3.10 Translation Tables
. . . . . . . . . . . . . . . . .
3.11 Comparing Seq objects
. . . . . . . . . . . . . . .
3.12 MutableSeq objects
. . . . . . . . . . . . . . . . .
3.13 UnknownSeq objects
. . . . . . . . . . . . . . . .
3.14 Working with strings directly
. . . . . . . . . . .
4 Sequence annotation objects
4.1 The SeqRecord object
. . . . . . . . . . . . .
4.2 Creating a SeqRecord
. . . . . . . . . . . . .
4.2.1 SeqRecord objects from scratch
. . . .
4.2.2 SeqRecord objects from FASTA files
.
4.2.3 SeqRecord objects from GenBank files
4.3 Feature, location and position objects
. . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1
4.4
4.5
4.6
4.7
4.8
4.3.1 SeqFeature objects
. . . . . . . . . . . . . .
4.3.2 Positions and locations
. . . . . . . . . . . .
4.3.3 Sequence described by a feature or location
References
. . . . . . . . . . . . . . . . . . . . . . .
The format method
. . . . . . . . . . . . . . . . . .
Slicing a SeqRecord
. . . . . . . . . . . . . . . . .
Adding SeqRecord objects
. . . . . . . . . . . . . .
Reverse-complementing SeqRecord objects
. . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
38
39
42
43
43
43
46
48
49
49
49
50
51
52
54
55
55
56
56
57
59
61
61
62
63
64
65
65
66
68
68
69
71
73
75
76
78
79
79
82
82
83
84
85
86
88
5 Sequence Input/Output
5.1 Parsing or Reading Sequences
. . . . . . . . . . . . . . . . . . . . .
5.1.1 Reading Sequence Files
. . . . . . . . . . . . . . . . . . . .
5.1.2 Iterating over the records in a sequence file
. . . . . . . . .
5.1.3 Getting a list of the records in a sequence file
. . . . . . . .
5.1.4 Extracting data
. . . . . . . . . . . . . . . . . . . . . . . . .
5.2 Parsing sequences from compressed files
. . . . . . . . . . . . . . .
5.3 Parsing sequences from the net
. . . . . . . . . . . . . . . . . . . .
5.3.1 Parsing GenBank records from the net
. . . . . . . . . . . .
5.3.2 Parsing SwissProt sequences from the net
. . . . . . . . . .
5.4 Sequence files as Dictionaries
. . . . . . . . . . . . . . . . . . . . .
5.4.1 Sequence files as Dictionaries – In memory
. . . . . . . . .
5.4.2 Sequence files as Dictionaries – Indexed files
. . . . . . . . .
5.4.3 Sequence files as Dictionaries – Database indexed files
. . .
5.4.4 Indexing compressed files
. . . . . . . . . . . . . . . . . . .
5.4.5 Discussion
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.5 Writing Sequence Files
. . . . . . . . . . . . . . . . . . . . . . . . .
5.5.1 Round trips
. . . . . . . . . . . . . . . . . . . . . . . . . . .
5.5.2 Converting between sequence file formats
. . . . . . . . . .
5.5.3 Converting a file of sequences to their reverse complements
5.5.4 Getting your SeqRecord objects as formatted strings
. . . .
6 Multiple Sequence Alignment objects
6.1 Parsing or Reading Sequence Alignments
. . . . . . . . . .
6.1.1 Single Alignments
. . . . . . . . . . . . . . . . . . .
6.1.2 Multiple Alignments
. . . . . . . . . . . . . . . . . .
6.1.3 Ambiguous Alignments
. . . . . . . . . . . . . . . .
6.2 Writing Alignments
. . . . . . . . . . . . . . . . . . . . . . .
6.2.1 Converting between sequence alignment file formats
6.2.2 Getting your alignment objects as formatted strings
6.3 Manipulating Alignments
. . . . . . . . . . . . . . . . . . .
6.3.1 Slicing alignments
. . . . . . . . . . . . . . . . . . .
6.3.2 Alignments as arrays
. . . . . . . . . . . . . . . . . .
6.4 Alignment Tools
. . . . . . . . . . . . . . . . . . . . . . . .
6.4.1 ClustalW
. . . . . . . . . . . . . . . . . . . . . . . .
6.4.2 MUSCLE
. . . . . . . . . . . . . . . . . . . . . . . .
6.4.3 MUSCLE using stdout
. . . . . . . . . . . . . . . . .
6.4.4 MUSCLE using stdin and stdout
. . . . . . . . . . .
6.4.5 EMBOSS needle and water
. . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
2
7 BLAST
7.1 Running BLAST over the Internet
. . . . . . . . . . . . . .
7.2 Running BLAST locally
. . . . . . . . . . . . . . . . . . . .
7.2.1 Introduction
. . . . . . . . . . . . . . . . . . . . . .
7.2.2 Standalone NCBI BLAST+
. . . . . . . . . . . . . .
7.2.3 Other versions of BLAST
. . . . . . . . . . . . . . .
7.3 Parsing BLAST output
. . . . . . . . . . . . . . . . . . . .
7.4 The BLAST record class
. . . . . . . . . . . . . . . . . . . .
7.5 Deprecated BLAST parsers
. . . . . . . . . . . . . . . . . .
7.5.1 Parsing plain-text BLAST output
. . . . . . . . . .
7.5.2 Parsing a plain-text BLAST file full of BLAST runs
7.5.3 Finding a bad record somewhere in a huge plain-text
7.6 Dealing with PSI-BLAST
. . . . . . . . . . . . . . . . . . .
7.7 Dealing with RPS-BLAST
. . . . . . . . . . . . . . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
BLAST file
. . . . . . .
. . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
90
90
92
92
92
93
93
95
96
96
99
100
101
101
102
103
103
108
111
114
115
116
116
117
119
120
121
123
123
124
124
127
129
129
129
130
132
133
135
135
137
137
137
138
140
141
142
142
143
144
8 BLAST and other sequence search tools (experimental
code)
8.1 The SearchIO object model
. . . . . . . . . . . . . . . . . . . . .
8.1.1 QueryResult
. . . . . . . . . . . . . . . . . . . . . . . . .
8.1.2 Hit
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8.1.3 HSP
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8.1.4 HSPFragment
. . . . . . . . . . . . . . . . . . . . . . . . .
8.2 A note about standards and conventions
. . . . . . . . . . . . . .
8.3 Reading search output files
. . . . . . . . . . . . . . . . . . . . .
8.4 Dealing with large search output files with indexing
. . . . . . .
8.5 Writing and converting search output files
. . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
9 Accessing NCBI’s Entrez databases
9.1 Entrez Guidelines
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.2 EInfo: Obtaining information about the Entrez databases
. . . . . . .
9.3 ESearch: Searching the Entrez databases
. . . . . . . . . . . . . . . . .
9.4 EPost: Uploading a list of identifiers
. . . . . . . . . . . . . . . . . . .
9.5 ESummary: Retrieving summaries from primary IDs
. . . . . . . . . .
9.6 EFetch: Downloading full records from Entrez
. . . . . . . . . . . . . .
9.7 ELink: Searching for related items in NCBI Entrez
. . . . . . . . . . .
9.8 EGQuery: Global Query - counts for search terms
. . . . . . . . . . .
9.9 ESpell: Obtaining spelling suggestions
. . . . . . . . . . . . . . . . . .
9.10 Parsing huge Entrez XML files
. . . . . . . . . . . . . . . . . . . . . .
9.11 Handling errors
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.12 Specialized parsers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.12.1 Parsing Medline records
. . . . . . . . . . . . . . . . . . . . . .
9.12.2 Parsing GEO records
. . . . . . . . . . . . . . . . . . . . . . . .
9.12.3 Parsing UniGene records
. . . . . . . . . . . . . . . . . . . . . .
9.13 Using a proxy
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.14 Examples
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.14.1 PubMed and Medline
. . . . . . . . . . . . . . . . . . . . . . .
9.14.2 Searching, downloading, and parsing Entrez Nucleotide records
9.14.3 Searching, downloading, and parsing GenBank records
. . . . .
9.14.4 Finding the lineage of an organism
. . . . . . . . . . . . . . . .
9.15 Using the history and WebEnv
. . . . . . . . . . . . . . . . . . . . . .
9.15.1 Searching for and downloading sequences using the history
. .
9.15.2 Searching for and downloading abstracts using the history
. . .
9.15.3 Searching for citations
. . . . . . . . . . . . . . . . . . . . . . .
3
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
10 Swiss-Prot and ExPASy
10.1 Parsing Swiss-Prot files
. . . . . . . . . . . . . . . . . . . . .
10.1.1 Parsing Swiss-Prot records
. . . . . . . . . . . . . . .
10.1.2 Parsing the Swiss-Prot keyword and category list
. . .
10.2 Parsing Prosite records
. . . . . . . . . . . . . . . . . . . . . .
10.3 Parsing Prosite documentation records
. . . . . . . . . . . . .
10.4 Parsing Enzyme records
. . . . . . . . . . . . . . . . . . . . .
10.5 Accessing the ExPASy server
. . . . . . . . . . . . . . . . . .
10.5.1 Retrieving a Swiss-Prot record
. . . . . . . . . . . . .
10.5.2 Searching Swiss-Prot
. . . . . . . . . . . . . . . . . . .
10.5.3 Retrieving Prosite and Prosite documentation records
10.6 Scanning the Prosite database
. . . . . . . . . . . . . . . . . .
11 Bio.PopGen: Population genetics
11.1 GenePop
. . . . . . . . . . . . . .
11.2 Coalescent simulation
. . . . . .
11.2.1 Creating scenarios
. . . .
11.2.2 Running Fastsimcoal2
. .
11.3 Other applications
. . . . . . . .
11.3.1 FDist: Detecting selection
11.4 Future Developments
. . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
145
145
145
147
148
149
149
151
151
152
152
153
155
155
157
157
159
160
160
163
164
164
165
168
169
173
173
175
175
176
176
177
177
179
179
179
181
182
182
188
191
194
195
196
197
197
198
198
199
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
and molecular adaptation
. . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
12 Phylogenetics with Bio.Phylo
12.1 Demo: What’s in a Tree?
. . . . . . .
12.1.1 Coloring branches within a tree
12.2 I/O functions
. . . . . . . . . . . . . .
12.3 View and export trees
. . . . . . . . .
12.4 Using Tree and Clade objects
. . . . .
12.4.1 Search and traversal methods
.
12.4.2 Information methods
. . . . . .
12.4.3 Modification methods
. . . . .
12.4.4 Features of PhyloXML trees
. .
12.5 Running external applications
. . . . .
12.6 PAML integration
. . . . . . . . . . .
12.7 Future plans
. . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
13 Sequence motif analysis using Bio.motifs
13.1 Motif objects
. . . . . . . . . . . . . . . . . . . . . .
13.1.1 Creating a motif from instances
. . . . . . . .
13.1.2 Creating a sequence logo
. . . . . . . . . . . .
13.2 Reading motifs
. . . . . . . . . . . . . . . . . . . . .
13.2.1 JASPAR
. . . . . . . . . . . . . . . . . . . .
13.2.2 MEME
. . . . . . . . . . . . . . . . . . . . .
13.2.3 TRANSFAC
. . . . . . . . . . . . . . . . . .
13.3 Writing motifs
. . . . . . . . . . . . . . . . . . . . .
13.4 Position-Weight Matrices
. . . . . . . . . . . . . . .
13.5 Position-Specific Scoring Matrices
. . . . . . . . . . .
13.6 Searching for instances
. . . . . . . . . . . . . . . . .
13.6.1 Searching for exact matches
. . . . . . . . . .
13.6.2 Searching for matches using the PSSM score
13.6.3 Selecting a score threshold
. . . . . . . . . . .
13.7 Each motif object has an associated Position-Specific
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
Scoring Matrix
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
4
Zgłoś jeśli naruszono regulamin