From 5f5adb62bf13ace887c03522b0b8e83181cd6503 Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 23 Jul 2019 11:24:56 -0500 Subject: Added change to automatically update datasets list using rest api instead of json file Removed option to edit certain html pages, like news, policies, etc --- wqflask/base/data_set.py | 4 +- wqflask/utility/tools.py | 4 ++ .../marker_regression/display_mapping_results.py | 1 - wqflask/wqflask/marker_regression/run_mapping.py | 17 +++++++- .../new/javascript/dataset_menu_structure.json | 51 ++++++++++++---------- wqflask/wqflask/templates/docs.html | 4 +- 6 files changed, 52 insertions(+), 29 deletions(-) (limited to 'wqflask') diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index d766e284..41de8492 100644 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -46,6 +46,8 @@ from utility import chunks from utility import gen_geno_ob from utility.tools import locate, locate_ignore_error, flat_files +from wqflask.api import gen_menu + from maintenance import get_group_samplelists from MySQLdb import escape_string as escape @@ -92,7 +94,7 @@ Publish or ProbeSet. E.g. """ self.datasets = {} if USE_GN_SERVER: - data = menu_main() + data = gen_menu.gen_dropdown_json() else: file_name = "wqflask/static/new/javascript/dataset_menu_structure.json" with open(file_name, 'r') as fh: diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py index 8b2260f5..31ab2046 100644 --- a/wqflask/utility/tools.py +++ b/wqflask/utility/tools.py @@ -107,6 +107,9 @@ def js_path(module=None): return try_guix raise "No JS path found for "+module+" (if not in Guix check JS_GN_PATH)" +def reaper_command(guess=None): + return get_setting("REAPER_COMMAND",guess) + def gemma_command(guess=None): return assert_bin(get_setting("GEMMA_COMMAND",guess)) @@ -274,6 +277,7 @@ SMTP_CONNECT = get_setting('SMTP_CONNECT') SMTP_USERNAME = get_setting('SMTP_USERNAME') SMTP_PASSWORD = get_setting('SMTP_PASSWORD') +REAPER_COMMAND = app_set("REAPER_COMMAND",reaper_command()) GEMMA_COMMAND = app_set("GEMMA_COMMAND",gemma_command()) assert(GEMMA_COMMAND is not None) PLINK_COMMAND = app_set("PLINK_COMMAND",plink_command()) diff --git a/wqflask/wqflask/marker_regression/display_mapping_results.py b/wqflask/wqflask/marker_regression/display_mapping_results.py index 3bcd613f..d9601405 100644 --- a/wqflask/wqflask/marker_regression/display_mapping_results.py +++ b/wqflask/wqflask/marker_regression/display_mapping_results.py @@ -1790,7 +1790,6 @@ class DisplayMappingResults(object): m = 0 thisLRSColor = self.colorCollection[0] if qtlresult['chr'] != previous_chr and self.selectedChr == -1: - if self.manhattan_plot != True: canvas.drawPolygon(LRSCoordXY,edgeColor=thisLRSColor,closed=0, edgeWidth=lrsEdgeWidth, clipX=(xLeftOffset, xLeftOffset + plotWidth)) diff --git a/wqflask/wqflask/marker_regression/run_mapping.py b/wqflask/wqflask/marker_regression/run_mapping.py index 2bde2b53..6e9fe85c 100644 --- a/wqflask/wqflask/marker_regression/run_mapping.py +++ b/wqflask/wqflask/marker_regression/run_mapping.py @@ -36,7 +36,7 @@ from utility import helper_functions from utility import Plot, Bunch from utility import temp_data from utility.benchmark import Bench -from wqflask.marker_regression import gemma_mapping, rqtl_mapping, qtlreaper_mapping, plink_mapping +from wqflask.marker_regression import gemma_mapping, rqtl_mapping, qtlreaper_mapping, plink_mapping, rust_reaper_mapping from utility.tools import locate, locate_ignore_error, GEMMA_COMMAND, PLINK_COMMAND, TEMPDIR from utility.external import shell @@ -242,7 +242,8 @@ class RunMapping(object): self.control_marker = start_vars['control_marker'] self.do_control = start_vars['do_control'] logger.info("Running qtlreaper") - results, self.json_data, self.perm_output, self.suggestive, self.significant, self.bootstrap_results = qtlreaper_mapping.gen_reaper_results(self.this_trait, + + results, self.perm_output, self.suggestive, self.significant, self.bootstrap_results = rust_reaper_mapping.run_reaper(self.this_trait, self.dataset, self.samples, self.vals, @@ -253,6 +254,18 @@ class RunMapping(object): self.do_control, self.control_marker, self.manhattan_plot) + + # results, self.json_data, self.perm_output, self.suggestive, self.significant, self.bootstrap_results = qtlreaper_mapping.gen_reaper_results(self.this_trait, + # self.dataset, + # self.samples, + # self.vals, + # self.json_data, + # self.num_perm, + # self.bootCheck, + # self.num_bootstrap, + # self.do_control, + # self.control_marker, + # self.manhattan_plot) elif self.mapping_method == "plink": self.score_type = "-log(p)" self.manhattan_plot = True diff --git a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json index 0d73213d..6531f5a0 100644 --- a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json +++ b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json @@ -1440,7 +1440,7 @@ [ "None", "HSBPublish", - "HSB Phenotypes" + "HSB Published Phenotypes" ] ], "Posterior Inferior Parietal Cortex mRNA": [ @@ -1721,7 +1721,7 @@ [ "None", "B6D2Publish", - "B6D2 Phenotypes" + "UTHSC-Glaucoma-Aged-Retina Phenotypes" ] ] }, @@ -2247,6 +2247,11 @@ "Eye_M2_0908_R_ND", "Eye M430v2 WT Gpnmb (Sep08) RMA" ], + [ + "382", + "Eye_M2_0908_WTWT", + "Eye M430v2 WT WT (Sep08) RMA" + ], [ "279", "Eye_M2_0908_R_WT", @@ -2257,11 +2262,6 @@ "Eye_M2_0908_R_MT", "Eye M430v2 Mutant Tyrp1 (Sep08) RMA" ], - [ - "382", - "Eye_M2_0908_WTWT", - "Eye M430v2 WT WT (Sep08) RMA" - ], [ "400", "DBA2J-ONH-1212", @@ -2500,6 +2500,11 @@ "245", "UT_ILM_BXD_hipp_RSE_0909", "UTHSC Hippocampus Illumina v6.1 RSE (Sep09) RankInv" + ], + [ + "711", + "UTHSC_BXD_AgeHipp0515", + "UTHSC BXD Aged Hippocampus Affy MoGene1.0 ST (May15) RMA Gene Level" ] ], "Hypothalamus mRNA": [ @@ -3028,16 +3033,6 @@ ] ], "Striatum mRNA": [ - [ - "376", - "DevStriatum_ILM6.2P3RInv_1111", - "BIDMC/UTHSC Dev Striatum P3 ILMv6.2 (Nov11) RankInv" - ], - [ - "377", - "DevStriatum_ILM6.2P14RInv_1111", - "BIDMC/UTHSC Dev Striatum P14 ILMv6.2 (Nov11) RankInv" - ], [ "399", "Striatum_Exon_1212", @@ -3048,6 +3043,16 @@ "Striatum_Exon_0209", "HQF Striatum Affy Mouse Exon 1.0ST Exon Level (Dec09) RMA" ], + [ + "376", + "DevStriatum_ILM6.2P3RInv_1111", + "BIDMC/UTHSC Dev Striatum P3 ILMv6.2 (Nov11) RankInv" + ], + [ + "377", + "DevStriatum_ILM6.2P14RInv_1111", + "BIDMC/UTHSC Dev Striatum P14 ILMv6.2 (Nov11) RankInv" + ], [ "285", "UTHSC_Striatum_RankInv_1210", @@ -3554,6 +3559,11 @@ ] ], "Hippocampus mRNA": [ + [ + "211", + "Illum_LXS_Hipp_RSS_1008", + "Hippocampus Illumina RSS (Oct08) RankInv beta" + ], [ "213", "Illum_LXS_Hipp_NOS_1008", @@ -3574,11 +3584,6 @@ "Illum_LXS_Hipp_NOE_1008", "Hippocampus Illumina NOE (Oct08) RankInv beta" ], - [ - "211", - "Illum_LXS_Hipp_RSS_1008", - "Hippocampus Illumina RSS (Oct08) RankInv beta" - ], [ "143", "Illum_LXS_Hipp_loess0807", @@ -3835,7 +3840,7 @@ [ "None", "HSNIH-RGSMCPublish", - "HSNIH-RGSMC Phenotypes" + "HSNIH Published Phenotypes" ] ] }, diff --git a/wqflask/wqflask/templates/docs.html b/wqflask/wqflask/templates/docs.html index c485f757..1a241ce7 100644 --- a/wqflask/wqflask/templates/docs.html +++ b/wqflask/wqflask/templates/docs.html @@ -6,9 +6,9 @@

{{title}}

- + - +
{{content|safe}}
-- cgit v1.2.3