diff options
author | zsloan | 2016-09-13 16:13:13 +0000 |
---|---|---|
committer | zsloan | 2016-09-13 16:13:13 +0000 |
commit | 909a1cca82d86f824c6778b59b2ee339a7ee8ffd (patch) | |
tree | aa0fa43e3d6aa66492d8d79a1696c638f8d97d27 | |
parent | 47afd15d6524a2071191952cd25796761353ad5e (diff) | |
download | genenetwork2-909a1cca82d86f824c6778b59b2ee339a7ee8ffd.tar.gz |
Fixed the path for the json file in gen_select_dataset.py since it was wrong and uncommented simplejson import
Added "Reset" option to network graph that returns all the nodes/edges
Made the visualization options area in the network graph a little wider
6 files changed, 128 insertions, 83 deletions
diff --git a/wqflask/maintenance/gen_select_dataset.py b/wqflask/maintenance/gen_select_dataset.py index 23adc4f9..542c0d83 100644 --- a/wqflask/maintenance/gen_select_dataset.py +++ b/wqflask/maintenance/gen_select_dataset.py @@ -49,7 +49,7 @@ from utility.tools import locate, locate_ignore_error, TEMPDIR, SQL_URI import MySQLdb -# import simplejson as json +import simplejson as json import urlparse @@ -289,7 +289,7 @@ def main(): #print("data:", data) - output_file = """./wqflask/wqflask/static/new/javascript/dataset_menu_structure.json""" + output_file = """./wqflask/static/new/javascript/dataset_menu_structure.json""" with open(output_file, 'w') as fh: json.dump(data, fh, indent=" ", sort_keys=True) diff --git a/wqflask/wqflask/network_graph/network_graph.py b/wqflask/wqflask/network_graph/network_graph.py index 1d725c4c..cebe5c03 100644 --- a/wqflask/wqflask/network_graph/network_graph.py +++ b/wqflask/wqflask/network_graph/network_graph.py @@ -167,9 +167,9 @@ class NetworkGraph(object): if abs(sample_r) > max_corr: max_corr = abs(sample_r) - edge_data = {'id' : this_trait.name + '_to_' + target_trait.name, - 'source' : this_trait.name + ":" + this_trait.dataset.name, - 'target' : target_trait.name + ":" + target_trait.dataset.name, + edge_data = {'id' : str(this_trait.name) + '_to_' + str(target_trait.name), + 'source' : str(this_trait.name) + ":" + str(this_trait.dataset.name), + 'target' : str(target_trait.name) + ":" + str(target_trait.dataset.name), 'correlation' : round(sample_r, 3), 'abs_corr' : abs(round(sample_r, 3)), 'p_value' : round(sample_p, 3), @@ -181,8 +181,9 @@ class NetworkGraph(object): self.edges_list.append(edge_dict) - node_dict = { 'data' : {'id' : this_trait.name + ":" + this_trait.dataset.name, + node_dict = { 'data' : {'id' : str(this_trait.name) + ":" + str(this_trait.dataset.name), 'label' : this_trait.name, + 'symbol' : this_trait.symbol, 'geneid' : this_trait.geneid, 'omim' : this_trait.omim, 'max_corr' : max_corr } } diff --git a/wqflask/wqflask/static/new/css/network_graph.css b/wqflask/wqflask/static/new/css/network_graph.css index c01c0d24..1cba546a 100644 --- a/wqflask/wqflask/static/new/css/network_graph.css +++ b/wqflask/wqflask/static/new/css/network_graph.css @@ -13,7 +13,7 @@ #secondaryContent { position: relative; float: left; - width: 16.5em; + width: 18.5em; padding: 1em 1em 1em 1em; background: #fff url('/static/new/images/a1.gif') top right repeat-y; } diff --git a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json index 750a9118..d3db1853 100644 --- a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json +++ b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json @@ -317,6 +317,30 @@ ] }, "GTEx": { + "Adipose tissue, subcutaneous mRNA": [ + [ + "580", + "GTEx_log2_Subcu_0314", + "GTEx Human Subcutaneous (Mar14) RPKM Log2" + ], + [ + "530", + "GTEx_Subcu_0414", + "GTEx Human Subcutaneous (Apr14) RPKM" + ] + ], + "Adipose tissue, visceral mRNA": [ + [ + "587", + "GTEx_log2_Visce_0314", + "GTEx Human Visceral (Mar14) RPKM Log2" + ], + [ + "537", + "GTEx_Visce_0414", + "GTEx Human Visceral (Apr14) RPKM" + ] + ], "Adrenal Gland mRNA": [ [ "545", @@ -773,18 +797,6 @@ "GTEx Human Stomach (Apr14) RPKM" ] ], - "Subcutaneous mRNA": [ - [ - "580", - "GTEx_log2_Subcu_0314", - "GTEx Human Subcutaneous (Mar14) RPKM Log2" - ], - [ - "530", - "GTEx_Subcu_0414", - "GTEx Human Subcutaneous (Apr14) RPKM" - ] - ], "Substantia Nigra mRNA": [ [ "581", @@ -857,18 +869,6 @@ "GTEx Human Vagina (Apr14) RPKM" ] ], - "Visceral mRNA": [ - [ - "587", - "GTEx_log2_Visce_0314", - "GTEx Human Visceral (Mar14) RPKM Log2" - ], - [ - "537", - "GTEx_Visce_0414", - "GTEx Human Visceral (Apr14) RPKM" - ] - ], "Whole Blood mRNA": [ [ "588", @@ -883,6 +883,20 @@ ] }, "GTEx_v5": { + "Adipose tissue, subcutaneous mRNA": [ + [ + "718", + "GTEXv5_AdipSub_0915", + "GTEXv5 Human Adipose Subcutaneous RefSeq (Sep15) RPKM log2" + ] + ], + "Adipose tissue, visceral mRNA": [ + [ + "719", + "GTEXv5_AdiVis_0915", + "GTEXv5 Human Adipose Visceral Omentum RefSeq (Sep15) RPKM log2" + ] + ], "Adrenal Gland mRNA": [ [ "720", @@ -1191,13 +1205,6 @@ "GTEXv5 Human Stomach RefSeq (Sep15) RPKM log2" ] ], - "Subcutaneous mRNA": [ - [ - "718", - "GTEXv5_AdipSub_0915", - "GTEXv5 Human Adipose Subcutaneous RefSeq (Sep15) RPKM log2" - ] - ], "Substantia Nigra mRNA": [ [ "737", @@ -1240,13 +1247,6 @@ "GTEXv5 Human Vagina RefSeq (Sep15) RPKM log2" ] ], - "Visceral mRNA": [ - [ - "719", - "GTEXv5_AdiVis_0915", - "GTEXv5 Human Adipose Visceral Omentum RefSeq (Sep15) RPKM log2" - ] - ], "Whole Blood mRNA": [ [ "770", @@ -1609,9 +1609,30 @@ ] ] }, + "B6D2": { + "Phenotypes": [ + [ + "None", + "B6D2Publish", + "B6D2 Published Phenotypes" + ] + ], + "Retina mRNA": [ + [ + "803", + "UTHSC_mm9_B6D2_Ret_0916", + "UTHSC B6D2 Retina Affy MoGene 1.0ST (Sep16) Gene Level RMA" + ] + ] + }, "B6D2F2": { "Brain mRNA": [ [ + "78", + "BRF2_M_0805_P", + "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) PDNN" + ], + [ "77", "BRF2_M_0805_R", "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) RMA" @@ -1622,11 +1643,6 @@ "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) MAS5" ], [ - "78", - "BRF2_M_0805_P", - "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) PDNN" - ], - [ "33", "BRF2_M_0304_P", "OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) PDNN" @@ -2306,16 +2322,16 @@ ], "Kidney mRNA": [ [ - "239", - "MA_M2F_0706_R", - "Mouse kidney M430v2 Female (Aug06) RMA" - ], - [ "240", "MA_M2M_0706_R", "Mouse kidney M430v2 Male (Aug06) RMA" ], [ + "239", + "MA_M2F_0706_R", + "Mouse kidney M430v2 Female (Aug06) RMA" + ], + [ "118", "MA_M2_0806_R", "Mouse kidney M430v2 Sex Balanced (Aug06) RMA" @@ -2495,16 +2511,16 @@ ], "Neocortex mRNA": [ [ - "375", - "DevNeocortex_ILM6.2P14RInv_1111", - "BIDMC/UTHSC Dev Neocortex P14 ILMv6.2 (Nov11) RankInv" - ], - [ "374", "DevNeocortex_ILM6.2P3RInv_1111", "BIDMC/UTHSC Dev Neocortex P3 ILMv6.2 (Nov11) RankInv" ], [ + "375", + "DevNeocortex_ILM6.2P14RInv_1111", + "BIDMC/UTHSC Dev Neocortex P14 ILMv6.2 (Nov11) RankInv" + ], + [ "284", "HQFNeoc_1210v2_RankInv", "HQF BXD Neocortex ILM6v1.1 (Dec10v2) RankInv" @@ -3017,6 +3033,11 @@ ], "Hippocampus mRNA": [ [ + "214", + "Illum_LXS_Hipp_NOE_1008", + "Hippocampus Illumina NOE (Oct08) RankInv beta" + ], + [ "211", "Illum_LXS_Hipp_RSS_1008", "Hippocampus Illumina RSS (Oct08) RankInv beta" @@ -3037,11 +3058,6 @@ "Hippocampus Illumina RSE (Oct08) RankInv beta" ], [ - "214", - "Illum_LXS_Hipp_NOE_1008", - "Hippocampus Illumina NOE (Oct08) RankInv beta" - ], - [ "143", "Illum_LXS_Hipp_loess0807", "Hippocampus Illumina (Aug07) LOESS" @@ -3472,6 +3488,10 @@ "B6BTBRF2" ], [ + "B6D2", + "Glaucoma and Aged Retina, UTHSC" + ], + [ "B6D2F2", "B6D2F2" ], @@ -3793,6 +3813,14 @@ ], "GTEx": [ [ + "Adipose tissue, subcutaneous mRNA", + "Adipose tissue, subcutaneous mRNA" + ], + [ + "Adipose tissue, visceral mRNA", + "Adipose tissue, visceral mRNA" + ], + [ "Adrenal Gland mRNA", "Adrenal Gland mRNA" ], @@ -3945,10 +3973,6 @@ "Stomach mRNA" ], [ - "Subcutaneous mRNA", - "Subcutaneous mRNA" - ], - [ "Substantia Nigra mRNA", "Substantia Nigra mRNA" ], @@ -3973,16 +3997,20 @@ "Vagina mRNA" ], [ - "Visceral mRNA", - "Visceral mRNA" - ], - [ "Whole Blood mRNA", "Whole Blood mRNA" ] ], "GTEx_v5": [ [ + "Adipose tissue, subcutaneous mRNA", + "Adipose tissue, subcutaneous mRNA" + ], + [ + "Adipose tissue, visceral mRNA", + "Adipose tissue, visceral mRNA" + ], + [ "Adrenal Gland mRNA", "Adrenal Gland mRNA" ], @@ -4159,10 +4187,6 @@ "Stomach mRNA" ], [ - "Subcutaneous mRNA", - "Subcutaneous mRNA" - ], - [ "Substantia Nigra mRNA", "Substantia Nigra mRNA" ], @@ -4187,10 +4211,6 @@ "Vagina mRNA" ], [ - "Visceral mRNA", - "Visceral mRNA" - ], - [ "Whole Blood mRNA", "Whole Blood mRNA" ] @@ -4363,6 +4383,16 @@ "Liver mRNA" ] ], + "B6D2": [ + [ + "Phenotypes", + "Phenotypes" + ], + [ + "Retina mRNA", + "Retina mRNA" + ] + ], "B6D2F2": [ [ "Genotypes", diff --git a/wqflask/wqflask/static/new/javascript/network_graph.js b/wqflask/wqflask/static/new/javascript/network_graph.js index da90ae26..e8ca6be0 100644 --- a/wqflask/wqflask/static/new/javascript/network_graph.js +++ b/wqflask/wqflask/static/new/javascript/network_graph.js @@ -12,7 +12,7 @@ window.onload=function() { selector: 'node', style: { 'background-color': '#666', - 'label': 'data(id)', + 'label': 'data(symbol)', 'font-size': 10 } }, @@ -154,6 +154,15 @@ window.onload=function() { }); + $('#reset_graph').click(function() { + eles.restore() + $('#slide').val(0) + cy.layout({ name: $('select[name=layout_select]').val(), + fit: true, // whether to fit the viewport to the graph + padding: 25 // the padding on fit + }); + }); + $('select[name=focus_select]').change(function() { focus_trait = $(this).val() diff --git a/wqflask/wqflask/templates/network_graph.html b/wqflask/wqflask/templates/network_graph.html index ec3a7971..57426af7 100644 --- a/wqflask/wqflask/templates/network_graph.html +++ b/wqflask/wqflask/templates/network_graph.html @@ -22,6 +22,11 @@ <tbody> <tr> <td> + <button id="reset_graph">Reset Graph</button> + </td> + </tr> + <tr> + <td> Focus Trait </td> </tr> @@ -29,7 +34,7 @@ <td> <select name="focus_select"> {% for trait in traits %} - <option value="{{ trait.name }}:{{ trait.dataset.name }}">{{ trait.name }}</option> + <option value="{{ trait.name }}:{{ trait.dataset.name }}">{{ trait.symbol }} ({{ trait.name }})</option> {% endfor %} </select> </td> |