</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 = "";
}
}
-$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
$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 ++)
$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);
?>
-<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" />
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();
}
<!--
-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