-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathindex.html
344 lines (321 loc) · 12.8 KB
/
index.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
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
<!DOCTYPE HTML>
<html>
<head>
<title>xiNET | Examples</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="xiNET is a visualisation tool for cross-linking and mass spectrometry data." />
<meta name="keywords" content="xiNET, biologists, mass-spectrometrists, cross-linking, protein, complexes, 3d, models, rappsilber, software" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="icon" type="image/ico" href="images/logos/favicon.ico">
<link rel="stylesheet" href="./demo/css/reset.css" />
<link rel="stylesheet" href="./demo/css/noscript.css" />
<link rel="stylesheet" href="./demo/css/style.css" />
<link rel="stylesheet" href="./demo/css/noNav.css" />
<link rel="stylesheet" href="./demo/css/xiNET.css">
<!--
<script type="text/javascript" src="./xiNET_2.0.0.js"></script>
-->
<!--libraries-->
<script type="text/javascript" src="./vendor/d3.js"></script>
<script type="text/javascript" src="./vendor/colorbrewer.js"></script>
<script type="text/javascript" src="./vendor/FileSaver.js"></script>
<script type="text/javascript" src="./vendor/rgbcolor.js"></script>
<!--xiNET-->
<script type="text/javascript" src="./src/controller/Init.js"></script>
<script type="text/javascript" src="./src/controller/MouseEvents.js"></script>
<script type="text/javascript" src="./src/controller/Layout.js"></script>
<script type="text/javascript" src="./src/controller/Refresh.js"></script>
<script type="text/javascript" src="./src/controller/ToolTips.js"></script>
<script type="text/javascript" src="./src/model/Match.js"></script>
<script type="text/javascript" src="./src/model/Link.js"></script>
<script type="text/javascript" src="./src/model/Protein.js"></script>
<script type="text/javascript" src="./src/model/Annotation.js"></script>
<script type="text/javascript" src="./src/model/ProteinLink.js"></script>
<script type="text/javascript" src="./src/model/ResidueLink.js"></script>
<script type="text/javascript" src="./src/controller/ExternalControls.js"></script>
<script type="text/javascript" src="./src/controller/Rotator.js"></script>
<script type="text/javascript" src="./src/controller/xiNET_Storage.js"></script>
<script type="text/javascript" src="./src/controller/ReadCSV.js"></script>
<script type="text/javascript" src="./src/controller/Fasta.js"></script>
</head>
<body>
<!-- Slidey panels -->
<div class="overlay-box" id="infoPanel">
<div id="networkCaption">
<p>No selection.</p>
</div>
</div>
<div class="overlay-box" id="helpPanel">
<table class="overlay-table" bordercolor="#eee" >
<tr>
<td>Toggle the proteins between a bar and a circle</td>
<td>Click on protein</td>
</tr>
<tr>
<td>Zoom</td>
<td>Mouse wheel</td>
</tr>
<tr>
<td>Pan</td>
<td>Click and drag on background</td>
</tr>
<tr>
<td>Move protein</td>
<td>Click and drag on protein</td>
</tr>
<tr>
<td>Expand bar <br>(increases bar length until sequence is visible)</td>
<td>Shift_left-click on protein</td>
</tr>
<tr>
<td>Rotate bar</td>
<td>Click and drag on handles that appear at end of bar</td>
</tr>
<tr>
<td>Hide/show protein (and all links to it)</td>
<td>Right-click on protein</td>
</tr>
<tr>
<td>Hide links between two specific proteins</td>
<td>Right click on any link between those proteins</td>
</tr>
<tr>
<td>Show all hidden links</td>
<td>Right click on background</td>
</tr>
<tr>
<td>'Flip' self-links</td>
<td>Right-click on self-link</td>
</tr>
</table>
</div>
<div class="overlay-box" id="legendPanel">
<div><img src="./demo/images/fig3_1.svg"></div>
</div>
<script type="text/javascript">
//<![CDATA[
helpShown = false;
infoShown = false;
legendShown = false;
function toggleHelpPanel() {
if (helpShown){
hideHelpPanel();
}
else {
showHelpPanel();
}
}
function toggleInfoPanel() {
if (infoShown){
hideInfoPanel();
}
else {
showInfoPanel();
}
}
function toggleLegendPanel() {
if (legendShown){
hideLegendPanel();
}
else {
showLegendPanel();
}
}
function showHelpPanel() {
helpShown = true;
d3.select("#helpPanel").transition().style("height", "500px").style("top", "100px").duration(700);
}
function hideHelpPanel() {
helpShown = false;
d3.select("#helpPanel").transition().style("height", "0px").style("top", "-95px").duration(700);
}
function showInfoPanel() {
infoShown = true;
d3.select("#infoPanel").transition().style("height", "300px").style("bottom", "115px").duration(700);
}
function hideInfoPanel() {
infoShown = false;
d3.select("#infoPanel").transition().style("height", "0px").style("bottom", "-95px").duration(700);
}
function showLegendPanel() {
legendShown = true;
d3.select("#legendPanel").transition().style("height", "500px").style("top", "100px").duration(700);
}
function hideLegendPanel() {
legendShown = false;
d3.select("#legendPanel").transition().style("height", "0px").style("top", "-95px").duration(700);
}
//]]>
</script>
<!-- Main -->
<div id="main">
<div class="container">
<h1 class="page-header">Example:
<select class="btn btn-1 btn-1a" id="dataSets" onchange="loadData();" >
<!--
<option value="TFIIF">TFIIF</option>
-->
<option selected value="PolII">PolII</option>
<option value="PP2A">PP2A</option>
<option value="NPC">NPC</option>
</select>
<div style='float:right'>
<button class="btn btn-1 btn-1a network-control resetzoom" onclick="xlv.reset();">
Reset
</button>
<button class="btn btn-1 btn-1a network-control" onclick="xlv.exportSVG('networkSVG');">Export SVG</button>
<label class="btn">
Legend
<input id="selection" onclick="toggleLegendPanel()" type="checkbox">
</label>
<label class="btn">
Details
<input id="selection" onclick="toggleInfoPanel()" type="checkbox">
</label>
<label class="btn">
Help
<input id="help" onclick="toggleHelpPanel()" type="checkbox">
</label>
</div>
</h1>
</div>
<div class="long-citation" id="citation"></div>
<div id="networkContainer"></div>
<div class="controlsexamplespage">
<label>Self-Links
<input checked="checked"
id="selfLinks"
onclick="xlv.showSelfLinks(document.getElementById('selfLinks').checked)"
type="checkbox"
/>
</label>
<label> Ambig.
<input checked="checked"
id="ambig"
onclick="xlv.showAmbig(document.getElementById('ambig').checked)"
type="checkbox"
/>
</label>
<div id="scoreSlider">
<p class="scoreLabel" id="scoreLabel1"></p>
<input id="slide" type="range" min="0" max="100" step="1" value="0" oninput="sliderChanged()"/>
<p class="scoreLabel" id="scoreLabel2"></p>
<p id="cutoffLabel">(cut-off)</p>
</div> <!-- outlined scoreSlider -->
<div style='float:right'>
<label>Annot.
<select id="annotationsSelect" onChange="changeAnnotations();">
<option selected='selected'>Custom</option>
<option>UniprotKB</option>
<option>SuperFamily</option>
<option>None</option>
</select>
</label>
</div>
</div>
<script type="text/javascript">
//<![CDATA[
var sliderDecimalPlaces = 1;
function getMinScore(){
if (xlv.scores){
var powerOfTen = Math.pow(10, sliderDecimalPlaces);
return (Math.floor(xlv.scores.min * powerOfTen) / powerOfTen)
.toFixed(sliderDecimalPlaces);
}
}
function getMaxScore(){
if (xlv.scores){
var powerOfTen = Math.pow(10, sliderDecimalPlaces);
return (Math.ceil(xlv.scores.max * powerOfTen) / powerOfTen)
.toFixed(sliderDecimalPlaces);
}
}
function sliderChanged(){
var slide = document.getElementById('slide');
var powerOfTen = Math.pow(10, sliderDecimalPlaces);
var cut = ((slide.value / 100)
* (getMaxScore() - getMinScore()))
+ (getMinScore() / 1);
cut = cut.toFixed(sliderDecimalPlaces);
var cutoffLabel = document.getElementById("cutoffLabel");
cutoffLabel.innerHTML = '(' + cut + ')';
xlv.setCutOff(cut);
}
//]]>
</script>
</div> <!-- MAIN -->
<script type="text/javascript">
//<![CDATA[
var config = [
//~ {//TFIIF
//~ file:"./data/TFIIF.csv",
//~ cite:"<p>Data from <a href='http://www.nature.com/emboj/journal/v29/n4/full/emboj2009401a.html' target='_blank'>Chen ZA, Jawhari A, Fischer L, Buchen C, Tahir S, Kamenski T, Rasmussen M, Lariviere L, Bukowski-Wills J-C, Nilges M, Cramer P & Rappsilber J (2010) Architecture of the RNA polymerase II–TFIIF complex revealed by cross-linking and mass spectrometry. The EMBO Journal 29: 717–726</a>.</p>"
//~ },
{//PolII
file:"./demo/data/PolII.csv",
cite:"<p>Data from <a href='http://www.nature.com/emboj/journal/v29/n4/full/emboj2009401a.html' target='_blank'>Chen ZA, Jawhari A, Fischer L, Buchen C, Tahir S, Kamenski T, Rasmussen M, Lariviere L, Bukowski-Wills J-C, Nilges M, Cramer P & Rappsilber J (2010) Architecture of the RNA polymerase II–TFIIF complex revealed by cross-linking and mass spectrometry. The EMBO Journal 29: 717–726</a>.</p>",
customAnnot:"./demo/data/TFIIF_annot.csv"
},
{//PP2A
file:"./demo/data/PP2A.csv",
cite:"<p>Data from <a href='http://www.sciencemag.org/content/337/6100/1348' target='_blank'>Herzog, F., Kahraman, A., Boehringer, D., Mak, R., Bracher, A., Walzthoeni, T., Leitner, A., Beck, M., Hartl, F.-U., Ban, N., Malmstrom, L., and Aebersold, R. (2012) Structural Probing of a Protein Phosphatase 2A Network by Chemical Cross-Linking and Mass Spectrometry. Science 337, 1348–1352</a>.</p>"
},
{//NPC
file:"./demo/data/NPC.csv",
cite:"<p>Data from <a href='http://www.sciencedirect.com/science/article/pii/S0092867413014165' target='_blank'>Bui, K. H., von Appen, A., DiGuilio, A. L., Ori, A., Sparks, L., Mackmull, M.-T., Bock, T., Hagen, W., Andrés-Pons, A., Glavy, J. S., and Beck, M. (2013) Integrated Structural Analysis of the Human Nuclear Pore Complex Scaffold. Cell 155, 1233–1243</a>.</p>"
}
];
function loadData(){
var dataSetsSelect = document.getElementById('dataSets');
var path = config[dataSetsSelect.selectedIndex].file;
document.getElementById('citation').innerHTML = config[dataSetsSelect.selectedIndex].cite;
if (config[dataSetsSelect.selectedIndex].customAnnot){
d3.text(config[dataSetsSelect.selectedIndex].customAnnot, "text/csv", function(annot) {
d3.text(path, "text/csv", function(text) {
xlv.clear();
xlv.readCSV(text, null, annot);
initSlider();
});
});
}
else {
d3.text(path, "text/csv", function(text) {
xlv.clear();
xlv.readCSV(text);
initSlider();
});
}
}
//~ window.addEventListener('load', function() {
var targetDiv = document.getElementById('networkContainer');
xlv = new xiNET.Controller(targetDiv);
var targetDiv = document.getElementById('networkContainer');
var messageDiv = document.getElementById('networkCaption');
xlv = new xiNET.Controller(targetDiv);
xlv.setMessageElement(messageDiv);
loadData();
changeAnnotations();
xlv.showSelfLinks(document.getElementById('selfLinks').checked);
xlv.showAmbig(document.getElementById('ambig').checked);
//~ }, false);
function changeAnnotations(){
var annotationSelect = document.getElementById('annotationsSelect');
xlv.setAnnotations(annotationSelect.options[annotationSelect.selectedIndex].value);
};
function initSlider(){
if (xlv.scores === null){
d3.select('#scoreSlider').style('display', 'none');
}
else {
document.getElementById('scoreLabel1').innerHTML = "Score:" + getMinScore();
document.getElementById('scoreLabel2').innerHTML = getMaxScore();
sliderChanged();
d3.select('#scoreSlider').style('display', 'inline-block');
}
};
//]]>
</script>
</body>
</html>