Skip to content

Commit

Permalink
* cytoscape output
Browse files Browse the repository at this point in the history
  * increase node size
  * provide option to hide labels
  * add node shape legend
  • Loading branch information
zhiaos committed Jan 21, 2019
1 parent ce36e8e commit a96583d
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 22 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: sumer
Title: SUmmarizing Multiomics Enrichment analysis Results
Version: 1.0
Version: 1.1
Authors@R: person("Zhiao", "Shi", email = "[email protected]", role = c("aut", "cre"))
Description: Summarizes gene set and pathway enrichment analysis results from multiomics platforms with weighted
set cover and affinity propagation clustering algorithms. It therefore reduces redundancy among enriched
Expand Down
41 changes: 32 additions & 9 deletions R/sumer.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ sumer <- function(config_file, output_dir, n_threads=4){
ap_data$genesetInfo <- genesetInfo
ap_results <- affinityPropagation(ap_data)

platform_shape_icon <- c("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAMAAAAM7l6QAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAALFQTFRFAAAALi4u////KCgocnJyU1NTXFxcX19fYmJiZmZmbGxsZWVldnZ2ZGRkVFRULS0tS0tLX19fcHBwgYGBjY2NlJSUU1NTa2tri4uLsbGx0tLSQEBAY2NjioqKwsLCUFBQbm5up6enT09PcnJyuLi4MzMzMjIyY2Njp6eniYmJampqSkpKi4uLsbGxgICA5+fn8vLy9vb27+/v/v7+////6urq+Pj4+/v76enp7u7u0tLS+nIsWQAAAC90Uk5TAAAAAAAAAAAAAAAAAAAAABBFhbjY5RRlv/D+A0fB+wl07AiE9wICSOvAZRG+77h1H7CsAAAAAWJLR0QCZgt8ZAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAONJREFUKM+Nk9cSgjAQRV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kPtkbvBZou33z+G8td9w+7LHUOhgAAAAFiS0dECIbelXoAAAAJcEhZcwAACxMAAAsTAQCanBgAAAEfSURBVCjPdZJnd4JAEEUHXRds0cTee++9N3RtYI35/38lKJEoLPfrPfP27MwDuMPYPxzOTwWn48vOgILB6HLzyxd4t8toUDTyeFfkjZXXg56WMfn8RIXfZ3rGo0BwrdbrYOBv3BAKb4iGTTgkv44j0a1Wb6MR/IiOxXeEwi4ek+Ixm0gSKskEiwGl0nu63qdTCLhMluiQzXCQywt6WsjnoCASXcQCFA/6+lCEUvmoZ4/lEkDlpKdPFWkr1RpPt3ytigCb6w26btTN0lpRs3Wm2XOreb8Za2l3Llp76bQt7KMN3R7l72KvK/fByvQHms0Jgz5jlfuAueFIrUdDDitVHE+u7/Y6GStVBGybzr7fmE1t+L/oaL64/bxwW8zl4V/ItJ8bdLPi4gAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxOS0wMS0yMFQxMDoyOTozOC0wNjowMKDoi6gAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTktMDEtMjBUMTA6Mjk6MzgtMDY6MDDRtTMUAAAAAElFTkSuQmCC")
# add results to webpage
cat("<div style=\"margin-left:10px\" id=\"results\">", file=output_index_file, append=TRUE)
cat("<h4> Original gene sets</h4>\n", file=output_index_file,append=TRUE,sep="")
Expand Down Expand Up @@ -151,23 +158,31 @@ sumer <- function(config_file, output_dir, n_threads=4){
}

cat("</div><h4>Summary of top gene sets from all platforms </h4>\n", file=output_index_file, append=TRUE)
cat("<div id='apcy_notes' style='border: 1px solid gray; border-radius: 5px;background-color:#F4F6F6;width:1210px;margin-bottom:30px;padding:5px;'>
cat("<div id='apcy_notes' style='border: 1px solid gray; border-radius: 5px;background-color:#F4F6F6;width:1610px;margin-bottom:30px;padding:5px;'>
<ul>
<li>Clustering is performed using <a target='_new' href='https://www.psi.toronto.edu/affinitypropagation/'>affinity propagation</a> algorithm.</li>
<li>Each node represents a gene set. </li>
<li>Size of nodes represents the relative number of genes in the set. </li>
<li>Node shape maps to omics platform (e.g., RNA-seq, Proteomics, Phosphoproteomics). </li>
<li>Node color maps to value of scores. </li>
<li>Node shape maps to omics platform. </li>\n", file=output_index_file, append=TRUE)
cat('<div class="nodeshape">\n', file=output_index_file, append=TRUE)
for(i in seq_len(n_platform)) {
cur_config <- config[i,]
cur_platform <- cur_config[["platform_name"]]
cat('<div class="nodeshape-left" style="background: url(', platform_shape_icon[i], ') no-repeat">\n', file=output_index_file, sep='', append=TRUE)
cat('</div>\n', file=output_index_file, append=TRUE)
cat('<div class="nodeshape-right">', cur_platform, '</div>\n', file=output_index_file, sep='', append=TRUE)
}
cat("</div><li>Node color maps to value of scores. </li>
</ul>
</div>\n", file=output_index_file, append=TRUE)
cat('<div id="cy_toolbar">
<div id="cy_layout_choice" style="float:left; margin-bottom:0px;">Select a layout style:
<select class="chzn-layout-select" name="cy_layout_select" style="width:250px;">
cat('<div class="toolbargrid">
<div id="cy_layout_choice" style=" margin-bottom:0px;">Select a layout style:
<select class="chzn-layout-select" name="cy_layout_select" style="width:150px;">
<option value="cose-bilkent">CoSE-Bilkent</option>
<option value="dagre">Dagre</option>
</select>
</div>
<div id="cy_search" style="margin-left:20px;float:left;">Search:
<div id="cy_search" style="margin-left:20px;">Search:
<select class="chzn-cy-search-select" data-placeholder="search gene set..." name="cy_search_select" style="width:500px;">
<option value=""></option>\n', file=output_index_file, append=TRUE)

Expand All @@ -186,8 +201,16 @@ sumer <- function(config_file, output_dir, n_threads=4){
cat("<option value='", node_id, "'>", gsub("_", " ", node_id),"</option>\n", sep="", file=output_index_file, append=TRUE)
}

cat("</select>\n</div>\n</div>\n", file=output_index_file, append=TRUE)
cat("<div id='apcy_info' style='margin-top:0px;margin-bottom:20px;'>\n", file=output_index_file, append=TRUE)
cat("</select>\n</div>\n", file=output_index_file, append=TRUE)
cat('<div id="cy_label_choice" style="margin-bottom:0px;">Show/hide label:
<select class="chzn-label-select" name="cy_label_select" style="width:200px;">
<option value="showall">Show all labels</option>
<option value="hide1">Hide first level label</option>
<option value="hide12">Hide first and second level label</option>
</select>
</div>
</div>\n', file=output_index_file, append=TRUE)
cat("<div id='apcy_info' style='margin:0 0 20px 10px;'>\n", file=output_index_file, append=TRUE)
cat("<span style='display:inline-block; margin-right:5px;'><a id='acpy_download_data' href='", ap_results[['zip']], "' download class='chosen-button'>Download data</a></span>\n", file=output_index_file, sep="", append=TRUE)
cat("<select data-placeholder='export network as...' class='chzn-cy-export' style='width:200px;' id='cytscp_exp_sel'>
<option value=''></option>
Expand Down
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ gmt2list <- function(gmt_file){

# for cytoscape, set node size
computeNodeDim <- function(maxVal, minVal, val){
maxCyNodeSize<-100;
minCyNodeSize<-5;
maxCyNodeSize<-200;
minCyNodeSize<-50;
return((val-minVal)/(maxVal-minVal)*(maxCyNodeSize-minCyNodeSize)+minCyNodeSize)
}

Expand Down
58 changes: 48 additions & 10 deletions inst/assets/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,12 @@
padding-right:10px;
}
#apcy {
width:1200px;
width:1600px;
height:1200px;
padding: 10px;
border: 1px solid gray;
border-radius: 5px;
}
#cy_toolbar {
height:40px;
width:1220px;
margin-bottom:0px;
}
#genelevel a:link {color:#008080;}
#genelevel a:visited {color:#008080;}
#genelevel a:hover {color:#ffcc00;
Expand Down Expand Up @@ -200,6 +195,27 @@
.breadcrumb-arrow li span {
color: #434a54
}
.toolbargrid{
margin:10px;
display:grid;
grid-template-columns:400px 800px 400px;
}
.nodeshape {
margin:10px;
display:grid;
grid-template-columns:30px 300px 30px 300px;
}

.nodeshape-left{
height:30px;
width:30px;
}

.nodeshape-right{
font-size:16px;
padding: 7px 0 7px 10px;
}

</style>
<script>
var colorPicker = d3.scaleLinear().domain([0, 0.5, 1.0]).range(["blue", "white", "red"]);
Expand Down Expand Up @@ -283,11 +299,11 @@
'font-size': function(ele){
var eData=ele.data();
if(eData["is_exemplar"]==2){
return 50;
return 60;
} else if(eData["is_exemplar"]==1){
return 20;
return 40;
} else{
return 10;
return 20;
}
},
'color': function(ele){
Expand All @@ -303,7 +319,6 @@
'border-color':'gray',
'shape': function(ele){
var eData = ele.data();
/* for now, support up to 3 platforms */
if(eData["platform"] == 1){
return "ellipse";
} else if (eData["platform"] == 2){
Expand Down Expand Up @@ -421,6 +436,29 @@

$(".chzn-cy-export").chosen({disable_search_threshold: 5}).change(function(){
});

$(".chzn-label-select").chosen({disable_search_threshold: 5}).change(function(){
var selected_val = $(this).val();
if(selected_val == "hide1"){
cy.style().selector('node[is_exemplar=0]').style({
'font-size': 0
}).update();
} else if(selected_val == "hide12"){
cy.style().selector('node[is_exemplar=0], node[is_exemplar=1]').style({
'font-size': 0
}).update();
} else if(selected_val == "showall"){
cy.style().selector('node[is_exemplar=0]').style({
'font-size': 20
}).update();
cy.style().selector('node[is_exemplar=1]').style({
'font-size': 40
}).update();
cy.style().selector('node[is_exemplar=2]').style({
'font-size': 60
}).update();
}
});
});
</script>
</head>

0 comments on commit a96583d

Please sign in to comment.