-
Notifications
You must be signed in to change notification settings - Fork 0
/
exercise-sheet-9.Rmd
362 lines (181 loc) · 5.47 KB
/
exercise-sheet-9.Rmd
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
---
title: "Exercise sheet 9: Progressive Alignment by Feng and Doolittle"
---
---------------------------------
# Exercise 1 - Scoring Matrices
Lets warm up your brain a bit after a long break.
Determine the correct text by replacing the highlighted words with the correct anagrams:
#### {.tabset }
##### Hide
Scoring matrices reflect the fact that amino acids with similar **(A) isehcayhilccpmo** properties can be more easily substituted than those without similar characteristics, since they are more likely to cause **(B) rsistnupoid** to the structure and function. This type of disruptive **(C) uuttotsbnisi** is less likely to be selected in evolution because it renders **(D) iouanctfnlonn** proteins.
PAM matrices, except PAM1, are derived from an **(E) raniyeooutvl** model. The increasing PAM numbers correlate with increasing PAM units and thus evolutionary **(F) tsnascedi** of protein sequences. For example, PAM250, which corresponds to about 20% amino acid **(G) tyedniti**, represents 250 mutations per 100 residues (a position could mutate several times). In theory, the number of **(E) raniyeooutvl** changes approximately corresponds to an expected **(E) raniyeooutvl** span of 2,500 million years. Thus, the PAM250 matrix is normally used for **(H) neirtdgve** sequences.
BLOSUM matrices are derived based on direct observation for every possible amino acid **(C) uuttotsbnisi** in multiple sequence alignments. Instead of using the **(I) earoopatitnlx function**, the BLOSUM matrices are actual percentage identity values of sequences selected for construction of the matrices. For example, BLOSUM62 indicates that the sequences selected for constructing the matrix share an average identity value of 62%.
This is why the PAM matrices are used most often for reconstructing **(J) ogctnihpyele** trees. However, because of the mathematical **(I) earoopatitnlx** procedure used, the PAM values may be less realistic for **(H) neirtdgve** sequences.
##### Solution
A) physicochemical
B) disruptions
C) substitution
D) nonfunctional
E) evolutionary
F) distances
G) identity
H) divergent
I) extrapolation
J) phylogenetic
#### {-}
# Exercise 2 - Progressive Alignment by Feng and Doolittle
Given the sequences $S_1 = CTCACA$, $S_2 = CAC$, $S_3 = GTAC$ and the following scoring function:
\begin{align}
s(S_i,S_j) &=
\begin{cases}
+1 & if\ S_i = S_j \\
0 & if\ (S_i \neq S_j) \lor (S_i = \blacklozenge \lor S_j = \blacklozenge) \lor (S_i = - \land S_j = -)\\
-1 & else\\
\end{cases}\\
\end{align}
We want to do progressive alignment following Feng and Doolittle. The needed pairwise alignments are calculated using the Needleman-Wunsch and are as follows:
::::{#img1-p .extra-m}
::: {#img3 .tutorial-img}
```{r, echo=FALSE, out.width="80%", fig.align='center', include=knitr::is_html_output()}
knitr::include_graphics("figures/sheet-9/sheet9-exercise2-alignments.svg")
```
:::
::::
We want to follow one step of the algorithm introduced in the lecture.
The following guide trees are given in [Newick format](https://en.wikipedia.org/wiki/Newick_format).
### 2a)
Starting with the guide tree **(($S_1$, $S_3$), $S_2$)**, what would be the starting **$group_1$**?
#### {.tabset }
##### Hide
##### Solution
$group_1$
```
CTCACA
GT`r knitr::asis_output("\U25C6")`AC`r knitr::asis_output("\U25C6")`
```
#### {-}
### 2b)
Use the Needleman-Wunsch algorithm to generate all pairwise alignments against **$group_1$** and calculate their respective **similarity score**.
#### {.tabset }
##### Hide
##### Solution
$a_1$
```
CTCACA
--CAC-
```
$ss_1$ = 0
\
$a_2$
```
CTCACA
C--AC-
```
$ss_2$= 0
\
$a_3$
```
-C-AC-
GT`r knitr::asis_output("\U25C6")`AC`r knitr::asis_output("\U25C6")`
```
$ss_3$= 1
\
a4
```
C--AC-
GT`r knitr::asis_output("\U25C6")`AC`r knitr::asis_output("\U25C6")`
```
$ss_4$ = 1
#### {-}
### 2c)
Based on the previously calculated pairwise alignments what are the possible choices for **$group_2$**?
#### {.tabset }
##### Hide
##### Solution
$group_2$ (1)
```
CTCACA
-C-AC-
GT`r knitr::asis_output("\U25C6")`AC`r knitr::asis_output("\U25C6")`
```
\
$group_2$ (2)
```
CTCACA
C--AC-
GT`r knitr::asis_output("\U25C6")`AC`r knitr::asis_output("\U25C6")`
```
#### {-}
### 2d)
Calculate the sum-of-pairs scores for each of the possible **$group_2$** choices.
#### {.tabset }
##### Hide
##### Hint: Important Step
:::: {#explaining .message-box }
::: {#note-exp .note-header}
```{r, include=knitr::is_html_output(), echo=FALSE,}
knitr::include_graphics("figures/infoicon.svg")
```
**Note**
:::
::: {#note-exp .note-body}
Don't forget to replace the `r knitr::asis_output("\U25C6")` symbol with the $-$
:::
::::
##### Solution
$group_2$ (1)
```
CTCACA
-C-AC-
GT-AC-
```
$sp_1$ = 1
\
$group_2$ (2)
```
CTCACA
C--AC-
GT-AC-
```
$sp_2$ = 2
#### {-}
### 2e)
Which final alignment would be picked regarding its sum of pairs score.
#### {.tabset }
##### Hide
##### Solution
```
CTCACA
C--AC-
GT-AC-
```
#### {-}
### 2f)
Based on what you have learned, what are the alignments and sum-of-pairs scores for the guide tree **(($S_2$, $S_3$), $S_1$)**?
#### {.tabset }
##### Hide
##### Solution
$group_2$ (1)
```
CTCACA
--CAC-
-GTAC-
```
$sp_1$ = 1
\
$group_2$ (2)
```
CTCACA
--CAC-
G-TAC-
```
$sp_2$ = 1
\
$group_2$(3)
```
CTCACA
-C-AC-
GT-AC-
```
$sp_3$ = 1
#### {-}