Hello!

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

Note that updates take place every 10 minutes, commits may not be seen immediately.
now all species requested will appear, regardless of relevance, in their
authormiles <miles@localhost>
Tue, 20 Nov 2012 23:53:06 +0000 (23:53 +0000)
committermiles <miles@localhost>
Tue, 20 Nov 2012 23:53:06 +0000 (23:53 +0000)
original alphanumberical order. much bug fixing. download as jpg working
again.

svn path=/; revision=416

Personnel/miles/Web Page/Heatmap.jar
Personnel/miles/Web Page/heatMap.php

index 855ba426799b1f12fc63ed538e94980e6ea0a753..5efbe9ddc3a3982abbe2393f9335605333ed3d32 100644 (file)
Binary files a/Personnel/miles/Web Page/Heatmap.jar and b/Personnel/miles/Web Page/Heatmap.jar differ
index 8d1c2a2b49cd6738dd1c7132f5992d932e853d45..1c96b29230ce3b8a07cced7e4efd0dcf04db14ac 100644 (file)
@@ -5,7 +5,6 @@
 </head>
 <body>
 <?php
-
 $temp = explode(" ",$_POST['included']);
 for($i = 0; $i < sizeof($temp)-1; $i ++)
   {
@@ -25,10 +24,8 @@ if(!preg_match("/[a-zA-Z0-9\.]/", substr($input,-1))) {
   }
 }
 
-$finalInput = "webpage " . implode(" ", $includedSpecies) . ";" . $input;
-//echo "<br><br>";
-//echo $finalInput;
-//echo "<br><br>";
+$finalInput = "webpage " . implode(" ",$includedSpecies) . ";" . $input;
+
 exec("java -Djava.awt.headless=true -jar Heatmap.jar " . "\"" . $finalInput . "\"", $output);
 
 //main heatmap data parsing
@@ -37,30 +34,16 @@ for ($i = 0; $i < sizeof($output); $i ++) {
   $tmp[$i] = explode(",", $output[$i]);
   }
 
-$speciesWithData;
+
+$allSpecies;
 for ($s = 0; $s < sizeof($tmp) - 2; $s ++) // the last array in tmp is the list of cluster IDs
   {
-  $speciesWithData[$s] = $tmp[$s][0];
+  $allSpecies[$s] = $tmp[$s][0];
   }
+if(!isset($includedSpecies)) {
+$allSpecies; //TODO remove all mention of included species after java has been run
+}
 
-$allSpecies = $speciesWithData;
-$j = 0;
-for($i = 0; $i < sizeof($includedSpecies); $i++)
-  {
-  $included = false;
-  for($s = 0; $s < sizeof($speciesWithData); $s++)
-    {
-    if($includedSpecies[$i] == $speciesWithData[$s])
-      {
-      $included = true;
-      }
-    }
-  if($included == false)
-    {
-    $allSpecies[sizeof($allSpecies) + $j] = $includedSpecies[$i];
-    $j++;
-    }
-  }
 
 $allClusterIDs;
 for ($c = 0; $c < sizeof($tmp[sizeof($tmp) - 2]); $c ++)
@@ -68,19 +51,13 @@ for ($c = 0; $c < sizeof($tmp[sizeof($tmp) - 2]); $c ++)
   $allClusterIDs[$c] = $tmp[sizeof($tmp) - 2][$c];
   }
 
+
 $heatMapData;
-for ($s = 0; $s < sizeof($allSpecies); $s ++)
+for ($s = 0; $s < (sizeof($tmp) - 2); $s ++)
   {
-  for ($c = 0; $c < sizeof($allClusterIDs); $c ++)
+  for ($c = 0; $c < sizeof($allClusterIDs); $c ++) 
     {
-    if($s < sizeof($speciesWithData))
-      {
-      $heatMapData[$s][$c] = $tmp[$s][$c+1];
-      }
-    else
-      {
-      $heatMapData[$s][$c] = 0;
-      }
+    $heatMapData[$s][$c] = $tmp[$s][$c+1];
     }
   }
 
@@ -89,12 +66,11 @@ $maxCount = $output[sizeof($output)-1];
 $clusterCount = sizeof($allClusterIDs);
 $speciesCount = sizeof($allSpecies);
 
-$temp;
+$finalHeatMapData;
 for ($i = 0; $i < sizeof($heatMapData); $i ++)
   {
-  $temp[$i] = implode(",", $heatMapData[$i]);
+  $finalHeatMapData[$i] = implode(",", $heatMapData[$i]);
   }
-$finalHeatMapData = $temp;
 
 // extra goodies from the mysql database
 $username="inparanoid-read-user";
@@ -123,7 +99,6 @@ function array_search2d($needle, $haystack) {
 
 $width = 25*$speciesCount + 100;
 $height = 25 * $clusterCount + 200;
-
 ?>
 
 
@@ -178,7 +153,7 @@ for(var i=0; i<rareHeatMapData.length; i++) {
   heatMapData[i] = rareHeatMapData[i].split(",");
   }
 
-var rawSpecies = "<?php echo implode(",",$allSpecies); ?>";
+var rawSpecies = "<?php echo implode(",",$includedSpecies); ?>";
 var allSpecies = rawSpecies.split(",");
 var speciesCount = allSpecies.length;
 
@@ -441,7 +416,7 @@ function jumpToCluster() {
 
 function generateImage() {
   document.infoForm.action="download.php";
-  document.infoForm.param.value = "unset DISPLAY && java -Djava.awt.headless=true -jar Heatmap.jar \"image" + "<?php echo implode(",",$includedSpecies)?>" + ";" + "<?php echo $input; ?>\"";
+  document.infoForm.param.value = "unset DISPLAY && java -Djava.awt.headless=true -jar Heatmap.jar \"image " + "<?php echo implode(" ",$includedSpecies)?>" + ";" + "<?php echo $input; ?>\"";
   document.infoForm.submit();
 }