-
Notifications
You must be signed in to change notification settings - Fork 0
/
ampdb-ds-class.php
247 lines (236 loc) · 13.5 KB
/
ampdb-ds-class.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
245
246
247
<!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 Activity</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>
<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 Peptide Activity
</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="myChart"></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 `class_details`";
$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;">Class</th>
<th style="font-weight: 500;">Total entries</th>
</tr>
</thead>
<tbody>
<?php
$c = 1;
while ($row = $res->fetch_assoc()) {
if ($row['class'] != 'Kinase' and $row['class'] != 'Non-ribosomal protein' and $row['class'] != 'Non-hemolytic protein') {
?>
<tr>
<td><?= $row['sl'], "." ?></td>
<td><?= $row['class'] ?></td>
<td><?= $row['totentry'] ?></td>
</tr>
<?php $c += 1;
}
}
$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() * 70000) + 1000;
myChart.options.scales.y.max = newMax;
myChart.update();
}
function rescaleXAxis() {
var newMax = Math.floor(Math.random() * 93);
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('myChart').getContext('2d');
myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Acyltransferase', 'Amphibian defense peptide', 'Anti-biofilm', 'Anti-cancer', 'Anti-candida', 'Anti-gram-negative', 'Anti-gram-positive', 'Anti-hepatities', 'Anti-HIV', 'Anti-HSV', 'Anti-inflammatory', 'Anti-listeria', 'Anti-malarial', 'Anti-mollicute', 'Anti-MRSA', 'Anti-parasititic', 'Anti-plasmodium', 'Anti-protozoal', 'Anti-tuberculosis', 'Anti-uterotonic', 'Anti-yeast', 'Antibiotic', 'Antimicrobial', 'Antinociceptive', 'Antioxidant', 'Antiviral protein', 'Aspartyl esterase', 'Autophagy', 'Bacteriocin', 'Bacteriolytic enzyme', 'Blood coagulation cascade inhibiting toxin', 'Carboxypeptidase', 'Cell membrane', 'Chemotaxis', 'Cytokine', 'Cytolysis', 'Cytolytic', 'Cytotoxin', 'Defensin', 'DNA replication inhibitor', 'DNA-directed RNA polymerase', 'Endonuclease', 'Enzyme inhibitor', 'Exonuclease', 'Fungicide', 'Glycosidase', 'Helicase', 'Hemolytic', 'Hydrolase', 'Hypotensive', 'Ichthyotoxic', 'Insecticidal', 'Isomerase', 'Lantibiotic', 'Lectin', 'Ligase', 'Lyase', 'Metalloenzyme inhibitor', 'Metalloprotease inhibitor', 'Metalloprotease', 'Methyltransferase', 'Milk protein', 'Nuclease', 'Nucleotidyltransferase', 'Oxidoreductase', 'Peroxidase', 'Plant defense', 'Platelet aggregation inhibiting toxin', 'Protease inhibitor', 'Protease', 'Protein kinase inhibitor', 'Protein synthesis inhibitor', 'Proteolytic', 'Ribosomal protein', 'RNA-directed DNA polymerase', 'Rotamase', 'Serine protease inhibitor', 'Serine protease', 'Serine threonine-protein kinase', 'Signal peptide', 'Spermicidal', 'Synergistic peptide', 'Thiol protease inhibitor', 'Thiol protease', 'Toxin', 'Transferase', 'Tumor suppressor', 'Wound healing'],
datasets: [{
label: '# of Record(s)',
data: [1, 1187, 51, 51, 420, 5800, 2238, 2, 46, 11, 17, 31, 2, 3, 80, 100, 7, 40, 744, 1, 79, 18067, 59122, 1, 356, 33, 1, 9, 4411, 35630, 9, 1, 30, 32, 11,
2329, 52, 2727, 4726, 2, 3, 267, 101, 3, 4391, 20322, 2, 867, 25578, 2, 7, 62, 2, 530, 235, 2, 162, 5, 5, 5, 3, 10, 272, 5, 262, 70, 1158, 16, 100, 114, 1, 7, 13, 4, 3, 1, 91, 15, 11, 94, 17, 22, 6, 79, 465, 50, 1, 6
],
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: 100,
title: {
display: true,
text: 'Peptide Activity',
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>