Hello!

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

Note that updates take place every 10 minutes, commits may not be seen immediately.
View Ontology Changes:
authormiles <miles@localhost>
Tue, 26 Mar 2013 23:30:12 +0000 (23:30 +0000)
committermiles <miles@localhost>
Tue, 26 Mar 2013 23:30:12 +0000 (23:30 +0000)
        -download as tab delimited file fully functional
        -check boxes for selecting or deselecting downloaded terms
functional

svn path=/; revision=449

Personnel/miles/Web Page/viewOntology.php

index f7b189d578bf0d57e4a952b84ac45ee50b140297..e2c04f82c161b3385d1115e9bacb818bd6b15d88 100644 (file)
@@ -118,9 +118,10 @@ $width = 1200;
 ?>
 <div id="Legend" style="float: right; height: 200px; width: 400px;">
 Note: The colors have no relevance to the data, they simply serve to distinguish rows visually. <br> <br>
-    The numbers printed inside each cell represent the confidence rating of the ontological assignment; a higher number indicates more confidence.<br><br>
-    An "A" after the term name signifies that it relates to anatomy, a "G" signifies that it relates to growth, development, or structure <br><br>
-    Click on a gene or term for detailed annotations from Plant Ontology.
+      The numbers printed inside each cell represent the confidence rating of the ontological assignment; a higher number indicates more confidence.<br><br>
+      An "A" after the term name signifies that it relates to anatomy, a "G" signifies that it relates to growth, development, or structure <br><br>
+      Click on a gene or term for detailed annotations from Plant Ontology. <br><br>
+      Select or deselect terms to be downloaded using the boxes underneath the term names.
 
 <form name="downloadImage" action="VOdownload.php" method="post">
 <input type="button" value="Download Tab Delimited File" onClick="downloadTabDem()"/>
@@ -241,7 +242,7 @@ for(var i = 0; i < terms.length; i ++) {
     var color = "#" + redcolor + greencolor + bluecolor;
     termColors[i] = color;
 
-    checkBoxes[i]=false;
+    checkBoxes[i]=true;
 
 }
 
@@ -303,6 +304,7 @@ function drawMap(init) {
 
     startXCell = Math.floor(scrolledLeft/cellSize);
     startYCell = Math.floor(scrolledTop/cellSize);
+    ontMap.strokeStyle="#0000FF";
     for(var t=startXCell; (t<termCount) && ((t-startXCell)<maxCols); t++) {
       var xCoord = leftOffset+(t-startXCell)*cellSize+5;
 
@@ -313,10 +315,7 @@ function drawMap(init) {
       if(checkBoxes[t]) {
        ontMap.fillRect(xCoord,topOffset-(cellSize*3),cellSize,cellSize);
       }
-      if(!checkBoxes[t]) {
-       ontMap.fillStyle="#000000";
-       ontMap.strokeRect(xCoord,topOffset-(cellSize*3),cellSize,cellSize);
-      }
+      ontMap.strokeRect(xCoord,topOffset-(cellSize*3),cellSize,cellSize);
 
       for(var g=startYCell; (g<geneCount) && ((g-startYCell)<maxRows); g++) {
 
@@ -380,8 +379,42 @@ function getGeneInfo(gene) {
   }
 
 function downloadTabDem() {
-  document.downloadImage.cellData.value=rawCellData;
-  document.downloadImage.terms.value=terms.join("\t");
+  var size = 0;
+  for(var i = 0; i < checkBoxes.length; i ++) {
+    if(checkBoxes[i]) size++;
+  }
+  if(size == 0) {
+    alert ("No terms were selected!");
+    return;
+  }
+
+  var toSend = new Array(genes.length);
+  for(var g = 0; g < cellData.length; g ++) {
+    toSend[g] = new Array(size);
+    var j = 0;
+    for(var t = 0; t < cellData[g].length; t ++) {
+      if(checkBoxes[t]) {
+       toSend[g][j] = cellData[g][t].join(",");
+       j++;
+      }
+    }
+  }
+  var rawData = new Array(genes.length);
+  for(var g = 0; g < toSend.length; g ++) {
+    rawData[g] = toSend[g].join(";");
+  }
+  var sendTerms = new Array(size);
+  j = 0;
+  for(var i = 0; i < terms.length; i ++) {
+    if(checkBoxes[i]) {
+      sendTerms[j]=terms[i];
+      j++;
+    }
+  }
+
+  var data = rawData.join(".");
+  document.downloadImage.cellData.value=data;
+  document.downloadImage.terms.value=sendTerms.join("\t");
   document.downloadImage.genes.value=genes.join(",");
   document.downloadImage.submit();
 }