-
Notifications
You must be signed in to change notification settings - Fork 15
/
co-folding.html
199 lines (175 loc) · 8.63 KB
/
co-folding.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
<div class="row" id="introduction">
<div class="colW600">
To predict RNA-RNA interactions optimizing both intra- as well as
intermolecular base pairs one can use a so called co-folding approach.
Here, the two interacting sequences are concatenated (using a
non-pairing linker sequence) to a single pseudo-sequence
that is then folded via single structure prediction.
When using a full nearest-neighbor energy model, special care has
to be taken for the scoring of the loop containing the linker as discussed by
<a href="http://dx.doi.org/10.1007/BF00818163">Ivo L. Hofacker and coworkers (1994)</a>.
<br>
<br>
Here, we extend the
<a href="index.jsp?toolName=Nussinov">Nussinov</a> algorithm for
such a co-folding scheme. No special linker treatment is necessary, since
we do a base pair maximization without taking the base pair's context
into account. We can directly use the Nussinov algorithm without
any extensions when using a linker sequence of length $l+1$
($L=\text{X}_{1}..\text{X}_{l+1}$),
where $l$ denotes the minimal loop length. The linker's length enables
intermolecular base pairs between the concatenated sequence ends.
Thus, for two sequences $S^{1}$ and $S^{2}$,
the hybrid sequence used for folding is given by $S=S^{1}LS^{2}$.
<br />
<br />
For prediction, we fill the dynamic programming
table $D$, where an entry $D_{i,j}$ provides the maximal number of
base pairs of any nested structure for the subsequence from $S_{i}$ to $S_{j}$.
The entry $D_{1,n}$ provides the overall maximal number of base pairs
for the whole hybrid sequence $S$ of length $n=|S^{1}|+l+1+|S^{2}|$.
Watson-Crick as well as GU base pairs are considered complementary.
<br />
Beside the identification of an according optimal hybrid structure
via traceback (intra- and intermolecular base pairs are given by $()$ and $[\;]$, resp.),
we provide an exhaustive enumeration of up to 15 suboptimal hybrids
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="co-folded RNA-RNA interaction" src="co-folding-120x90.png" width=120 height=90 >
</div>
</div>
<div id="inputContainer">
<div class="row">
<div class="colW200" style="font-size: 120%; vertical-align: bottom; ">RNA sequence $S^{1}$:</div>
<div class="colW400">
<input id="rawSeq" data-bind="value: rawSeq" class="userInput"
placeholder="Example 'GCACG'" onkeydown="validate(event)"
style="text-transform:uppercase">
</div>
</div>
<div class="row">
<div class="colW200" style="font-size: 120%; vertical-align: bottom; ">RNA sequence $S^{2}$:</div>
<div class="colW400">
<input id="rawSeq2" data-bind="value: rawSeq2" class="userInput"
placeholder="Example 'GCACG'" onkeydown="validate(event)"
style="text-transform:uppercase">
</div>
</div>
<div class="row">
<div class="colW200" 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>
</select>
<label for="ll" style="margin-left:10px;">i.e. minimal number of enclosed positions</label>
</div>
</div>
<div class="row">
<div class="colW200" style="font-size: 120%">Delta #bp to maximum:</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><div style="font-size: 120%">Used recursion (<a href="index.jsp?toolName=Nussinov">Nussinov</a> algorithm):</div></div>
<div id="rec_id" data-bind="text: latex()[0]"></div>
<div id="rec_select" style="display: none;">coFold</div>
</div>
<div id="output" style="margin:0;">
<div class="row">
<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_th">$D$</th>
<th class="cell_th"></th>
<!-- ko foreach: { data: seqList, as: 'base' } -->
<th class="cell_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_th" data-bind="writeSeq: [$root.seqList()[$index()], $index()+1]"></th>
<!-- ko foreach: { data: cell, as: 'v' } -->
<td class="cell" 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 Table</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.clickStructure4d}"
onclick="fornaRendering( getHybridSequence(document.getElementById('rawSeq').value,document.getElementById('rawSeq2').value,document.getElementById('ll').value), this)"></td></tr>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col">
Select a structure from the list or (multiple times) a cell of $D$
to see according tracebacks. Note, the structure list is limited to
the first 15 structures identified via traceback and thus depends
on the recursion case order.
<br>
Below, we provide a graphical depiction of the selected hybrid 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>Visualization of interacting base pairs (selected structure)</h2>
<div class="row">
<div id="4dVisual" class="hybridVisual">
</div>
</div>
<div class="row">
<div class="col">
The box provides an ASCII representation of the interacting
base pairs of the selected structure with $S^{1}$ on top and $S^{2}$
on the bottom.
Note, sequence $S^{2}$ is reversed (running from right ($5'$) to left
($3'$)) within this representation.
Note further, if no interacting
base pairs are present, no visualization is done.
</div>
</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>