From 456adfd3fb9c791ce4069d01081707a348dc9fd9 Mon Sep 17 00:00:00 2001 From: miles Date: Mon, 25 Mar 2013 22:06:37 +0000 Subject: [PATCH] View Ontology Changes: -legend now displays useful information -added evidence counts into the chart -distinguished between anatomy and growth terms svn path=/; revision=443 --- Personnel/miles/Web Page/viewOntology.php | 99 ++++++++++++++++++----- 1 file changed, 78 insertions(+), 21 deletions(-) diff --git a/Personnel/miles/Web Page/viewOntology.php b/Personnel/miles/Web Page/viewOntology.php index 8056cbb..f954208 100644 --- a/Personnel/miles/Web Page/viewOntology.php +++ b/Personnel/miles/Web Page/viewOntology.php @@ -37,12 +37,16 @@ for($i = 0; $i < sizeof($genes); $i++) { $logic = $logic . $toAdd; } -$query="select concat(acc, \": \", name) from (select distinct name, acc from (select term_id from gene_product left join association on association.gene_product_id=gene_product.id " . $logic . ") as mytable left join term on term_id=term.id order by acc) as secondTable"; +$query="select concat(acc, \": \", name),term_type from (select distinct name, acc,term_type from (select term_id from gene_product left join association on association.gene_product_id=gene_product.id " . $logic . ") as mytable left join term on term_id=term.id order by acc) as secondTable"; $results=mysql_query($query); $i = 0; for($row = mysql_fetch_row($results); $row != null; $row = mysql_fetch_row($results)) { - $terms[$i] = $row[0]; + $add = ""; + if($row[1]=="plant_anatomy") $add= " (A)"; + if($row[1]=="plant_structure_development_stage") $add= " (G)"; + $terms[$i][0] = $row[0]; + $terms[$i][1] = $add; $i++; } @@ -58,8 +62,6 @@ for($i = 0; $i < sizeof($genes); $i++) { } $query = "select full_name,term_id,concat(acc, \": \", name),evnum from (select full_name,term_id,count(*) as evnum from gene_product left join association on association.gene_product_id=gene_product.id " . $logic . "group by full_name,term_id order by full_name,term_id) as temp left join term on term.id=term_id order by full_name,acc"; - -echo $query; $results=mysql_query($query); $t = 0; @@ -71,28 +73,48 @@ for($row = mysql_fetch_row($results); $row != null; $row = mysql_fetch_row($resu $g ++; $genes[$g]; for($t = 0; $t < sizeof($terms); $t++) { - $cellData[$g][$t] = 0; + $cellData[$g][$t][0] = 0; } } for($t = 0; $t < sizeof($terms); $t++) { - if($row[2] == $terms[$t]) { - $cellData[$g][$t] = 1; + if($row[2] == $terms[$t][0]) { + $cellData[$g][$t][0] = 1; + $cellData[$g][$t][1] = $row[3]; } //TODO optimize this by using PO ID's instead of the entire term string } } +$semiFinalCellData; +for ($i = 0; $i < sizeof($cellData); $i ++) + { + for($j = 0; $j < sizeof($cellData[$i]); $j++) + { + $semiFinalCellData[$i][$j] = implode(",",$cellData[$i][$j]); + } + } + $finalCellData; -for ($i = 0; $i < sizeof($cellData); $i ++) +for ($i = 0; $i < sizeof($semiFinalCellData); $i ++) { - $finalCellData[$i] = implode(",", $cellData[$i]); + $finalCellData[$i] = implode(";", $semiFinalCellData[$i]); } $height = 800; $width = 1200; + +$printTerms; +for($i = 0; $i < sizeof($terms); $i ++) { + $printTerms[$i] = $terms[$i][0] . $terms[$i][1]; +} ?> +
+Note: The colors have no relevance to the data, they simply serve to distinguish rows visually.
+ The numbers printed inside each cell represent the confidence rating of the ontological assignment; a higher number indicates more confidence. +
+
@@ -110,18 +132,25 @@ Your browser does not support the canvas element. -- 2.34.1