-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisease.php
311 lines (288 loc) · 15.2 KB
/
disease.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
<?php
include('db.php');
function get_PubMed_links($text){
$img_tag = "<img src=\"resource/redirect-icon.png\" height=\"12px\" width=\"auto\" />";
$ids = explode("|", explode(":", $text)[1]);
$links = array();
foreach($ids as $id)
array_push($links, "<a class=\"link\" target=\"_blank\" href=\"https://pubmed.ncbi.nlm.nih.gov/".$id."\">".$id."</a>");
return implode("; ", $links)." ".$img_tag;
}
function get_SourceID_links($text){
$img_tag = "<img src=\"resource/redirect-icon.png\" height=\"12px\" width=\"auto\" />";
list($source, $id_text) = explode(":", $text);
$ids = explode("|", $id_text);
$links = array();
foreach($ids as $id){
if ($source === "PubMed")
array_push($links, "<a class=\"link\" target=\"_blank\" href=\"https://pubmed.ncbi.nlm.nih.gov/".$id."\">".$id."</a>");
elseif ($source === "ClinVar")
array_push($links, "<a class=\"link\" target=\"_blank\" href=\"https://www.ncbi.nlm.nih.gov/clinvar/".$id."\">".$id."</a>");
else
array_push($links, $id);
}
return $source.": ".implode("; ", $links)." ".$img_tag;
}
$key = $_GET['key'];
// echo $key."<br/>";
$conn = connect();
$diseaseAttributes = array(
"MADID"=>"Disease ID",
"DiseaseName"=>"Disease name",
"DiseaseCategory"=>"Disease category",
"ExternalDiseaseIDs" => "External Disease IDs",
"MeSHTreeNumber" => "MeSH Tree Number",
);
$diseaseQuery = "select ".implode(",", array_keys($diseaseAttributes))." from disease where MADID=?;";
// echo $diseaseQuery."<br/>";
$diseaseStmt = $conn->prepare($diseaseQuery);
$diseaseStmt->bind_param("s", $key);
$diseaseStmt->execute();
$diseaseRows = execute_and_fetch_assoc($diseaseStmt);
$diseaseStmt->close();
// echo implode(",", $diseaseRows[0])."<br/>";
$proteinAttributes = array(
"UniProtAccession"=>"UniProt accession ID",
"GeneName"=>"Gene name",
"ProteinDiseaseAssociationID"=>"Association ID"
);
$proteinQuery = "select protein.UniProtAccession,GeneName,ProteinDiseaseAssociationID from protein inner join protein_disease_association on protein.UniProtAccession=protein_disease_association.UniProtAccession where MADID=?;";
// echo $proteinQuery."<br/>";
$proteinStmt = $conn->prepare($proteinQuery);
$proteinStmt->bind_param("s", $key);
$proteinStmt->execute();
$proteinRows = execute_and_fetch_assoc($proteinStmt);
$proteinStmt->close();
// echo count($proteinRows)."<br/>";
// foreach($proteinRows as $row) {
// echo implode(",", array_keys($row))."<br/>";
// echo implode(",", $row)."<br/>";
// }
$snpAttributes = array(
"MPMutationID"=>"Mutation ID",
"dbSNPID"=>"dbSNP ID",
"NucleotideVariation"=>"Nucleotide change",
"AminoAcidChange"=>"Amino acid change",
"nucleotide_variation.UniProtAccession"=>"UniProt accession ID",
"GeneName"=>"Gene name",
"MADID"=>"Disease ID",
"SourceID"=>"Source ID",
// "PMID"=>"PMID",
);
$snpQuery = "select ".implode(",", array_keys($snpAttributes))." from nucleotide_variation inner join protein on nucleotide_variation.UniProtAccession=protein.UniProtAccession where MADID=?;";
// echo $snpQuery."<br/>";
$snpStmt = $conn->prepare($snpQuery);
$snpStmt->bind_param("s", $key);
$snpStmt->execute();
$snpRows = execute_and_fetch_assoc($snpStmt);
$snpStmt->close();
// echo count($snpRows)."<br/>";
// foreach($snpRows as $row) {
// echo implode(",", array_keys($row))."<br/>";
// echo implode(",", $row)."<br/>";
// }
$expAttributes = array(
"DiseaseProteinExpressionID"=>"Expression ID",
"ExpressionVariation"=>"Expression variation",
"ExpressionMolecule"=>"Expression molecule",
"Sample"=>"Sample",
"Method"=>"Method",
"expression.UniProtAccession"=>"UniProt accession ID",
"GeneName"=>"Gene name",
"MADID"=>"Disease ID",
"Remarks"=>"Remarks",
"PMID"=>"PubMed ID",
);
$expQuery = "select ".implode(",", array_keys($expAttributes))." from expression inner join protein on expression.UniProtAccession=protein.UniProtAccession where MADID=?;";
// echo $expQuery."<br/>";
$expStmt = $conn->prepare($expQuery);
$expStmt->bind_param("s", $key);
$expStmt->execute();
$expRows = execute_and_fetch_assoc($expStmt);
$expStmt->close();
// echo count($expRows)."<br/>";
// foreach($expRows as $row) {
// echo implode(",", array_keys($row))."<br/>";
// echo implode(",", $row)."<br/>";
// }
//
closeConnection($conn);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>mitoPADdb - Mitochondrial Proteins Associated with Diseases database</title>
<link rel = "stylesheet" type = "text/css" href = "css/main.css" />
<!-- <script type = "text/javascript" src = "js/advance_search_input.js"></script> -->
</head>
<body>
<div class = "section_header">
<center><p class="title">mitoPADdb - Mitochondrial Proteins Associated with Diseases database</p></center>
</div>
<div class = "section_menu">
<center>
<table cellpadding="3px">
<tr class="nav">
<td class="nav"><a href="index.html" class="side_nav">Home</a></td>
<td class="nav"><a href="browse.html" class="side_nav">Browse</a></td>
<td class="nav"><a href="statistics.html" class="side_nav">Statistics</a></td>
<td class="nav"><a href="help.html" class="side_nav">Help</a></td>
<td class="nav"><a href="team.html" class="side_nav">Team</a></td>
</tr>
</table>
</center>
</div>
<!--<div class = "section_left"></div>-->
<div class = "section_middle">
<?php
if(count($diseaseRows) < 1)
echo "<center><p>Error !!! Disease ID: ".$key." does not exist in the database.</p></center>";
else {
echo "<center><h2>Disease ID: ".$key."</h2></center>";
echo
"<p style=\"width:80%; margin:10px 10% 5px 10%;\">
<b>Users can access the three different data for this disease</b> either by
selecting the name here,
<a class=\"link\" href=\"#disease-protein-associations\">1. Disease-protein associations</a>,
<a class=\"link\" href=\"#disease-associated-mutations\">2. Disease-associated mutations</a>,
<a class=\"link\" href=\"#disease-associated-expression-variation\">3. Disease-associated expression variation</a>,
or by scrolling up/down the page.
</p>";
echo "<table class=\"details\" border=\"1\">";
// echo "<tr><th>Attribute</th><th>Value</th></tr>";
foreach ($diseaseAttributes as $name=>$fname) {
if ($name !== "MADID") {
echo "<tr>";
echo "<td style=\"width:25%\"><b>".$fname."</b></td>";
echo "<td style=\"width:75%\">".$diseaseRows[0][$name]."</td>";
echo "</tr>";
}
}
echo "<tr><td style=\"width:25%\"><b>Protein associations</b></td><td style=\"width:75%\">";
$proteins = array();
foreach($proteinRows as $row)
array_push($proteins, "<a class=\"link\" href=\"#".$row["UniProtAccession"]."\">".$row["GeneName"]."</a>");
echo implode("; ", $proteins);
echo "</td></tr>";
echo "<tr><td style=\"width:25%\"><b>Mutations</b></td><td style=\"width:75%\">";
$snps = array();
foreach($snpRows as $row)
array_push($snps, "<a class=\"link\" href=\"#".$row["MPMutationID"]."\">".$row["MPMutationID"]."</a>");
echo implode("; ", $snps);
echo "</td></tr>";
echo "<tr><td style=\"width:25%\"><b>Expression</b></td><td style=\"width:75%\">";
$expressions = array();
foreach($expRows as $row) {
if($row["ExpressionVariation"] === "Down regulation")
array_push($expressions, "<a class=\"link\" href=\"#".$row["DiseaseProteinExpressionID"]."\">".$row["DiseaseProteinExpressionID"]."</a><font color=\"red\" title=\"Down regulation\">↓</font>");
else
array_push($expressions, "<a class=\"link\" href=\"#".$row["DiseaseProteinExpressionID"]."\">".$row["DiseaseProteinExpressionID"]."</a><font color=\"darkgreen\" title=\"Up regulation\">↑</font>");
}
echo implode("; ", $expressions);
echo "</td></tr>";
echo "</table>";
}
?>
<br/>
<center><h3 id="disease-protein-associations">Disease-protein associations</h3></center>
<?php
if(count($proteinRows) < 1)
echo "<center><p>No protein associations found in the database for Disease ID: ".$key." !!</p></center>";
else {
?>
<div style="overflow:auto;">
<table class="summary">
<tr><?php foreach($proteinAttributes as $attr) echo "<th>".$attr."</th>"; ?></tr>
<?php
foreach($proteinRows as $row) {
echo "<tr>";
foreach(array_keys($proteinAttributes) as $attr) {
if ($attr === "UniProtAccession")
echo "<td id=\"".$row[$attr]."\"><a class=\"link\" href=\"protein.php?keytype=ID&key=".$row[$attr]."\">".$row[$attr]."</a></td>";
else
echo "<td>".$row[$attr]."</td>";
}
echo "</tr>";
}
?>
</table>
</div>
<?php
}
?>
<br/>
<center><h3 id="disease-associated-mutations">Disease-associated mutations</h3></center>
<?php
if(count($snpRows) < 1)
echo "<center><p>No nucleotide mutations found in the database for Disease ID: ".$key." !!</p></center>";
else {
?>
<div style="overflow:auto;">
<table class="summary">
<tr><?php foreach($snpAttributes as $attr) echo "<th>".$attr."</th>"; ?></tr>
<?php
foreach($snpRows as $row) {
echo "<tr>";
foreach(array_keys($snpAttributes) as $attr) {
if ($attr === "MPMutationID")
echo "<td id=\"$row[$attr]\">".$row[$attr]."</td>";
elseif ($attr === "nucleotide_variation.UniProtAccession")
echo "<td><a class=\"link\" href=\"protein.php?keytype=ID&key=".$row["UniProtAccession"]."\">".$row["UniProtAccession"]."</a></td>";
elseif ($attr === "MADID")
echo "<td id=\"$row[$attr]\"><a class=\"link\" href=\"disease.php?key=".$row[$attr]."\">".$row[$attr]."</a></td>";
elseif($attr === "SourceID")
echo "<td>".get_SourceID_links($row[$attr])."</td>";
else
echo "<td>".$row[$attr]."</td>";
}
echo "</tr>";
}
?>
</table>
</div>
<?php
}
?>
<br/>
<center><h3 id="disease-associated-expression-variation">Disease-associated expression variation</h3></center>
<?php
if(count($expRows) < 1)
echo "<center><p>No expression data found in the database for Disease ID: ".$key." !!</p></center>";
else {
?>
<div style="overflow:auto;">
<table class="summary">
<tr><?php foreach($expAttributes as $attr) echo "<th>".$attr."</th>"; ?></tr>
<?php
foreach($expRows as $row) {
echo "<tr>";
foreach(array_keys($expAttributes) as $attr) {
if ($attr === "expression.UniProtAccession")
echo "<td><a class=\"link\" href=\"protein.php?keytype=ID&key=".$row["UniProtAccession"]."\">".$row["UniProtAccession"]."</a></td>";
elseif ($attr === "DiseaseProteinExpressionID")
echo "<td id=\"$row[$attr]\">".$row[$attr]."</td>";
elseif ($attr === "MADID")
echo "<td id=\"$row[$attr]\"><a class=\"link\" href=\"disease.php?key=".$row[$attr]."\">".$row[$attr]."</a></td>";
elseif ($attr === "PMID")
echo "<td>".get_PubMed_links($row[$attr])."</td>";
else
echo "<td>".$row[$attr]."</td>";
}
echo "</tr>";
}
?>
</table>
</div>
<?php
}
?>
<br/><hr/>
<p style="font-size:0.9em;text-align:center;">
© 2024 Bose Institute. All rights reserved. For queries, please contact Dr. Sudipto Saha
(<a class="link" href="mailto:[email protected]">[email protected]</a>,
<a class="link" href="mailto:[email protected]">[email protected]</a>).
</p>
</div>
</body>
</html>