Repository navigation
Expand file tree
/
Copy pathnetwork.php
More file actions
343 lines (306 loc) · 22.5 KB
/
Copy pathnetwork.php
File metadata and controls
343 lines (306 loc) · 22.5 KB
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
<!--
// CLMS-UI
// Copyright 2015 Colin Combe, Rappsilber Laboratory, Edinburgh University
//
// This file is part of CLMS-UI.
//
// CLMS-UI is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// CLMS-UI is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with CLMS-UI. If not, see <http://www.gnu.org/licenses/>.
-->
<?php
session_start();
$cacheBuster = '?v='.microtime(true);
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<meta name="description" content="common platform for downstream analysis of CLMS data" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="../vendor/css/reset.css<?php echo $cacheBuster ?>" />
<link rel="stylesheet" href="../vendor/css/common.css<?php echo $cacheBuster ?>" />
<link rel="stylesheet" href="../vendor/css/byrei-dyndiv_0.5.css<?php echo $cacheBuster ?>" />
<link rel="stylesheet" href="../vendor/css/jquery-ui.css<?php echo $cacheBuster ?>"/>
<!-- Spectrum Viewer styles -->
<link rel="stylesheet" href="../spectrum/css/spectrum.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="../spectrum/css/settings.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="../spectrum/css/QC.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="../spectrum/css/dropdown.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" type="text/css" href="../spectrum/css/font-awesome.min.css"/>
<link rel="stylesheet" href="../spectrum/vendor/dt-1.10.12_datatables.min.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/xispecAdjust.css<?php echo $cacheBuster ?>" />
<link rel="stylesheet" href="./css/style.css<?php echo $cacheBuster ?>" />
<link rel="stylesheet" href="./css/xiNET.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/matrix.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/tooltip.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="../vendor/css/c3.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/distogram.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/minigram.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/ddMenuViewBB.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/alignViewBB.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/selectionViewBB.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/circularViewBB.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/spectrumViewWrapper.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/validate.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/proteinInfoViewBB.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/key.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/filter.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/scatterplot.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/nglViewBB.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/networkPage.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/csvUpload.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/searchSummary.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/threeColourSlider.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/urlSearchBoxViewBB.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="../vendor/css/jquery.jsonview.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="../vendor/css/d3table.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="../vendor/css/multiple-select.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/list.css<?php echo $cacheBuster ?>">
<link rel="stylesheet" href="./css/goTermsView.css<?php echo $cacheBuster ?>">
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script> <!-- IE11 Promise Polyfill -->
<script type="text/javascript" src="../vendor/js/byrei-dyndiv_1.0rc1-src.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../vendor/js/d3.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../vendor/js/colorbrewer.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../vendor/js/ngl_verbose.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../vendor/js/c3.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../vendor/js/split.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../vendor/js/svgexp.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../vendor/js/underscore.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../vendor/js/spin.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../vendor/js/jquery-3.4.1.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../vendor/js/backbone.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../vendor/js/jquery.jsonview.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../vendor/js/d3table.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../vendor/js/cola.js<?php echo $cacheBuster ?>"></script><!-- for xiNET layout -->
<script type="text/javascript" src="../vendor/js/multiple-select.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../vendor/js/clusterfck.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../vendor/js/workerpool.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../vendor/js/d3-octree.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../vendor/js/jquery-ui.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../CLMS-model/src/CLMS/model/SearchResultsModel.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../CLMS-model/src/CLMS/model/SpectrumMatch.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../CLMS-model/src/CLMS/model/CrossLink.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../crosslink-viewer/src/CLMS/xiNET/CrosslinkViewerBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../crosslink-viewer/src/CLMS/xiNET/interactor/RenderedMolecule.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../crosslink-viewer/src/CLMS/xiNET/interactor/RenderedProtein.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../crosslink-viewer/src/CLMS/xiNET/interactor/RenderedComplex.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../crosslink-viewer/src/CLMS/xiNET/link/RenderedLink.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../crosslink-viewer/src/CLMS/xiNET/link/RenderedCrossLink.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../crosslink-viewer/src/CLMS/xiNET/link/P_PLink.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../crosslink-viewer/src/CLMS/xiNET/link/Link.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../crosslink-viewer/src/CLMS/xiNET/link/NaryLink.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../crosslink-viewer/src/CLMS/xiNET/Rotator.js<?php echo $cacheBuster ?>"></script>
<!-- Backbone models/views loaded after Backbone itself, otherwise need to delay their instantiation somehow -->
<script type="text/javascript" src="./js/Utils.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/circleArrange.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/filterModel.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/models.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/annotationTypeModel.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/compositeModelType.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/modelUtils.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/NGLUtils.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/stringUtils.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/fdr.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/distancesObj.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/distogramViewBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/threeColourSliderBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/filterViewBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/matrixViewBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/tooltipViewBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/minigramViewBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/ddMenuViewBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/NGLModelWrapperBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/PDBFileChooser.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/STRINGFileChooser.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/CSVFileChooserViewBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/metaDataFileChoosers.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/NGLViewBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/bioseq32.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/alignModelType.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/alignViewBB3.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/alignSettingsViewBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/selectionTableViewBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/circularViewBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/linkColourAssignment.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/spectrumViewWrapper.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/validate.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/loadSpectrum.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/proteinInfoViewBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/keyViewBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/scatterplotViewBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/networkFrame.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/downloads.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/searchSummaryViewBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/urlSearchBoxViewBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/xiNetControlsViewBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/listViewBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/goTermsSankeyViewBB.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/goTerm.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="./js/sankey.js<?php echo $cacheBuster ?>"></script>
<!-- Spectrum view files -->
<script type="text/javascript" src="../spectrum/vendor/datatables.min.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../spectrum/vendor/jscolor.min.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../spectrum/src/Wrapper.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../spectrum/src/AnnotatedSpectrumModel.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../spectrum/src/SpectrumControlsView.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../spectrum/src/SpectrumView2.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../spectrum/src/FragmentationKeyView.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../spectrum/src/PrecursorInfoView.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../spectrum/src/QCwrapperView.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../spectrum/src/ErrorPlotView.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../spectrum/src/SpectrumSettingsView.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../spectrum/src/PepInputView.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../spectrum/src/FragKey/KeyFragment.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../spectrum/src/graph/Graph.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../spectrum/src/graph/Peak.js<?php echo $cacheBuster ?>"></script>
<script type="text/javascript" src="../spectrum/src/graph/Fragment.js<?php echo $cacheBuster ?>"></script>
</head>
<body>
<!-- Main -->
<div id="main">
<!-- Define main first so page-header overlays it -->
<div class="mainContent">
<div id="topDiv">
<div id="networkDiv"></div>
</div>
<div id="bottomDiv"></div>
</div>
<div class="page-header">
<i class="fa fa-home fa-xi"
onclick="window.location = '../history/history.html';"
title="Return to search history / Login"></i>
<p id="loadDropdownPlaceholder"></p>
<p id="viewDropdownPlaceholder"></p>
<p id="proteinSelectionDropdownPlaceholder"></p>
<p id="annotationsDropdownPlaceholder"></p>
<p id="expDropdownPlaceholder"></p>
<p id="helpDropdownPlaceholder"></p>
<p id="surveyPlaceholder"><a href="https://edinburgh.onlinesurveys.ac.uk/xiview-usability" target="_blank" class="btn btn-1 btn-1a btn-tight" title="Click to do the xiView Survey!!!">* Survey *</a></p>
<div id="xiNetButtonBar"></div>
</div>
<div id='hiddenProteinsMessage'>
<p id='hiddenProteinsText'>Manually Hidden Message</p>
<!-- not very backbone but its only a button -->
<button class='btn btn-1 btn-1a showHidden' onclick="CLMSUI.compositeModelInst.showHiddenProteins()">Show</button>
</div>"
<div id='sslOption'>
<form><input type="text" style="z-index:10000" name="sslOption" value="L" size=1><br></form>
</div>"
<div class="controls">
<div id="filterPlaceholder"></div>
<div class="filterResultGroup">
<div id="filterReportPlaceholder"></div>
<div id="fdrSummaryPlaceholder"></div>
</div>
</div>
<div id="subPanelLimiter"></div>
</div><!-- MAIN -->
<script>
//<![CDATA[
//~ var windowLoaded = function () {
var CLMSUI = CLMSUI || {};
<?php
if (isset($_SESSION['session_name'])) {
echo "CLMSUI.loggedIn = true;";
}
if (file_exists('../xiSpecConfig.php')) {
include('../xiSpecConfig.php');
}
?>
var spinner = new Spinner({scale: 5}).spin (d3.select("#main").node());
var z;
var success = function (json) {
try {
if (json.error) {
throw "Error from server";
}
if (json.times) {
json.times.io = (Date.now() / 1000) - json.times.endAbsolute;
json.times.overall = json.times.io + (json.times.endAbsolute - json.times.startAbsolute);
}
console.log ("TIME t2", performance.now(), json.times);
//console.log (JSON.stringify(json));
//console.log (json);
if (json.warn) {
CLMSUI.utils.displayError (function() { return true; }, "Warning <p class='errorReason'>"+json.warn+"</p>");
}
CLMSUI.init.models (json);
var searches = CLMSUI.compositeModelInst.get("clmsModel").get("searches");
document.title = CLMS.arrayFromMapKeys(searches).join();
Split (["#topDiv", "#bottomDiv"],
{ direction: "vertical", sizes: [80,20], minSize: [200,10],
onDragEnd: function () { CLMSUI.vent.trigger ("splitPanelDragEnd"); }
}
);
d3.select(".gutter").attr("title", "Drag to change space available to selection table");
var returnedTimeStamp = new Date (json.timeStamp * 1000);
console.log (new Date(), returnedTimeStamp, new Date() - returnedTimeStamp);
if (Math.abs (new Date() - returnedTimeStamp) > 60 * 5 * 1000) { // if out by 5 minutes...
CLMSUI.utils.displayError (function() { return true; }, "Returned search results were generated at "+returnedTimeStamp+" and are likely from cache.<p class='errorReason'>If you have revalidated results since, press CTRL + F5 to refresh.</p>");
}
CLMSUI.init.views();
allDataLoaded ();
} catch (err) {
//console.log ("ERR", err);
CLMSUI.utils.displayError (function() { return true; }, "Unfortunately, an error has occurred while trying to load the search.<p class='errorReason'>"+(json ? json.error : "")+"</p>");
}
};
z = performance.now();
console.log ("TIME t1", performance.now());
if (window.location.search) {
// 1. Load spectrum matches, dont send all query string to php (ostensibly to help with caching)
var urlChunkMap = CLMSUI.modelUtils.parseURLQueryString (window.location.search.slice(1));
var phpProps = _.pick (urlChunkMap, "upload", "sid", "unval", "linears", "lowestScore", "highestScore", "decoys");
var newQueryString = d3.entries(phpProps).map(function (entry) { return entry.key+"="+entry.value; }).join("&");
console.log ("ucm", urlChunkMap, newQueryString);
var url = "../CLMS-model/php/spectrumMatches.php?" + newQueryString;
d3.json (url, function (error, json) {
spinner.stop(); // stop spinner on request returning
if (!error) {
success (json);
} else {
CLMSUI.utils.displayError (function() { return true; }, "Unfortunately, an error has occurred while trying to load the search.<p class='errorReason'>"+error.statusText+"</p>");
console.error ("Error", error);
}
});
} else {
spinner.stop(); // stop spinner
success ({times:{}}); // bug fix for empty searches
}
// 2. Can load GO file in parallel - saves I/O time on initialising (whichever is shorter, go terms or spectrum matches)
url = "./go.obo";
d3.text (url, function(error, txt) {
if (error) {
console.log("error", error, "for", url, arguments);
} else {
CLMSUI.go = CLMSUI.modelUtils.loadGOAnnotations (txt); // temp store until CLMS model is built
//CLMSUI.jsongo = CLMSUI.modelUtils.jsonifyGoMap (CLMSUI.go);
allDataLoaded ();
}
});
// 3. Can load BLOSUM matrics in parallel - saves a little bit of intiialisation
CLMSUI.init.blosumLoading ();
//]]>
</script>
</body>
</html>