File: test_pairwise2

package info (click to toggle)
python-biopython 1.45-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 18,192 kB
  • ctags: 12,310
  • sloc: python: 83,505; xml: 13,834; ansic: 7,015; cpp: 1,855; sql: 1,144; makefile: 179
file content (179 lines) | stat: -rw-r--r-- 2,462 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
test_pairwise2
### Test the function generation code
globalxx
globalxx(sequenceA, sequenceB) -> alignments

alignments is a list of tuples (seqA, seqB, score, begin, end).
seqA and seqB are strings showing the alignment between the
sequences.  score is the score of the alignment.  begin and end
are indexes into seqA and seqB that indicate the where the
alignment occurs.

localcd(sequenceA, sequenceB, match_fn, openA, extendA, openB, extendB) -> alignments

match_fn is a callback function that takes two characters and
returns the score between them.

openA and extendA are the gap penalties for sequenceA, and openB
and extendB for sequeneB.  The penalties should be negative.

alignments is a list of tuples (seqA, seqB, score, begin, end).
seqA and seqB are strings showing the alignment between the
sequences.  score is the score of the alignment.  begin and end
are indexes into seqA and seqB that indicate the where the
alignment occurs.

correctly failed
#### Let's start with a simple global alignment.
globalxx
GAACT
|||||
G-A-T
  Score=3
GAACT
|||||
GA--T
  Score=3
#### Try a local alignment.
localxs
-AxBx
 |||
zA-Bz
  Score=1.9
-AxBx
 ||||
zA-Bz
  Score=1.9
#### Test match score, open penalty.
globalms
AA
||
-A
  Score=1.9
AA
||
A-
  Score=1.9
globalms
GAA
|||
G-A
  Score=2.9
GAA
|||
GA-
  Score=2.9
globalxs
GAACT
|||||
GA--T
  Score=2.9
globalms
GCT-
||||
GATA
  Score=-0.1
#### Test the extend penalty.
globalxs
GACT
||||
G--T
  Score=1.3
globalxs
GACT
||||
-G-T
  Score=0.6
GACT
||||
G-T-
  Score=0.6
#### Test penalize_extend_when_opening
globalxs
GACT
||||
G--T
  Score=-1.2
#### Test penalize_end_gaps
globalxs
GACT
||||
--GT
  Score=1
GACT
||||
G--T
  Score=1
GACT
||||
GT--
  Score=1
#### Test separate gap penalties
localxd
G-AT
||||
GTCT
  Score=1.7
GA-T
||||
GTCT
  Score=1.7
localxd
GAT--
|||
G-TCT
  Score=1.8
#### Test separate gap penalties, with extension.  Test align list
localxd
['G', '-', 'A', 'A', 'T']
|||||
['G', 'T', 'C', 'C', 'T']
  Score=1.9
['G', 'A', '-', 'A', 'T']
|||||
['G', 'T', 'C', 'C', 'T']
  Score=1.9
['G', 'A', 'A', '-', 'T']
|||||
['G', 'T', 'C', 'C', 'T']
  Score=1.9
#### Test match dictionary
localds
ATAT
||||
AT-T
  Score=3
ATAT
|||
ATT-
  Score=3
localds
ATAT
|||
ATT-
  Score=3
localds
ATT-
|||
ATAT
  Score=3
#### This used to cause errors, reported by Daishi
localxs
abcde
  |
--c--
  Score=1
localxs
abcce
   |
---c-
  Score=1
abcce
  |
--c--
  Score=1
globalxs
abcde
|||||
--c--
  Score=0.2