-
Notifications
You must be signed in to change notification settings - Fork 0
/
exercise-sheet-6.Rmd
179 lines (107 loc) · 4.34 KB
/
exercise-sheet-6.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
---
title: "Exercise sheet 6: Sankoff algorithm"
---
---------------------------------
# Exercise 1
<!--- --------------------------------- -->
::: {.question data-latex=""}
The Sankoff algorithm is obtained from the Zuker recursions by raising them from folding one sub-sequence to folding two sub-sequences.
Furthermore, it adds the edit distance.
Develop a simpler version of Sankoff that is obtained by starting the same construction from the simpler, but less efficient, form of the Zuker recursions
$$
C(i,j) = \min_{1 \leq k \leq 4} \left( \min_{s \text{ is a $k$-loop closed by } (i,j)} \left\{ e(s) + \sum_{(p,q) \text{ accessible in $s$ from } (i,j)} C(p,q) \right\} \right)
$$
with the initial conditions $C(i,i) = \infty$, and
$$
F(i,j)= \min
\begin{cases}
C(i,j) ,
min_{i \leq h < j}\{ F(i,h) + F(h+1,j) \}\\
\end{cases}
$$
with the initial conditions $F(i,i) = 0$.
Furthermore, you can neglect the edit distance contribution.
Make sure that your algorithm still has the same structural restrictions as the Sankoff algorithm,
i.e. each hairpin is aligned to a hairpin,
each multiloop is aligned to a corresponding multiloop and each 2-loop (including stackings and bulges) is aligned to at most one other 2-loop.
:::
<!--- --------------------------------- -->
### 1.1
::: {.question data-latex=""}
Generate respective recursion depictions for the translation of $C$ and $F$ into a Sankoff-style algorithm.
:::
#### {.tabset}
##### Hide
##### Solution
::: {.answer data-latex=""}
Decomposition into a hairpin and interior case analogously to the original Sankoff plus two explicit multi-loop cases for $k=3$ and $k=4$.
$$
C(i_{1},j_{1},i_{2},j_{2}) = \min
\begin{cases}
e(s_{1}) + e(s_{2}); & \text{where \(s_{1}, s_{2}\) are hairpin closing base pairs} (i_{1}, j_{1})(i_{2},j_{2}) \\
\min_{p_{1},q_{1},p_{2},q_{2}} \{e(s_{1}) + e(s_{2}) + C(p_{1},q_{1},p_{2},q_{2})\}; & \\
\min_{k > 2} \{e(s_{1}) + e(s_{2}) + \sum_{l=1}^{k-1} C(p_{1}^{l},q_{1}^{l},p_{2}^{l},q_{2}^{l})\} & \\
\end{cases}
$$
$$
\text{where in the second case, \( s_{1}, s_{2} \) are 2-loops enclosed by \( i_{1},j_{1},i_{2},j_{2} \) with \( pq \) accessible.}
$$
```{r, include=knitr::is_html_output(), echo=FALSE, fig.align='center', out.width='50%'}
knitr::include_graphics("assets/figures/exercise-sheet-6/e1-1.jpeg")
```
$$
F(i_{1},j_{1},i_{2},j_{2}) = \min
\begin{cases}
C(i_{1},j_{1};i_{2},j_{2})\\
min_{\substack{i_{1}\leq h_{1} \leq j_{1} \\ i_{2}\leq h_{2} \leq j_{2}}} \{F(i_{1},h_{1}; i_{2},h_{2}) + F(h_{1}+1, j_{1}; h_{2}+1, j_{2})\}\\
\end{cases}
$$
```{r, include=knitr::is_html_output(), echo=FALSE, fig.align='center', out.width='50%'}
knitr::include_graphics("assets/figures/exercise-sheet-6/e1-2.jpeg")
```
:::
#### {-}
<!--- --------------------------------- -->
### 1.2
::: {.question data-latex=""}
What is the general complexity?
What is the complexity without an upper bound for $k$?
:::
#### {.tabset}
##### Hide
##### Solution
::: {.answer data-latex=""}
here:
$O(n^4)*O(n^{4*3}) = O(n^{16})$
without upper bound on $k$:
$O(n^{4(k-1)+4})$ or $O(n^{4*k})$
:::
#### {-}
<!--- --------------------------------- -->
### 1.3
::: {.question data-latex=""}
What is the effect of omitting the edit distance contribution?
:::
#### {.tabset}
##### Hide
##### Solution
::: {.answer data-latex=""}
We only do simultaneous folding (mfe minimization) with helix alignment (since no sequence alignment contributions);
no penalties for helix-length differences (since we do not score sequence similarity or indel gaps);
Eventually, we find the best common structure shape, but sequence similarity of the respective alignment can be very bad (i.e. evolutionary unlikely).
:::
#### {-}
<!--- --------------------------------- -->
### 1.4
::: {.question data-latex=""}
Assume the derived recursion would incorporate sequence editing scores analogously to the original Sankoff approach via a respective matrix $D$.
What happens, if we apply very high gap scores within $D$?
:::
#### {.tabset}
##### Hide
##### Solution
::: {.answer data-latex=""}
Almost everything is aligned (matched or mismatched) and thus helix lengths should be very similar (interior loop indel less likely), ie overall it becomes a gap minimization problem and simultaneous folding becomes a 'second level objective'.
:::
#### {-}
<!--- --------------------------------- -->