$results=mysql_query($query);
$i = 0;
- $genes;
+ $tempgenes = array();
+ $row = mysql_fetch_row($results);
while($row != null) {
- $genes[$i] = $row[0];
+ $tempgenes[$i] = $row[0];
$row = mysql_fetch_row($results);
+ $i ++;
}
+ $genes = implode(",",$tempgenes);
mysql_close($connection);
?>
<script type="text/javascript">
-if(<?php echo (($_POST["type"] == "box") || ($_POST["type"] == "cluster")) ?> == 1) {
+if(<?php echo (($_POST["type"] == "cluster") || ($_POST["type"] == "box")) ?> == 1) {
document.Branch.param.value = "<?php echo $genes ?>";
- alert("<?php echo $genes ?>");
}
</script>
$connection=mysql_connect($url,$username,$password);
mysql_select_db($database);
-
-//This all gets the list of terms for the x-axis
$logic = "where gene_product.full_name='";
for($i = 0; $i < sizeof($genes); $i++) {
$toAdd = $genes[$i] . "'";
$logic = $logic . $toAdd;
}
+$query = "select full_name from gene_product " . $logic . " order by full_name";
+$results=mysql_query($query);
+$i = 0;
+$finalGenes = array();
+$row = mysql_fetch_row($results);
+while($row != null) {
+ $finalGenes[$i] = $row[0];
+ $row = mysql_fetch_row($results);
+ $i ++; //NOTE
+ }
+
+$logic = "where gene_product.full_name='";
+for($i = 0; $i < sizeof($finalGenes); $i++) {
+ $toAdd = $finalGenes[$i] . "'";
+ if($i + 1 < sizeof($finalGenes)) {
+ $toAdd = $toAdd . " or gene_product.full_name='";
+ }
+ $logic = $logic . $toAdd;
+}
+//This all gets the list of terms for the x-axis
+
+
$query="select concat(acc, \"- \", name),term_type from (select distinct name, acc,term_type from (select term_id from gene_product left join association on association.gene_product_id=gene_product.id " . $logic . ") as mytable left join term on term_id=term.id order by acc) as secondTable";
$results=mysql_query($query);
//new testing stuff with optimized queries
-$logic = "where gene_product.full_name='";
-for($i = 0; $i < sizeof($genes); $i++) {
- $toAdd = $genes[$i] . "'";
- if($i + 1 < sizeof($genes)) {
- $toAdd = $toAdd . " or gene_product.full_name='";
- }
- $logic = $logic . $toAdd;
-}
$query = "select full_name,term_id,concat(acc, \"- \", name),evnum from (select full_name,term_id,count(*) as evnum from gene_product left join association on association.gene_product_id=gene_product.id " . $logic . "group by full_name,term_id order by full_name,term_id) as temp left join term on term.id=term_id order by full_name,acc";
-echo $query;
$results=mysql_query($query);
$t = 0;
$g = -1;
$cellData;
-$finalGenes;
-$fg = 0;
for($row = mysql_fetch_row($results); $row != null; $row = mysql_fetch_row($results)) {
- if(($g == -1) || ($genes[$g] != $row[0])) {
+ if(($g == -1) || ($finalGenes[$g] != $row[0])) {
$g ++;
for($t = 0; $t < sizeof($terms); $t++) {
$cellData[$g][$t][0] = 0;
</canvas> </div>
<div id="topScrollDiv" style="overflow: auto; float: left; height: <?php echo ($height + 15) ?>px; width: 15px;" onscroll="drawMap();">
-<canvas id="nothing" width="1" height="<?php echo 210 + sizeof($genes)*15 ?>"> </canvas>
+<canvas id="nothing" width="1" height="<?php echo 210 + sizeof($finalGenes)*15 ?>"> </canvas>
</div>
<div id="sideScrollDiv" style="overflow: auto; float: left; height: 15px; width: <?php echo ($width + 15) ?>px;" onscroll="drawMap();">
cellData[i][j] = mediumRareCellData[i][j].split(",");
}
}
-var rawGenes = "<?php echo implode(",",$genes) ?>";
+var rawGenes = "<?php echo implode(",",$finalGenes) ?>";
var genes = rawGenes.split(",");
var geneCount = genes.length;
</body>
</html>
<!--
-Time out problem
-General Optimization
-Color
-Scrolling
+crop_amigo_2
-->