<script src="http://static.simile.mit.edu/exhibit/api-2.1.0/exhibit-api.js"></script> <script src="http://static.simile.mit.edu/exhibit/extensions-2.1.0/chart/chart-extension.js"></script>
<link href="GE_data.json" type="application/json" rel="exhibit/data" />
{
"items" : [
{
"treatment" : "IL-4+Flexin_Hi",
"cond2" : "Flexin_Hi",
"gene" : "GeneR",
"cond1" : "IL-4",
"series" : "GeneR_IL-4+Flexin_Hi",
"pattern" : "Up_Reg",
"type" : "Measurement",
"label" : "72",
"change_time" : 15,
"fold_change" : 7.84
},
{
...
"properties" : {
"fold_change" : {
"valueType" : "number"
},...
<div ex:role="exhibit-view" ex:viewClass="Exhibit.TabularView" ex:label="Measurements Table" ex:columns=".label, .gene" ex:columnLabels="Msmt, Gene" ex:columnFormats="list, list" ex:sortColumn="1" ex:possibleOrders=".gene" ex:sortAscending="true"> </div>
ex:columns=".label, .gene, .treatment, .pattern, .fold_change, .change_time" ex:columnLabels="Msmt, Gene, Treatment, Pattern, Fold-Change (log), Change Time" ex:columnFormats="list, list, list, list, list, list"
<div ex:role="exhibit-view" ex:label="Expression" ex:viewClass="Exhibit.ScatterPlotView" ex:x=".change_time" ex:y=".fold_change" ex:xLabel="change time" ex:yLabel="fold change" ex:colorKey=".treatment" ex:cell="value"> </div>
<div ex:role="facet" ex:expression=".treatment" ex:facetLabel="Treatment" ></div>
<div ex:role="facet" ex:expression=".pattern" ex:facetLabel="Pattern" ></div> <div ex:role="facet" ex:facetClass="NumericRange" ex:expression=".fold_change" ex:facetLabel="fold change" ex:interval="1"></div> <div ex:role="facet" ex:expression=".change_time" ex:facetLabel="change time" style="width:300px" ex:height="12em"></div>
var regStyler = function(item, database, tr) {
var plan = database.getObject(item, "pattern");
var color = "lightgray";
switch (plan) {
case "No_Change": color = "#DDD"; break;
case "Up_Reg": color = "#F88"; break;
case "Down_Reg": color = "#8F8"; break;
}
tr.style.background = color;
};
Also add this within the Tabular View div element to tell it you wish to use this styler...
ex:rowStyler="regStyler"
<link href="genes.json" type="application/json" rel="exhibit/data" />
<div ex:role="collection" id="Measurement-id" ex:itemTypes="Measurement"></div> <div ex:role="collection" id="Gene-id" ex:itemTypes="Gene"></div>The data forms a graph inside the Exhibit browser when identifiers match
ex:collectionID="Measurement-id"
<div ex:role="exhibit-view" ex:label="Gene Comparisons" ex:collectionID="Gene-id" ex:viewClass="Exhibit.TileView"> </div>
<div ex:role="facet" ex:collectionID="Gene-id" ex:expression=".go_bio_process" ex:facetLabel="GO BiologicalProcess" style="width:300px" ></div>Note: the expression is relative to the Gene entity
<div ex:role="lens" ex:itemTypes="Gene">
<div style="font-size:1.4em; font:bold" ex:content=".label"></div>
<div>GO: <b><span ex:content=".go_bio_process"></span></b></div>
<div>Treatment: <b><span ex:content="foreach(!gene,
concat(.treatment,': ',.pattern))"
ex:formats="list {separator:' / '; last-separator:' / '; pair-separator:' / '}">
</span></b></div>
<div ex:if-exists=".entrez">Entrez-Gene: <a style="color:blue"
ex:href-subcontent="http://www.ncbi.nlm.nih.gov/sites/entrez?Db=gene&Cmd=ShowDetailView&TermToSearch={{.entrez}}&ordinalpos=1&itool=EntrezSystem2.PEntrez.Gene.Gene_ResultsPanel.Gene_RVDocSum">
<span ex:content=".entrez"></span></a></div><BR>
</div>
Specifically note: ex:content, ex:subcontent, and ex:href-subcontent
Also note the foreach operator
<div ex:role="exhibit-view" ex:viewClass="Exhibit.TabularView" ex:collectionID="Measurement-id" ex:label="Measurements Table" ex:columns=".label, .gene, .gene.go_bio_process, .treatment, .pattern, .fold_change, .change_time" ex:columnLabels="Msmt, Gene, GO, Treatment, Pattern, Fold-Change (log), Change Time" ex:columnFormats="list, list, list, list, list, list, list" ex:sortColumn="1" ex:possibleOrders=".gene" ex:sortAscending="true" ex:rowStyler="regStyler"> </div>