-
Notifications
You must be signed in to change notification settings - Fork 0
/
ampdb-ds-ii.php
244 lines (231 loc) · 11.6 KB
/
ampdb-ds-ii.php
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AMPDB Data Stat by Instability Index</title>
<link rel="shortcut icon" href="logo.png" type="image/x-icon">
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.1.3/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.datatables.net/1.13.3/css/dataTables.bootstrap5.min.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.1.3/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.datatables.net/1.13.3/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.3/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
<nav class="navbar navbar-expand-sm navbar-dark bg-dark fixed-top">
<div class="container-fluid">
<a class="navbar-brand fs-3" href="ampdb-home">AMPDB v1</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mynavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="mynavbar">
<ul class="navbar-nav me-auto">
<li class="nav-item">
<a class="nav-link" href="ampdb-home">Home</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">Search</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="ampdb-text-search">Text Search</a></li>
<li><a class="dropdown-item" href="ampdb-specific-search">Specific Text Search</a></li>
<li><a class="dropdown-item" href="ampdb-target-organism-search">Search by Target
Organism</a></li>
<li><a class="dropdown-item" href="ampdb-pp-search">Search by Physicochemical Properties</a>
</li>
<li><a class="dropdown-item" href="ampdb-composition-search">Search by Protein
Composition</a>
</li>
<li><a class="dropdown-item" href="ampdb-activity-search">Search by Activity</a></li>
<li><a class="dropdown-item" href="ampdb-advanced-search">Advanced Search</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="browse-all-data">Browse</a>
</li>
<li class="nav-item">
<a class="nav-link" href="ampdb-classification">Classification</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">Tools</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="https://ampdb-protein-sequence-alignment-toolbox.streamlit.app/" target="_blank">Protein Sequence Alignment Toolbox</a></li>
<li><a class="dropdown-item" href="https://ampdb-protein-feature-calculation-toolbox.streamlit.app/" target="_blank">Protein Feature Calculation Toolbox</a></li>
</ul>
<li class="nav-item">
<a class="nav-link active" href="ampdb-data-stat">Statistics</a>
</li>
<li class="nav-item">
<a class="nav-link" href="ampdb-downloads">Downloads</a>
</li>
<li class="nav-item">
<a class="nav-link" href="ampdb-news">News/Updates</a>
</li>
<li class="nav-item">
<a class="nav-link" href="developers">Developers</a>
</li>
<li class="nav-item">
<a class="nav-link" href="ampdb-tutorial">Tutorial</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact">Contact</a>
</li>
</ul>
<form class="d-flex" action="ampdb-quick-search-result" method="get">
<input name="term" class="form-control me-2" type="text" placeholder="Quick Search">
<input type="submit" value="Search" name="search" class="btn btn-primary">
</form>
</div>
</div>
</nav>
<br><br><br>
<div class="container mt-3">
<div class="row" style="padding-left: 0rem;">
<div class="col-sm text-start" style="font-weight: 400; font-size:xx-large">
AMPDB Statistics: AMPDB Data Distribution by Instability Index
</div>
</div>
</div>
<div class="container mt-2">
<div class="row p-2 border border-2">
<div class="col-sm">
<div id="chartContainer">
<canvas id="lenChart"></canvas>
</div>
<div class="text-end">
<button style="padding: 0.2% 0.5% 0.2% 0.5%; border: 1px solid #0071BC; background-color: #F1F1F1; color: #0071BC; border-radius: 0px;" onclick="rescaleXAxis()">Rescale X Axis</button>
<button style="padding: 0.2% 0.5% 0.2% 0.5%; border: 1px solid #0071BC; background-color: #F1F1F1; color: #0071BC; border-radius: 0px;" onclick="rescaleYAxis()">Rescale Y Axis</button>
</div>
</div>
<div style="margin-top: 0.3%; font-size: small;">
<b style="font-weight: 500;">Note: </b><i>The initial scale is set to 10 of Y axis. Because the difference between lowest number of records and highest
number of records is very high. The graph is designed this way for better visualizations.
Click on the <b style="font-weight: 500;">"Rescale X Axis"</b> or <b style="font-weight: 500;">"Rescale Y Axis"</b> button to rescale the plot.</i>
</div>
</div>
</div>
<div class="container ">
<div class="row justify-content-center border border-2">
<div class="col-lg-19 bg-light rounded my-2 py-2">
<div class="row">
<div class="col-sm text-center" style="margin-top: 0.8%;">
<h5>Data in Table</h5>
</div>
</div>
<?php
require 'dbcon.php';
$sql = "SELECT * FROM `iistat`";
$res = $con->query($sql);
?>
<hr>
<div class="table-responsive">
<table class="table border border-2 table-striped table-hover">
<thead class="bg-dark text-white">
<tr>
<th style="font-weight: 500;">Sl. no.</th>
<th style="font-weight: 500;">Range of Instability Index</th>
<th style="font-weight: 500;">Total entries</th>
</tr>
</thead>
<tbody>
<?php
while ($row = $res->fetch_assoc()) {
?>
<tr>
<td><?= $row['sl'], "." ?></td>
<td><?= $row['reslen'] ?></td>
<td><?= $row['rec'] ?></td>
</tr>
<?php }
$con->close();
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('.table').DataTable();
});
</script>
<br><br><br><br>
<script>
var myChart;
function getRandomRGB() {
var r = Math.floor(Math.random() * 256);
var g = Math.floor(Math.random() * 256);
var b = Math.floor(Math.random() * 256);
return `rgba(${ r }, ${ g }, ${ b }, 0.2)`;
}
function getRandomBorderColor() {
var r = Math.floor(Math.random() * 256);
var g = Math.floor(Math.random() * 256);
var b = Math.floor(Math.random() * 256);
return `rgba(${ r }, ${ g }, ${ b }, 1)`;
}
function rescaleYAxis() {
var newMax = Math.floor(Math.random() * 35000) + 1000;
myChart.options.scales.y.max = newMax;
myChart.update();
}
function rescaleXAxis() {
var newMax = Math.floor(Math.random() * 21);
myChart.options.scales.x.max = newMax;
myChart.update();
}
var bgColors = [];
var borderColors = [];
for (var i = 0; i < 91; i++) {
bgColors.push(getRandomRGB());
borderColors.push(getRandomBorderColor());
}
var ctx = document.getElementById('lenChart').getContext('2d');
myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['-40 - -30', '-29 - -20', '-19 - -10', '-9-0', '1-10', '11-20', '21-30', '31-40', '41-50', '51-60', '61-70', '71-80', '81-90', '91-100', '101-110', '111-120', '121-130', '131-140', '141-150', '151-160', '161-170'],
datasets: [{
label: '# of Record(s)',
data: [1, 12, 57, 246, 703, 4292, 14363, 26001, 16765, 5968, 1997, 708, 239, 74, 17, 8, 5, 1, 2, 0, 2],
backgroundColor: bgColors,
borderColor: borderColors,
borderWidth: 1
}]
},
options: {
scales: {
y: {
beginAtZero: true,
max: 10,
title: {
display: true,
text: 'Number of Records',
font: {
size: 14
}
}
},
x: {
beginAtZero: true,
max: 23,
title: {
display: true,
text: 'Instability Index',
font: {
size: 14
}
}
}
}
}
});
</script>
<footer class="mt-3 text-center p-2 text-white" style="position: fixed; background-color: #5A6F80; font-size: small; left: 0; bottom: 0; width: 100%;">
© 2023 B&BL, DoAS, IIIT-A, UP-211015, India
</footer>
</body>
</html>