Hello!

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

Note that updates take place every 10 minutes, commits may not be seen immediately.
Fixed species inclusion to show even irrelevant species if asked.
authormiles <miles@localhost>
Mon, 19 Nov 2012 23:33:11 +0000 (23:33 +0000)
committermiles <miles@localhost>
Mon, 19 Nov 2012 23:33:11 +0000 (23:33 +0000)
Improved summary of data.

svn path=/; revision=415

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

index 7b1c94267f596e946dd02353ae6483689d813368..855ba426799b1f12fc63ed538e94980e6ea0a753 100644 (file)
Binary files a/Personnel/miles/Web Page/Heatmap.jar and b/Personnel/miles/Web Page/Heatmap.jar differ
index 60fd39eac2589250f8930e35f95c933ecc8a7292..8d1c2a2b49cd6738dd1c7132f5992d932e853d45 100644 (file)
@@ -5,13 +5,11 @@
 </head>
 <body>
 <?php
-$originalSpecies;
-if(isset($_POST['originalSpecies'])) {
-$originalSpecies = explode(" ", $_POST['originalSpecies']);
-}
-$includedSpecies = "";
-if(isset($_POST['excluded'])) {
-  $includedSpecies = $_POST['excluded'];
+
+$temp = explode(" ",$_POST['included']);
+for($i = 0; $i < sizeof($temp)-1; $i ++)
+  {
+  $includedSpecies[$i] = $temp[$i+1];
   }
 
 $input = "";
@@ -27,9 +25,10 @@ if(!preg_match("/[a-zA-Z0-9\.]/", substr($input,-1))) {
   }
 }
 
-$finalInput = "webpage " . $includedSpecies . ";" . $input;
+$finalInput = "webpage " . implode(" ", $includedSpecies) . ";" . $input;
+//echo "<br><br>";
 //echo $finalInput;
-
+//echo "<br><br>";
 exec("java -Djava.awt.headless=true -jar Heatmap.jar " . "\"" . $finalInput . "\"", $output);
 
 //main heatmap data parsing
@@ -38,16 +37,30 @@ for ($i = 0; $i < sizeof($output); $i ++) {
   $tmp[$i] = explode(",", $output[$i]);
   }
 
-
-$allSpecies;
+$speciesWithData;
 for ($s = 0; $s < sizeof($tmp) - 2; $s ++) // the last array in tmp is the list of cluster IDs
   {
-  $allSpecies[$s] = $tmp[$s][0];
+  $speciesWithData[$s] = $tmp[$s][0];
   }
-if(!isset($originalSpecies)) {
-$originalSpecies = $allSpecies;
-}
 
+$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 ++)
@@ -55,12 +68,20 @@ for ($c = 0; $c < sizeof($tmp[sizeof($tmp) - 2]); $c ++)
   $allClusterIDs[$c] = $tmp[sizeof($tmp) - 2][$c];
   }
 
-
 $heatMapData;
-for ($s = 0; $s < (sizeof($tmp) - 2); $s ++)
+for ($s = 0; $s < sizeof($allSpecies); $s ++)
   {
   for ($c = 0; $c < sizeof($allClusterIDs); $c ++)
-  $heatMapData[$s][$c] = $tmp[$s][$c+1];
+    {
+    if($s < sizeof($speciesWithData))
+      {
+      $heatMapData[$s][$c] = $tmp[$s][$c+1];
+      }
+    else
+      {
+      $heatMapData[$s][$c] = 0;
+      }
+    }
   }
 
 $geneIDs = explode(" ", $input);
@@ -106,50 +127,25 @@ $height = 25 * $clusterCount + 200;
 ?>
 
 
-<br> <br> <br> <br> <br>
+<br> <br>
 
 
-The following species have been included in the heat map: <?php echo $includedSpecies; ?>
+The following species have been included in the heat map: 
+<?php 
+echo str_replace("_", " ", implode(", ",$includedSpecies)); 
+?>
 
 
 <br> <br>
 Click on a species name, cluster number, or cell for more information.
-<br> Scroll down to see more clusters, right to see more species (if any exist).
-<br>
-<?php echo "There are " . $clusterCount . " clusters in the heatmap. <br> There are " . $speciesCount . " species in the heatmap."; ?>
+<br> <br> Scroll down to see more clusters, right to see more species (if any exist).
+<br> <br>
+<?php echo "There are " . $clusterCount . " clusters and " . $speciesCount . " species in the heatmap."; ?>
 
 <form name="infoForm" action="changes" method="post">
 <input type="hidden" name="param">
 </form>
 
-
-<!--
-THE ACTUAL QUERY
-<?php echo $finalInput ?>
-
-
-
-<br> <br>
-If you do not wish to view any of the species in the final heat map, click on the checkbox next to the correct species names and then click 'submit' to reload the heat map.
-<br> <br>
-<form action="heatMap.php" name="redraw" method="post">
-<input type="hidden" name="excluded" value = "">
-<input type="hidden" name="genelist" value="<?php if(isset($_POST['genelist'])) echo $_POST['genelist'] ?>" >
-<input type="hidden" name="geneIDs" value="<?php if(isset($_POST['geneIDs'])) echo $_POST['geneIDs'] ?>" >
-<input type="hidden" name="originalSpecies" value="<?php echo implode(" ", $originalSpecies) ?>" >
-<?php
-for($i = 0; $i < sizeof($originalSpecies); $i++) {
-echo "<input type=\"checkbox\" name=\"ch" . $i . "\" value=\"" . $originalSpecies[$i] . "\">\n";
-echo $originalSpecies[$i] . "\n";
-} 
-?>
-<p>
-<input type="button" value="Submit" onClick="resubmitSpecies()">
-</form>
--->
-
-
-
 <form name="jumpTo" >
 <input type="submit" value="Jump to Cluster:" onClick="return jumpToCluster()"/>
 <input type="text" name="cluster" />
@@ -445,7 +441,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 $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();
 }
 
@@ -459,6 +455,7 @@ canvas.addEventListener('mouseup', showInfo, false);
 
 
 <!--
-1. Possibility of putting species checkboxes in a table on Main Page
-2. Updating links given by Pankaj
+1. Updating links given by Pankaj
+2. Extraneus species show up at the end of the heatchart
+3. Improve text summary
 -->
\ No newline at end of file
index af35d80409b2161a6ea532c1344a6ac1c18532c4..c63be21c98e9205fb0a2b8a3717152f92f5dc735 100644 (file)
@@ -37,7 +37,7 @@ else
 if($goToNode10){
 ?>
 <form action="heatMap.php" name="genefileform" method="POST" style="display:none">
-<input type="hidden" name="excluded" value="<?php echo $_POST['excluded'] ?>">
+<input type="hidden" name="included" value="<?php echo $_POST['included'] ?>">
 <input type="text" name="genelist" value="<?php echo $data ?>">
 </form>
 <script type="text/javascript">