From b5436b557719210437b18c7c11bbd8f4de9fd4c6 Mon Sep 17 00:00:00 2001 From: miles Date: Thu, 11 Oct 2012 23:03:28 +0000 Subject: [PATCH] svn path=/; revision=402 --- Personnel/miles/Web Page/heatMap.php | 92 +--------------------------- 1 file changed, 1 insertion(+), 91 deletions(-) diff --git a/Personnel/miles/Web Page/heatMap.php b/Personnel/miles/Web Page/heatMap.php index 5d0cceb..3385fe0 100644 --- a/Personnel/miles/Web Page/heatMap.php +++ b/Personnel/miles/Web Page/heatMap.php @@ -96,26 +96,8 @@ function array_search2d($needle, $haystack) { return $ind; } -//getting the information from SQL in order to create clickable gene IDs below the heatMap -$query = "select gene, species, super_id from super_clust where " . $logic . " order by species"; -mysql_select_db($database); -$results=mysql_query($query); -if(!$results) { - echo "
Database error, could not list tables."; - } - -$clickableGenes; -$k=0; -for($row=mysql_fetch_row($results); $row != null; $k++) { - $clickableGenes[$k] = ($row[0] . "," . $row[1] . "," . (array_search2d($row[2], $allClusterIDs)+1)); - $row=mysql_fetch_row($results); - - - - $width = 25*$speciesCount + 100; -$height = 25 * $clusterCount + 200 + 20 * sizeof($clickableGenes); -} +$height = 25 * $clusterCount + 200; ?> @@ -188,12 +170,6 @@ var allClusterIDs = rawClusterIDs.split(","); var maxCount = ; var clusterCount = ; -var rawClickableGenes = ""; -var rareClickableGenes = rawClickableGenes.split(";"); -var clickableGenes = new Array(rareClickableGenes.length); -for(var i=0; i(topOffset + cellSize*clusterCount))) { - var index = Math.floor((y+topScrollOffset-topOffset+cellSize*clusterCount)/cellSize)+Math.floor(scrolledTop/25); - var xVal = 0; - var yVal = 0; - var species = clickableGenes[index][1]; - var cluster = clickableGenes[index][2] - 1; - yVal = scrolledTop + topOffset + cluster*cellSize; - for(var i=0; i < allSpecies.length; i++) { - if(allSpecies[i] == species) { - xVal = scrolledLeft + leftOffset + i*cellSize; - } - } - heatMap.strokeStyle = "#22FF99"; - heatMap.strokeRect(xVal+borderWidth/2,yVal+borderWidth/2, cellSize-2*borderWidth, cellSize-2*borderWidth); - heatMap.strokeRect(xVal+borderWidth,yVal+borderWidth, cellSize-3*borderWidth, cellSize-3*borderWidth); - var xCoord = leftOffset+lastX*cellSize; - var yCoord = topOffset+lastY*cellSize; - heatMap.fillStyle = lastColor; - heatMap.fillRect(xCoord, yCoord, cellSize-borderWidth, cellSize-borderWidth); - if(lastX == ((xVal+scrolledLeft)-leftOffset)/cellSize) { - //TODO find out if this if statement can just be {}, or if i need to actually draw the rectangle - heatMap.strokeStyle = "#22FF99"; - heatMap.strokeRect(xVal+borderWidth/2,yVal+borderWidth/2, cellSize-2*borderWidth, cellSize-2*borderWidth); - heatMap.strokeRect(xVal+borderWidth,yVal+borderWidth, cellSize-3*borderWidth, cellSize-3*borderWidth); - } else { - lastX = ((xVal+scrolledLeft)-leftOffset)/cellSize; - lastY = cluster; - } - var count = parseInt(heatMapData[lastX][lastY]); - var redcolor = "00"; - var bluecolor = "00"; - var greencolor = "00"; - if(count == 0) { - redcolor = "5C"; - greencolor = "5C"; - bluecolor = "5C"; - } - else if(count == 1) { - redcolor = "CF"; - greencolor = "B5"; - bluecolor = "2B"; - } - else { - count = count - 2; - var redfrequency = Math.floor((count / (maxCount-2)) * 255); - redcolor = redfrequency.toString(16); - var bluefrequency = 255 - redfrequency; - bluecolor = bluefrequency.toString(16); - if(redcolor == "0") { - redcolor = "00"; - } - if(bluecolor == "0") { - bluecolor = "00"; - } - } - lastColor = "#" + redcolor + greencolor + bluecolor; - } } -- 2.34.1