-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTargets.php
More file actions
executable file
·328 lines (280 loc) · 11.4 KB
/
Copy pathTargets.php
File metadata and controls
executable file
·328 lines (280 loc) · 11.4 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
if(isset($_GET['hash'])){
if ($_GET['hash'] != $_COOKIE['cookie'])
{
// var_dump($_COOKIE['cookie']);
echo '<script>
alert("Input is illegal, you are return back ^.^!");
window.history.back();
// document.location.href="/miRNASNP2";
</script>';
exit;
}
}
# Check URL
if ($_SERVER["SCRIPT_NAME"] != $_SERVER["PHP_SELF"]) {
echo '<script>
alert("Input is illegal, you are return back ^.^!");
// window.history.back();
document.location.href="/miRNASNP2";
</script>';
exit;
}
# Exclude illegal query
if (preg_match("/[\'\(\):;\"<>]/", urldecode($_SERVER["QUERY_STRING"]))) {
echo '<script>
alert("Input is illegal, you are return back ^.^!");
// window.history.back();
document.location.href="/miRNASNP2";
</script>';
exit;
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="main.css" rel="stylesheet" type="text/css" />
<style type="text/css">
a{TEXT-DECORATION:none;
color:#0000FF;
}
.top
{
float:left;
font-size:300%;
width:auto;
line-height:80%;
}
.ttt1{
}
.ttt2{background-color:#FFE3D9;
}
</style>
<title>Targets</title>
<script type="text/javascript">
window.onload=window.onresize=function(){
if(document.getElementById("left").clientHeight<document.getElementById("content").clientHeight){
document.getElementById("left").style.height=document.getElementById("content").offsetHeight+"px";fsetHeight+"px";
}
else{
document.getElementById("content").style.height=document.getElementById("left").offsetHeight+"px";fsetHeight+"px";
}
}
</script>
</head>
<body>
<div id="container">
<div id='header'>
<img src="image/logo2.jpg" usemap="#chomap2" border="0" />
<map name="chomap2" id="chomap2">
<area shape="rect" coords="22,0,305,130" href="index.php" alt="homepage" />
</map>
</div>
<div id="left">
<?
include "sidebarinclude.php";
?>
</div>
<div id="content" style="font-family:Arial, Helvetica, sans-serif; font-size:16px">
<br>
<p class="quicksearch"> Targets gain/loss by SNPs in miRNA seed regions</p>
<p style="font-family:Arial, Helvetica, sans-serif">
<img src="image/logo_snp_in_seed.jpg" alt="snps in seed region" />
<? $gene=$_GET["gene"];
if(preg_match_all('/[#$%^&*()+=\[\]\';,.\/{}|":<>?~\\\\]/',$gene)){
echo '<script>alert("Input Error!");history.back();</script>';
}
?>
<form name="mirnaSearch2" METHOD="GET" ACTION="Targets.php" >
<input type="hidden" name="token" value="<?php echo $token; ?>" />
Browse by gene (e.g. ERG)
<input type="text" name="gene" value="<? if($gene!="") echo $gene; else echo "ERG";?>" />
<input type="submit" name="gainorlost" value="gain" />
<input type="submit" name="gainorlost" value="loss" />
</form>
<?
$mirna=$_GET["mirna"];
$snp=$_GET["snp"];
$gainorlost=$_GET["gainorlost"];
if(preg_match_all('/[#$%^&*()+=\[\]\';,.\/{}|":<>?~\\\\]/',$mirna)||preg_match_all('/[#$%^&*()+=\[\]\';,.\/{}|":<>?~\\\\]/',$snp)||preg_match_all('/[#$%^&*()+=\[\]\';,.\/{}|":<>?~\\\\]/',$gainorlost)){
echo '<script>alert("Input Error!");history.back();</script>';
}
if($mirna==""&&$snp==""&&$gainorlost=="")
{
include "connectinclude.php";
?>
<div id="table1" style="margin-top:10px;margin-left:10px;">
<table border="1">
<tr class="ttt2">
<td width="120">
miRNA
</td>
<td width="50">
Chromosome
</td>
<td width="100">
Start
</td>
<td width="100">
End
</td>
<td width="100" style="text-align:center">
SNP in seed
</td>
<td width="140">
Numbers of <br/>
gain target genes
</td>
<td width="140">
Numbers of <br/>
lost target gene
</td>
</tr>
<? $sqlcontrol="select miRNA_id from seed_target_gain_with_base group by miRNA_id";
$result = mysql_query($sqlcontrol);
$p=1;
while($row = mysql_fetch_array($result))
{if($p==1) $p=0; else $p=1;
$sqlcontrolmrna="select * from table2_mature_miRNA where mature_miRNA_id='".$row["miRNA_id"]."'";
$sqlcontrolsnp="select SNP_id from seed_target_gain_with_base where miRNA_id='".$row["miRNA_id"]."' group by SNP_id";
$resultsnp=mysql_query($sqlcontrolsnp);
$resultmrna=mysql_query($sqlcontrolmrna);
$rowmrna=mysql_fetch_array($resultmrna);
while($rowsnp=mysql_fetch_array($resultsnp))
{$sqlcontrolpre="select premir from table4_miRNA_SNP where snp_id='".$rowsnp["SNP_id"]."' and miRNA='".$row["miRNA_id"]."'";
$resultpre=mysql_query($sqlcontrolpre);
$rowpre=mysql_fetch_array($resultpre);
$sqlcontrolstarttoend="select * from table2_mature_miRNA where premiRNA_id='".$rowpre["premir"]."'";
$resultstarttoend=mysql_query($sqlcontrolstarttoend);
$rowstarttoend=mysql_fetch_array($resultstarttoend);
$sqlcontrolchr="select chr from table1_pre_miRNA where id='".$rowpre["premir"]."'";
$resultchr=mysql_query($sqlcontrolchr);
$rowchr=mysql_fetch_array($resultchr);
$sqlcontrolgain="select count(miRNA_id) from seed_target_gain_with_base where miRNA_id='".$row["miRNA_id"]."' and SNP_id='".$rowsnp["SNP_id"]."'";
$sqlcontrollost="select count(miRNA_id) from seed_target_loss_with_base where miRNA_id='".$row["miRNA_id"]."' and SNP_id='".$rowsnp["SNP_id"]."'";
$resultgain=mysql_query($sqlcontrolgain);
$resultlost=mysql_query($sqlcontrollost);
$rowgain=mysql_fetch_array($resultgain);
$rowlost=mysql_fetch_array($resultlost);
?>
<tr class="<? if($p==0) echo "ttt1"; else echo "ttt2"; ?>">
<td width="130"><a href="http://www.mirbase.org/cgi-bin/query.pl?terms=<? echo $row["miRNA_id"] ?>" target="_blank"> <? echo $row["miRNA_id"]; ?> </a></td>
<td style="text-align:center"> <? echo $rowchr["chr"]; ?></td>
<td> <? echo $rowstarttoend["start_on_chr"]; ?> </td>
<td> <? echo $rowstarttoend["end_on_chr"]; ?> </td>
<td><a href="http://www.ncbi.nlm.nih.gov/projects/SNP/snp_ref.cgi?rs=<? echo $rowsnp["SNP_id"] ?>" target="_blank"> <? echo $rowsnp["SNP_id"] ?> </a></td>
<td> <div style="float:left;align:center"><? echo $rowgain["count(miRNA_id)"]; ?></div>
<form name="mirnaSearch2" METHOD="GET" ACTION="Targets.php" style="float:right">
<input type="hidden" name="token" value="<?php echo $token; ?>" />
<input type="hidden" name="mirna" value="<? echo $row["miRNA_id"]?>" />
<input type="hidden" name="snp" value="<? echo $rowsnp["SNP_id"]?>" />
<input type="hidden" name="gainorlost" value="gain" />
<input type="image" onClick="mirnaSearch2.submit()" Src="image/detail_submit2.png" width="90" height="45" alt="target" />
</form>
</td>
<td><div style="float:left"> <? echo $rowlost["count(miRNA_id)"]; ?></div>
<form name="mirnaSearch2" METHOD="GET" ACTION="Targets.php" style="float:right">
<input type="hidden" name="token" value="<?php echo $token; ?>" />
<input type="hidden" name="mirna" value="<? echo $row["miRNA_id"]?>" />
<input type="hidden" name="snp" value="<? echo $rowsnp["SNP_id"]?>" />
<input type="hidden" name="gainorlost" value="loss" />
<input type="image" onClick="mirnaSearch2.submit()" Src="image/detail_submit2.png" width="90" height="45" alt="target" />
</form>
</td>
</tr>
<? }} ?>
</table>
</div>
<? }
else
{
?>
<div id="table2" style="font-family:Arial, Helvetica, sans-serif;margin-top:10px;margin-left:10px;">
<table border="1">
<tr class="ttt2">
<td width="180" >miRNA</td>
<td width="120" >Target site on <br>gene 3'UTR</td>
<td width="150" >Energy change<br>(kcal/mol) </td>
<td width="300" align="center" >SNP-miRNA/target duplexes </td>
<td > Effect by SNP-miRNA</td>
</tr>
<? include "connectinclude.php";
if($gene!="")
$sqlcontrol="select * from seed_target_".$gainorlost."_with_base where gene_id='".$gene."'";
else
if($snp!=""&&$mirna!="")
$sqlcontrol="select * from seed_target_".$gainorlost."_with_base where miRNA_id='".$mirna."' and SNP_id='".$snp."'";
else
$sqlcontrol="select * from seed_target_".$gainorlost."_with_base where miRNA_id='".$mirna."' or SNP_id='".$snp."'";
$sqlcontrol1=$sqlcontrol." and conserved_in_species!='NULL'";
$result = mysql_query($sqlcontrol);
$result1 = mysql_query($sqlcontrol1);
$p=1;
while($row = mysql_fetch_array($result))
{
$sqlcontrol3="select * from table4_miRNA_SNP where snp_id='".$row["SNP_id"]."'";
$result3=mysql_query($sqlcontrol3);
$row3=mysql_fetch_array($result3);
$snp_allele=substr($row3['ref_allele'],-1);
$mirlength=$strpos2-$strpos1-1;
if($p==1) $p=0; else $p=1;
?><tr class="<? if($p==0) echo "ttt1"; else echo "ttt2"; ?>">
<td width="180" ><a href="http://www.mirbase.org/cgi-bin/query.pl?terms=<? echo $row["miRNA_id"] ?>" target="_blank"> <? echo $row["miRNA_id"]; ?> </a><br/><a href="http://www.ncbi.nlm.nih.gov/projects/SNP/snp_ref.cgi?rs=<? echo $row["SNP_id"] ?>" target="_blank"> <? echo $row["SNP_id"]; ?> </a></td>
<td width="120" ><? echo $row["gene_id"] ?><br><? echo $row["M_start"]."-".$row["M_end"];?></td>
<td width="150"><? echo "Wild: ". $row["wild_energy"]."<br>"."SNP: ".$row["snp_energy"];?></td>
<td width="300" style="font-size:13px;"><?
$str=$row["base_pair"];
$enter=0;
?><table border="0" cellpadding="0" ><tr><?
for($i=0;$i<strlen($str);$i++)
{
if($str[$i]=="\n")
{$enter++;
}
if($enter>=2)
{ if($str[$i]=="\n")
{
?></tr><tr> <?
}
else
{
?><td><? if($str[$i]=='X'){
?> <div style="color:#FF0000"><?
if ($gainorlost=="gain"){echo '<b>'.'|'.'<b>';}else{ echo '<b>'.X.'<b>';}
echo '</div>';
}
elseif($str[$i]=='S'){
?><div style="color:#F0F;font-weight:bold;">
<a title="<? echo $row1['original_allele'].'--->'.$row1['snp_allele']; ?>"
href="http://www.ncbi.nlm.nih.gov/projects/SNP/snp_ref.cgi?rs=<? echo $row["SNP_id"] ?>"
style="cursor:pointer" target="_blank">
<?
echo $snp_allele;
?></a> </div> <?
}
else
{
echo $str[$i];
}
?></td><?
}
}
}
?></tr></table>
</td>
<td style="text-align:center"><? echo $gainorlost ?> </td>
</tr>
<?
}
?></table>
</div>
<div style="float:right"><a href="Targets.php">Back to the list of MiRNA</a></div>
<? }
?>
</div>
<?
include "footerinclude.php";
?>