Hello!

To see the file structure, click on "tree".

Note that updates take place every 10 minutes, commits may not be seen immediately.
View Ontology Changes:
authormiles <miles@localhost>
Wed, 27 Mar 2013 19:04:12 +0000 (19:04 +0000)
committermiles <miles@localhost>
Wed, 27 Mar 2013 19:04:12 +0000 (19:04 +0000)
        -now strips out any genes that haven't been annotated from the
search paramters, and doesn't display them in the ontology
        -supports cluster and box ontologies from Heatmap

svn path=/; revision=451

Personnel/miles/Web Page/infoChoice.php
Personnel/miles/Web Page/viewOntology.php

index fa18081cb2d10999c210c7fc7726a39893aebcae..c1a3d125698e29319a41433d7069c93c748bd7b4 100644 (file)
@@ -40,11 +40,14 @@ if($_POST["type"] == "cluster") {
       $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);
 
@@ -162,9 +165,8 @@ 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>
 
index 318fca3eced9684028ddce5e3253386138e876c8..c956fc46a7bff951712efa22f5884193f2bf59c6 100644 (file)
@@ -26,8 +26,6 @@ $url="floret.cgrb.oregonstate.edu:3306";
 $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] . "'";
@@ -37,6 +35,28 @@ for($i = 0; $i < sizeof($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);
 
@@ -52,26 +72,15 @@ for($row = mysql_fetch_row($results); $row != null; $row = mysql_fetch_row($resu
 
 //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;
@@ -142,7 +151,7 @@ Your browser does not support the canvas element.
 </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();">
@@ -199,7 +208,7 @@ for(var i=0; i<mediumRareCellData.length; i++) {
     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;
 
@@ -426,8 +435,5 @@ function downloadTabDem() {
 </body>
 </html>
 <!--
-Time out problem
-General Optimization
-Color
-Scrolling
+crop_amigo_2
 -->