Commit 5daf7c37 authored by Niklas Mähler's avatar Niklas Mähler

Very specific changes for the current version to work

These changes are essentially bad. There are hard-coded thresholds and
whatnot. As soon as possible this should be made more flexible.
parent c6201ed0
......@@ -11,7 +11,7 @@ $dbConn = mysql_connect(
$db = mysql_select_db("plaza_complex", $dbConn) or die("Could not select DB");
$spNames = array("pt" => "P. Triocharpa", "at" => "A. Thaliana", "os" => "O. Sativa");
$spNames = array("pt" => "P. tremula", "at" => "A. thaliana", "os" => "Z. mays");
if (isset($_POST['op'])) $tmp_op=trim($_POST['op']);
if (isset($_GET['op'])) $tmp_op=trim($_GET['op']);
......
......@@ -93,13 +93,13 @@ if ( isset($_SERVER["REMOTE_ADDR"]) ) {
</table>
<table id="sub_table" width="100%" border="0">
<tr >
<td width="140px">co-expression:<span id="th1_span">(>=3)</span>
<td width="140px">co-expression: <span id="th1_span">(>=0.990)</span>
</td>
<td>
<table border="0" cellpadding="0" cellspacing="0" >
<tr>
<td width="100px"></td>
<td width="700px"> <input data-slider="true" data-slider-range="3,10" id="th1" name="th1" data-slider-step="0.5" value="3" type="text" data-slider-snap="true" data-slider-highlight="true" />
<td width="700px"> <input data-slider="true" data-slider-range="0.95,1" id="th1" name="th1" data-slider-step="0.001" value="0.99" type="text" data-slider-snap="true" data-slider-highlight="true" />
</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td >&nbsp; <button style="font-size:10px;text-transform:none" onClick="coexpressiontrclick();" id="coexpressiontrclickbtn" class="btn btn-4 btn-4c">Show conservation slider</button></td>
......@@ -108,11 +108,11 @@ if ( isset($_SERVER["REMOTE_ADDR"]) ) {
</td>
</tr>
<tr style="display:none" id="conservation_slider">
<td width="140px">conservation:<span id="consth1_span">(>=3)</td>
<td width="140px">conservation: <span id="consth1_span">(0.1)</td>
<td >
<table border="0" cellpadding="0" cellspacing="0" >
<tr >
<td width="800px" ><input data-slider="true" data-slider-range="2,10" id = "consth1" name="consth1" data-slider-step="0.5" value="3" type="text" data-slider-snap="true" data-slider-highlight="true"/></td>
<td width="800px" ><input data-slider="true" data-slider-range="0.001,0.1" id = "consth1" name="consth1" data-slider-step="0.005" value="0.1" type="text" data-slider-snap="true" data-slider-highlight="true"/></td>
</tr>
</table>
</td>
......
......@@ -724,20 +724,20 @@ window.onload = function() {
display: "A. thaliana",
value: "at"
}, {
display: "P. trichocarpa",
display: "P. tremula",
value: "pt"
}, {
display: "P. abies",
display: "Z. mays",
value: "os"
}];
var t = [{
display: "P. trichocarpa",
display: "P. tremula",
value: "pt"
}, {
display: "A. thaliana",
value: "at"
}, {
display: "P. abies",
display: "Z. mays",
value: "os"
}];
populate_select_options(t, "#sp_1");
......
......@@ -36,23 +36,27 @@ $first_query='SELECT '.$tmp_sp1.'_i,'.$tmp_sp1.'_id FROM '.$tmp_sp1.'Gene WHERE
$first_query_results = mysql_query($first_query);
$a1=0;
while ($row=mysql_fetch_row($first_query_results)){
while ($row=mysql_fetch_row($first_query_results)) {
$first_array[$a1]['id']=$row[0];
$first_array[$a1]['label']=$row[1];
$a1++;}
$a1++;
}
if($debug==true){print("<strong>----------------1.) QUERY >> FIRST NETWORK</strong></br>");}
if($debug==true){print($first_query);}
$first_sp_1_array=array_column2($first_array, 'id');
$first_sp_1_array_string=implode(',',array_values(array_unique($first_sp_1_array)));
$second_array=array();
if($tmp_showN=='align'){
if($debug==true){print("<br><strong>----------------2.) QUERY >> ALIGN BOTH NETWORKS</strong></br>");}
$second_query='SELECT '.$tmp_sp1.'_i,'.$tmp_sp2.'_i FROM '.$tabln.'Nod WHERE '.$tmp_sp1.'_i IN ('.$first_sp_1_array_string.') AND type="c" AND corr = 2';
if($debug==true){print($second_query);}
}else{
if($debug==true){print("<br><strong>----------------3.) QUERY >> COMPARE BOTH NETWORkS</strong></br>");}
$second_query='SELECT '.$tmp_sp1.'_i,'.$tmp_sp2.'_i FROM '.$tabln.'Nod WHERE '.$tmp_sp1.'_i IN ('.$first_sp_1_array_string.') AND '.$tmp_sp2.'_i IN(SELECT '.$tmp_sp2.'_i FROM '.$tmp_sp2.'Gene WHERE '.$tmp_sp2.'_id in('.$gstr2.')) AND type="c" AND corr = 2';
if($debug==true){print($second_query);}
if($debug==true){print("<br><strong>----------------2.) QUERY >> ALIGN BOTH NETWORKS</strong></br>");}
$second_query='SELECT '.$tmp_sp1.'_i,'.$tmp_sp2.'_i FROM '.$tabln.'Nod WHERE '.$tmp_sp1.'_i IN ('.$first_sp_1_array_string.') AND type="c" AND corr = 0.1';
if($debug==true){print($second_query);}
} else {
if($debug==true){print("<br><strong>----------------3.) QUERY >> COMPARE BOTH NETWORkS</strong></br>");}
$second_query='SELECT '.$tmp_sp1.'_i,'.$tmp_sp2.'_i FROM '.$tabln.'Nod WHERE '.$tmp_sp1.'_i IN ('.$first_sp_1_array_string.') AND '.$tmp_sp2.'_i IN(SELECT '.$tmp_sp2.'_i FROM '.$tmp_sp2.'Gene WHERE '.$tmp_sp2.'_id in('.$gstr2.')) AND type="c" AND corr = 0.1';
if($debug==true){print($second_query);}
}
$second_query_results = mysql_query($second_query);
$a2=0;
......
......@@ -26,7 +26,7 @@ $query_string = 'SELECT pval,type,'.$sp2.'Gene.'.$sp2.'_i as K,'.$sp2.'Gene.'.$s
FROM '.$tabln.'Nod
INNER JOIN '.$sp2.'Gene on ('.$tabln.'Nod.'.$sp2.'_i = '.$sp2.'Gene.'.$sp2.'_i)
WHERE '.$tabln.'Nod.'.$sp1.'_i IN ('.$gstr2.')
AND corr = 2 AND type = "c"'; #D added correlation, should be set as a variable in the end
AND corr = 0.1 AND type = "c"'; #D added correlation, should be set as a variable in the end
$result = mysql_query($query_string) or die(mysql_error());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment