</head>
<body>
<?php
-
$temp = explode(" ",$_POST['included']);
for($i = 0; $i < sizeof($temp)-1; $i ++)
{
}
}
-$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
$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 ++)
$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];
}
}
$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";
$width = 25*$speciesCount + 100;
$height = 25 * $clusterCount + 200;
-
?>
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;
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();
}