-
Notifications
You must be signed in to change notification settings - Fork 15
/
MEA.html
273 lines (236 loc) · 11.1 KB
/
MEA.html
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
<div class="row" id="introduction">
<div class="colW600">
To predict the structure with maximum expected accuracy (MEA) for a given
RNA sequence, the algorithm introduced by
<a href="http://dx.doi.org/10.1261/rna.1643609">Zhi J. Lu and co-workers (2009)</a>
uses the sequence's base pair and
unpaired probabilities. The approach follows a
<a href="index.jsp?toolName=Nussinov">Nussinov</a>-like
recursion using
the probabilities derived from
<a href="http://dx.doi.org/10.1002/bip.360290621">John S. McCaskill</a>'s algorithm.
<br />
<br />
Here, we use our
<a href="index.jsp?toolName=McCaskill">simplified McCaskill approach</a>
for the probability computation. Therein we apply
a Nussinov-like energy scoring scheme, i.e. each base pair of a structure
contributes a fixed energy term $E_{bp}$ independent of its context.
<br />
<br />
Furthermore, beside the identification of an optimal MEA structure
via traceback, we provide an exhaustive enumeration of up to 15 suboptimal structures
using the algorithm by
<a href="http://dx.doi.org/10.1002/(SICI)1097-0282(199902)49:2%3C145::AID-BIP4%3E3.0.CO;2-G">Stefan Wuchty et al. (1999)</a>.
For each structure, the according traceback is visualized on selection.
</div>
<div class="colW150">
<img alt="nested RNA structure" src="MEA-120x90.png" width=120 height=90 >
</div>
</div>
<div id="inputContainer">
<div class="row">
<div class="colW250" style="font-size: 120%; vertical-align: bottom; ">RNA sequence:</div>
<div class="colW400">
<input id="rawSeq" data-bind="value: rawSeq" class="userInput"
placeholder="Example 'GCACGACG'" onkeydown="validate(event)"
style="text-transform:uppercase">
</div>
</div>
<div class="row">
<div class="colW250" style="font-size: 120%">Minimal loop length $l$:</div>
<div class="colW400">
<select data-bind="value: loopLength" id="ll" style="width:40px;">
<option value=0>0</option>
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
<option value=5>5</option>
</select>
<label for="ll" style="margin-left:10px;">i.e. minimal number of enclosed positions</label>
</div>
</div>
<div class="row">
<div class="colW250" style="font-size: 120%">Energy weight of base pair $E_{bp}$:</div>
<div class="colW400">
<input data-bind="value: input.energy" id="energy" type="range" max="2" min="-2" step="(max - min) / 100">
<label for="energy" data-bind="text: input.energy"></label>
</div>
</div>
<div class="row">
<div class="colW250" style="font-size: 120%">'Normalized' temperature $RT$:</div>
<div class="colW400">
<input data-bind="value: input.energy_normal" id="energy_normal" type="range" max="5" min="1" step="(max - min) / 100">
<label for="energy_normal" data-bind="text: input.energy_normal"></label>
</div>
</div>
<div class="row">
<div class="colW250" style="font-size: 120%">Base pair weighting $\gamma$:</div>
<div class="colW400">
<input data-bind="value: input.gamma" id="gamma" type="range" max="5" min="1" step="(max - min) / 100">
<label for="gamma" data-bind="text: input.gamma"></label>
</div>
</div>
<div class="row">
<div class="colW250" style="font-size: 120%">Delta to MEA:</div>
<div class="colW400">
<select id="delta" data-bind="value: input.delta" style="width:40px;">
<option value=0>0</option>
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
<option value=5>5</option>
</select>
<label for="delta" style="margin-left:10px;">for suboptimal traceback</label>
</div>
</div>
<div class="row">
<div id="rec_select" style="display: none;">MaxExpAcc</div>
</div>
</div>
<div id="output">
<h2>MEA structure prediction</h2>
<div>
The MEA structure predictions uses the following recursion to fill
a dynamic programming table $M$. An entry $M_{i,j}$ provides the
MEA score for the subsequence $S_{i}..S_{j}$, such that the overall
score is found in $M_{1,n}$ for a sequence of length $n$.
</div>
<div id="rec_id_0" data-bind="text: latex()[0]"></div>
<div class="row" style="margin:0;">
<div class="col_table">
<canvas id="CanvasLayer" style="z-index: 0; border: 0px solid; position: absolute; width: 0px; height: 0px"></canvas>
<table style="margin:0;">
<thead>
<tr>
<th class="cell_mea_th">$M$</th>
<th class="cell_mea_th"></th>
<!-- ko foreach: { data: seqList, as: 'base' } -->
<th class="cell_mea_th" data-bind="writeSeq: [base, $index()+1]"></th>
<!-- /ko -->
</tr>
</thead>
<tbody id="matrix_body" data-bind="foreach: { data: cells()[0], as: 'cell' }">
<tr>
<th class="cell_mea_th" data-bind="writeSeq: [$root.seqList()[$index()], $index()+1]"></th>
<!-- ko foreach: { data: cell, as: 'v' } -->
<td class="cell_mea" data-bind="text: v.i < v.j+2 ? v.value : '', event: { mousedown: $root.clickCell.bind(this) }, attr: {title: 'i=' + v.i + ' j=' + v.j}"></td>
<!-- /ko -->
</tr>
</tbody>
</table>
<br />
<a href="javascript:generate_tables()">Download Tables</a>
<table style="display:none;margin:0;">
<tr>
<td id="info"
style="display: none; border: 1px solid grey; padding: 6px 14px;letter-spacing: 2px; background: #fff;"></td>
</tr>
</table>
</div>
<div class="col_structures">
<table id="structures" style="margin:0;">
<thead>
<tr>
<th id="structTableHeading">Possible Structures</th>
</tr>
</thead>
<tbody data-bind="foreach: { data: tracebacks, as: 'tb' }">
<tr><td id="structTableCells" data-bind="text: tb.structure, event: {mousedown:$parent.clickStructure}"
onclick="fornaRendering( document.getElementById('rawSeq').value, this)"></td></tr>
</tbody>
</table>
</div>
</div>
<div>
Select a structure from the list or a cell of $M$
to see according tracebacks. Note, the structure list is limited to
the first 15 structures identified via traceback.
<br>
Below, we provide a graphical depiction of the selected structure.
Note, the rendering does not support a minimal loop length of 0.
</div>
<div id="structureVisualization" style="margin:0;">
<div id="fornaInputStructure" style="height: 300px; background:white;"></div>
<span style="padding-left:15px;font-size:80%;">
Visualization done with
<a href="http://rna.tbi.univie.ac.at/forna">forna</a>.
Base pairs are given by red edges, the sequence backbone is given by
gray edges.
</span>
</div>
<h2>Probabilities used</h2>
<div>
Given the partition functions $Q$ and $Q^{bp}$ provided by the
<a href="index.jsp?toolName=McCaskill">McCaskill</a>
algorithm, we can compute the
probabilities of individual base pairs $(i,j)$ within the structure
ensemble, i.e. $P^{bp}_{i,j} = \sum_{P \ni (i,j)} \exp(-E(P)/RT) / Z$ given by
the sum of the Boltzmann probabilities of all structures that contain the
base pair. For its computation, the following recursion is used, which
covers both the case that $(i,j)$ is an external base pair as well
as that $(i,j)$ is directly enclosed by an outer base pair $(p,q)$.
</div>
<div id="rec_id" data-bind="text: latex()[1]"></div>
<div>
<div class="tableContainer">
<table id="matrixPbp" style="margin:0;">
<thead>
<tr>
<th class="cell_count" style="font-size: 16px; color: darkslategray">$P^{bp}$</th>
<th class="cell_count"></th>
<!-- ko foreach: { data: seqList, as: 'base' } -->
<th class="cell_count" data-bind="writeSeq: [base, $index()+1]"></th>
<!-- /ko -->
</tr>
</thead>
<tbody id='matrix_data' data-bind="foreach: { data: cells()[1], as: 'cell' }">
<tr>
<th class="cell_count" data-bind="writeSeq: [$root.seqList()[$index()], $index()+1]"></th>
<!-- ko foreach: { data: cell, as: 'v' } -->
<td class="cell_count" data-bind="text: v.i < v.j+2 ? v.value : ''"></td>
<!-- /ko -->
</tr>
</tbody>
</table>
</div>
<br>
<a href="javascript:generate_tables()">Download Tables</a>
</div>
<div>
The following formula is used to compute the probability $P^u_{i}$
that a given sequence position $S_{i}$ is not paired. The probabilities
are directly inferred from the base pair probabilities $P^{bp}$.
</div>
<div id="rec_id" data-bind="text: latex()[2]"></div>
<div>
<div class="tableContainer">
<table id="matrixPu" style="margin:0;">
<thead>
<tr>
<th class="cell_count" style="font-size: 16px; color: darkslategray">$P^u$</th>
<th class="cell_count"></th>
<!-- ko foreach: { data: seqList, as: 'base' } -->
<th class="cell_count" data-bind="writeSeq: [base, $index()+1]"></th>
<!-- /ko -->
</tr>
</thead>
<tbody id='matrix_data' data-bind="foreach: { data: cells()[2], as: 'cell' }">
<tr>
<th class="cell_count" data-bind="writeSeq: [$root.seqList()[$index()], $index()+1]"></th>
<!-- ko foreach: { data: cell, as: 'v' } -->
<td class="cell_count" data-bind="text: v.i < v.j+2 ? v.value : ''"></td>
<!-- /ko -->
</tr>
</tbody>
</table>
</div>
<br>
<a href="javascript:generate_tables()">Download Tables</a>
</div>
</div>
<script src="js/visualize.js"></script>
<!-- ensure structure list changes clear the forna rendering -->
<script type="text/javascript">/* <![CDATA[ */$("#structures").bind("DOMSubtreeModified", fornaClear);/* ]]> */</script>