-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresult.php
318 lines (267 loc) · 16.1 KB
/
result.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
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
<?php
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
error_reporting(-1);
$fh = null;
if (isset($_GET['id'])) {
$q = $_GET['id'];
}
require "includes/config.php";
include "includes/functions.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php require "includes/head-tag-elements.php"; ?>
</head>
<body>
<div id="wrapper">
<?php require "includes/header.php";
require "includes/nav.php"; ?>
<div id="main-content">
<div id="sidebar">
<div id="categories" class="boxed">
<h2 id="top">Our Services</h2>
<?php require 'includes/sidenav.php'; ?>
<!-- <div style="border:2px solid silver; height: auto; width:100%; border-radius: 10px; margin-top: 10px; margin-bottom: 10px;">
<div><img width="100%" src="images/news_table.gif" /></div>
<marquee behavior="scroll" direction="up" onmouseover="this.setAttribute('scrollamount', 0, 0);this.stop();" onmouseout="this.setAttribute('scrollamount', 6, 0);this.start();" height='250px'>
<p align=center>
<?php require "includes/news.php"; ?>
</p>
</marquee>
</div> -->
<div class="vertical-menu">
<a href="#ProteinName">Protein Name</a>
<a href="#Sequence">Sequence</a>
<a href="#PhosphorylationSites">Phosphorylation Sites</a>
<a href="#keywords">keywords</a>
<a href="#top">Go to Top <i class='fas fa-arrow-alt-circle-up' style='padding-left: 5px; font-size:24px'></i></a>
</div>
</div>
</div>
<div id="posts">
<div class="post">
<h2 class="title">List of Public Databases</h2>
<div class="meta">
<p class="date">Posted on January 20, 2020 by Dr. Shahid Ullah</p>
</div>
<div class="story">
</p>
</div>
</div>
</div>
<div id=posts>
<div class="container">
<div class="row">
<div class="col-12">
<?php
if (isset($_GET['id'])) {
// $q = $_GET['id'];
// $url = "https://www.uniprot.org/uniprot/" . $q . ".xml";
$response = curl_start($url);
// curl_end(curl_start($url));
// get_curl_data($response);
$file_handler = simplexml_load_file("p12345.xml");
}
?>
<table class="table table-bordered table-responsive-sm">
<thead>
<tr>
<th scope="col">Tag</th>
<th scope="col">Content</th>
</tr>
</thead>
<tbody>
<tr>
<td id="dbPAF">dbPAF ID</td>
<td><?php if (isset($_GET['id'])) {
$q = $_GET['id'];
echo "$q";
}
?>
</td>
</tr>
<tr>
<td id="Uniprot">Uniprot Accession</td>
<td><?php if (isset($_GET['id'])) {
$q = $_GET['id'];
$url = "https://www.uniprot.org/uniprot/" . $q . ".xml";
$response = curl_start($url);
$fh = get_curl_data($response);
curl_end(curl_start($url));
// $file_handler = simplexml_load_file("p12345.xml");
// parsexmlfile($file_handler,"protein");
// $fh = simplexml_load_file($xml);
// $fh = simplexml_load_file($xml);
// $fh = simplexml_load_string($xml);
$accession = $fh->entry->accession;
foreach ($accession as $id) {
echo ("<a href='https://www.uniprot.org/uniprot/" . $id . " ' target=_blank>$id<a/>; ");
}
} ?></td>
</tr>
<tr>
<td id="ProteinName">Protein Name</td>
<td>
<?php
$protein = $fh->entry->protein->recommendedName->children();
echo ($protein->fullName); ?>
</td>
</tr>
<tr>
<td id="ProteinSynonyms/Alias">Protein Synonyms/Alias</td>
<td><?php
$protein = $fh->entry->protein->children();
foreach ($protein as $altName) {
echo ($altName->fullName . "<br>");
}
?></td>
</tr>
<tr>
<td id="GeneName">Gene Name</td>
<td><?php
$gene = $fh->entry->gene;
echo ($gene->name); ?></td>
</tr>
<tr>
<td id="Organism">Organism</td>
<td><?php
$organism = $fh->entry->organism->children();
echo ("Scientific: " . $organism->name[0] . " ( ");
echo ("{$organism->name[1]} )");
?></td>
</tr>
<tr>
<td id="NCBITaxaID">NCBI Taxanomy ID</td>
<td><?php
$taxid = $fh->entry->organism->children();
echo "<a href=https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?lvl=0&id=" .
$taxid->dbReference['id'] . " target= '_blank'>"
. $taxid->dbReference['id'] . "</a>";
?></td>
</tr>
<tr>
<td id="FunctionalDescription">Functional Description</td>
<td>
<?php
$ftn = $fh->entry->comment[0];
echo $ftn->text[0];
?>
</td>
</tr>
<tr>
<td id="Sequence">Sequence</td>
<td style="overflow: hidden;">
<?php
echo "<pre>";
$sequence = $fh->entry->sequence;
$string = (string) $sequence;
$string1 = wordwrap($string, 10, " ", true);
$string2 = wordwrap($string1, 90, "\n", true);
echo $string2;
?>
</td>
</tr>
<tr>
<td id="PhosphorylationSites">Phosphorylation Sites</td>
<td>
<?php
$sql = "SELECT * from dbpsa where uniprot_id = '$q' order by uniprot_id asc limit 20";
$sql2 = "SELECT * from dbpsa where uniprot_id = '$q' order by uniprot_id asc";
$result = mysqli_query($conn, $sql);
$result2 = mysqli_query($conn, $sql2);
echo '<div class="text-center">';
echo 'dbPAF PTMs: ' . mysqli_num_rows($result2) . '<a href="#" data-toggle="modal" data-target="#exampleModalCenter"> (View All)</a>';
echo "</div>";
// Model Starts here
echo '
<div class="modal fade bd-example-modal-lg" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Phosphorylation Sites</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">';
echo "<table width=700px>";
echo <<< TABLE
<tr class="bg-warning" >
<td>Position</td>
<td>Peptides</td>
<td>Source</td>
<td>References ( PMIDs )</td>
</tr>
TABLE;
while ($row = mysqli_fetch_array($result2)) {
echo "<tr>";
echo "<td>{$row['position']}</td>";
$string = $row['peptide_sequnce'];
$color_string = str_replace("p", "<b><font color=red>p</font></b>", $string);
echo "<td>{$color_string}</td>";
echo "<td></td>";
echo "<td><a href='https://www.ncbi.nlm.nih.gov/pubmed/{$row['pmid']}' target='_blank'>{$row['pmid']}</a></td>";
echo "</tr>";
}
echo "</table>";
echo '</div>
</div>
</div>
</div>
';
// Modal Ends here
echo "<table>";
echo <<< TABLE
<tr class="bg-warning" >
<td>Position</td>
<td>Peptides</td>
<td>Source</td>
<td>References ( PMIDs )</td>
</tr>
TABLE;
while ($row = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>{$row['position']}</td>";
$string = $row['peptide_sequnce'];
$color_string = str_replace("p", "<b><font color=red>p</font></b>", $string);
echo "<td>{$color_string}</td>";
echo "<td></td>";
echo "<td><a href='https://www.ncbi.nlm.nih.gov/pubmed/{$row['pmid']}' target='_blank'>{$row['pmid']}</a></td>";
echo "</tr>";
}
echo "</table>";
?>
</td>
</tr>
<tr>
<td id="keywords">Keywords</td>
<td>
<?php
$keyword = $fh->entry->keyword;
foreach ($keyword as $child) {
echo "<a href='https://www.uniprot.org/keywords/" . $child['id'] . "' target='_blank'>" . $child['id'] . "</a> -- " . $child . "<br>";
};
?>
</td>
</tr>
<tr>
<td id="interPro">InterPro</td>
<td>
<?php
$dbReference = $fh->entry->dbReference;
?>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<?php require 'includes/footer.php'; ?>
</div>
<script type="text/javascript" src="js/nav.js"></script>
</div>
</body>
</html>