From e63c4014e7bc34b440707be19af3779b72102fdb Mon Sep 17 00:00:00 2001 From: zsloan Date: Thu, 26 Jan 2017 16:26:16 +0000 Subject: GEMMA now works with CFW data (had to update where it looks for the input files and how it writes the phenotype file) Y-axis for GEMMA now says -log(p) Updated the style of the trait sample data table in the trait page Updated dataset_select_menu_orig.js to also build just the Species and Group drop-downs for the trait input page (as opposed to all 4 drop-downs) Updated dataset menu json file Added option to show and hide columns to regular search page using colVis Changed regular and global search result table styles/column widths Began work on user trait submission code (not working yet though) Began work on static loading page for mapping results --- wqflask/base/data_set.py | 22 ++- wqflask/base/trait.py | 12 +- wqflask/utility/tools.py | 1 + wqflask/wqflask/marker_regression/gemma_mapping.py | 51 +++-- .../wqflask/marker_regression/marker_regression.py | 37 +--- .../marker_regression/marker_regression_gn1.py | 5 +- wqflask/wqflask/show_trait/show_trait.py | 7 +- wqflask/wqflask/static/new/css/main.css | 7 + .../new/javascript/dataset_menu_structure.json | 207 ++++++++++++++------- .../static/new/javascript/dataset_select_menu.js | 12 +- .../new/javascript/dataset_select_menu_orig.js | 15 +- .../packages/DataTables/css/jquery.dataTables.css | 2 +- .../DataTables/extensions/buttons.colVis.min.js | 5 + .../extensions/dataTables.buttons.min.js | 35 ++++ .../extensions/scroller.dataTables.min.css | 1 + wqflask/wqflask/submit_trait.py | 24 +++ wqflask/wqflask/templates/gsearch_gene.html | 90 +++++---- wqflask/wqflask/templates/loading.html | 14 ++ wqflask/wqflask/templates/search_result_page.html | 75 +++++--- .../wqflask/templates/show_trait_edit_data.html | 2 + .../templates/show_trait_mapping_tools.html | 27 ++- wqflask/wqflask/templates/submit_trait.html | 101 ++++++++++ wqflask/wqflask/views.py | 57 ++++++ 23 files changed, 594 insertions(+), 215 deletions(-) create mode 100644 wqflask/wqflask/static/new/packages/DataTables/extensions/buttons.colVis.min.js create mode 100644 wqflask/wqflask/static/new/packages/DataTables/extensions/dataTables.buttons.min.js create mode 100644 wqflask/wqflask/static/new/packages/DataTables/extensions/scroller.dataTables.min.css create mode 100644 wqflask/wqflask/submit_trait.py create mode 100644 wqflask/wqflask/templates/loading.html create mode 100644 wqflask/wqflask/templates/submit_trait.html diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 06e02b02..94b38e13 100644 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -44,7 +44,7 @@ from db import webqtlDatabaseFunction from utility import webqtlUtil from utility.benchmark import Bench from utility import chunks -from utility.tools import locate, locate_ignore_error +from utility.tools import locate, locate_ignore_error, flat_files from maintenance import get_group_samplelists @@ -53,7 +53,7 @@ from pprint import pformat as pf from db.gn_server import menu_main from db.call import fetchall,fetchone,fetch1 -from utility.tools import USE_GN_SERVER, USE_REDIS +from utility.tools import USE_GN_SERVER, USE_REDIS, flat_files, flat_file_exists from utility.logger import getLogger logger = getLogger(__name__ ) @@ -226,7 +226,7 @@ class Markers(object): class HumanMarkers(Markers): def __init__(self, name, specified_markers = []): - marker_data_fh = open(locate('genotype') + '/' + name + '.bim') + marker_data_fh = open(flat_files('mapping') + '/' + name + '.bim') self.markers = [] for line in marker_data_fh: splat = line.strip().split() @@ -299,11 +299,21 @@ class DatasetGroup(object): self.markers = HumanMarkers(self.name, markers) def get_markers(self): - #logger.debug("self.species is:", self.species) - if self.species == "human": + logger.debug("self.species is:", self.species) + + def check_plink_gemma(): + if flat_file_exists("mapping"): + MAPPING_PATH = flat_files("mapping")+"/" + if (os.path.isfile(MAPPING_PATH+self.name+".bed") and + (os.path.isfile(MAPPING_PATH+self.name+".map") or + os.path.isfile(MAPPING_PATH+self.name+".bim"))): + return True + return False + + if check_plink_gemma(): marker_class = HumanMarkers else: - marker_class = Markers + marker_class = Markers self.markers = marker_class(self.name) diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index eb5b91c3..bf87e879 100644 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -207,7 +207,7 @@ class GeneralTrait(object): formatted = self.post_publication_description else: formatted = "Not available" - return formatted.capitalize() + return formatted @property def alias_fmt(self): @@ -379,7 +379,7 @@ def jsonable_table_row(trait, dataset_name, index): additive = "N/A" else: additive = "%.3f" % round(float(trait.additive), 2) - return ['', + return ['', index, ''+str(trait.name)+'', trait.symbol, @@ -395,7 +395,7 @@ def jsonable_table_row(trait, dataset_name, index): else: additive = "%.2f" % round(float(trait.additive), 2) if trait.pubmed_id: - return ['', + return ['', index, ''+str(trait.name)+'', trait.description_display, @@ -405,7 +405,7 @@ def jsonable_table_row(trait, dataset_name, index): trait.LRS_location_repr, additive] else: - return ['', + return ['', index, ''+str(trait.name)+'', trait.description_display, @@ -415,7 +415,7 @@ def jsonable_table_row(trait, dataset_name, index): trait.LRS_location_repr, additive] elif dataset.type == "Geno": - return ['', + return ['', index, ''+str(trait.name)+'', trait.location_repr] @@ -499,7 +499,7 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False): for i, field in enumerate(dataset.display_fields): holder = trait_info[i] if isinstance(trait_info[i], basestring): - holder = unicode(trait_info[i], "utf8", "ignore") + holder = unicode(trait_info[i], "utf-8", "ignore") setattr(trait, field, holder) if dataset.type == 'Publish': diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py index df032e48..8db9ac6e 100644 --- a/wqflask/utility/tools.py +++ b/wqflask/utility/tools.py @@ -215,6 +215,7 @@ GENENETWORK_FILES = get_setting('GENENETWORK_FILES') PYLMM_COMMAND = pylmm_command() GEMMA_COMMAND = gemma_command() +GEMMA_RESULTS_PATH = get_setting('GEMMA_RESULTS_PATH') PLINK_COMMAND = plink_command() TEMPDIR = tempdir() # defaults to UNIX TMPDIR diff --git a/wqflask/wqflask/marker_regression/gemma_mapping.py b/wqflask/wqflask/marker_regression/gemma_mapping.py index a56362ec..66bed5a2 100644 --- a/wqflask/wqflask/marker_regression/gemma_mapping.py +++ b/wqflask/wqflask/marker_regression/gemma_mapping.py @@ -1,7 +1,7 @@ -import os +import os, math from base import webqtlConfig -from utility.tools import GEMMA_COMMAND +from utility.tools import flat_files, GEMMA_COMMAND, GEMMA_RESULTS_PATH def run_gemma(this_dataset, samples, vals): """Generates p-values for each marker using GEMMA""" @@ -10,41 +10,62 @@ def run_gemma(this_dataset, samples, vals): gen_pheno_txt_file(this_dataset, samples, vals) - # Don't do this! - # os.chdir("{}gemma".format(webqtlConfig.GENODIR)) - # use GEMMA_RUN in the next one, create a unique temp file - gemma_command = GEMMA_COMMAND + ' -bfile %s/%s -k %s/output/%s.cXX.txt -lmm 1 -o %s_output' % (GEMMA_PATH, + gemma_command = GEMMA_COMMAND + ' -bfile %s/%s -k %s/%s.sXX.txt -lmm 1 -outdir %s/output -o %s_output' % (flat_files('mapping'), this_dataset.group.name, - GEMMA_PATH, + flat_files('mapping'), this_dataset.group.name, + GEMMA_RESULTS_PATH, this_dataset.group.name) print("gemma_command:" + gemma_command) os.system(gemma_command) - included_markers, p_values = parse_gemma_output(this_dataset) + marker_obs = parse_gemma_output(this_dataset) - return included_markers, p_values + return marker_obs def gen_pheno_txt_file(this_dataset, samples, vals): """Generates phenotype file for GEMMA""" - with open("{}/{}.fam".format(GEMMA_PATH, this_dataset.group.name), "w") as outfile: - for i, sample in enumerate(samples): - outfile.write(str(sample) + " " + str(sample) + " 0 0 0 " + str(vals[i]) + "\n") + current_file_data = [] + with open("{}/{}.fam".format(flat_files('mapping'), this_dataset.group.name), "r") as outfile: + for i, line in enumerate(outfile): + split_line = line.split() + current_file_data.append(split_line) + + with open("{}/{}.fam".format(flat_files('mapping'), this_dataset.group.name), "w") as outfile: + for i, line in enumerate(current_file_data): + if vals[i] == "x": + this_val = -9 + else: + this_val = vals[i] + outfile.write(line[0] + " " + line[1] + " " + line[2] + " " + line[3] + " " + line[4] + " " + str(this_val) + "\n") def parse_gemma_output(this_dataset): included_markers = [] p_values = [] - with open("{}/output/{}_output.assoc.txt".format(GEMMA_PATH, this_dataset.group.name)) as output_file: + marker_obs = [] + with open("{}/output/{}_output.assoc.txt".format(GEMMA_RESULTS_PATH, this_dataset.group.name)) as output_file: for line in output_file: if line.startswith("chr"): continue else: + marker = {} + marker['name'] = line.split("\t")[1] + marker['chr'] = int(line.split("\t")[0]) + marker['Mb'] = float(line.split("\t")[2]) / 1000000 + marker['p_value'] = float(line.split("\t")[10]) + if math.isnan(marker['p_value']) or (marker['p_value'] <= 0): + marker['lod_score'] = 0 + #marker['lrs_value'] = 0 + else: + marker['lod_score'] = -math.log10(marker['p_value']) + #marker['lrs_value'] = -math.log10(marker['p_value']) * 4.61 + marker_obs.append(marker) + included_markers.append(line.split("\t")[1]) p_values.append(float(line.split("\t")[10])) - #print("p_values: ", p_values) - return included_markers, p_values + return marker_obs diff --git a/wqflask/wqflask/marker_regression/marker_regression.py b/wqflask/wqflask/marker_regression/marker_regression.py index d9dbd0da..b1d2f811 100644 --- a/wqflask/wqflask/marker_regression/marker_regression.py +++ b/wqflask/wqflask/marker_regression/marker_regression.py @@ -37,7 +37,7 @@ from utility import temp_data from utility.benchmark import Bench from wqflask.marker_regression import gemma_mapping, rqtl_mapping, qtlreaper_mapping, plink_mapping -from utility.tools import locate, locate_ignore_error, PYLMM_COMMAND, GEMMA_COMMAND, PLINK_COMMAND, TEMPDIR +from utility.tools import locate, locate_ignore_error, PYLMM_COMMAND, GEMMA_COMMAND, GEMMA_RESULTS_PATH, PLINK_COMMAND, TEMPDIR from utility.external import shell from base.webqtlConfig import TMPDIR, GENERATED_TEXT_DIR @@ -140,7 +140,6 @@ class MarkerRegression(object): except: self.num_perm = 0 - self.LRSCheck = self.score_type if self.num_perm > 0: self.permCheck = "ON" else: @@ -151,12 +150,10 @@ class MarkerRegression(object): self.dataset.group.get_markers() if self.mapping_method == "gemma": - self.score_type = "LOD" + self.score_type = "-log(p)" self.manhattan_plot = True with Bench("Running GEMMA"): - included_markers, p_values = gemma_mapping.run_gemma(self.dataset, self.samples, self.vals) - with Bench("Getting markers from csv"): - marker_obs = get_markers_from_csv(included_markers, p_values, self.dataset.group.name) + marker_obs = gemma_mapping.run_gemma(self.dataset, self.samples, self.vals) results = marker_obs elif self.mapping_method == "rqtl_plink": results = self.run_rqtl_plink() @@ -511,8 +508,7 @@ class MarkerRegression(object): logger.debug("Before creating the command") - command = PYLMM_COMMAND+' --key {} --species {}'.format(key, - "human") + command = PYLMM_COMMAND+' --key {} --species {}'.format(key, "human") logger.debug("command is:", command) @@ -610,30 +606,5 @@ def trim_markers_for_table(markers): return sorted_markers -def get_markers_from_csv(included_markers, p_values, group_name): - marker_data_fh = open(os.path.join(webqtlConfig.PYLMM_PATH + group_name + '_markers.csv')) - markers = [] - for marker_name, p_value in itertools.izip(included_markers, p_values): - if not p_value or len(included_markers) < 1: - continue - for line in marker_data_fh: - splat = line.strip().split() - if splat[0] == marker_name: - marker = {} - marker['name'] = splat[0] - marker['chr'] = int(splat[1]) - marker['Mb'] = float(splat[2]) - marker['p_value'] = p_value - if math.isnan(marker['p_value']) or (marker['p_value'] <= 0): - marker['lod_score'] = 0 - marker['lrs_value'] = 0 - else: - marker['lod_score'] = -math.log10(marker['p_value']) - marker['lrs_value'] = -math.log10(marker['p_value']) * 4.61 - markers.append(marker) - break - - return markers - if __name__ == '__main__': import cPickle as pickle diff --git a/wqflask/wqflask/marker_regression/marker_regression_gn1.py b/wqflask/wqflask/marker_regression/marker_regression_gn1.py index bc147f75..9ff431a2 100644 --- a/wqflask/wqflask/marker_regression/marker_regression_gn1.py +++ b/wqflask/wqflask/marker_regression/marker_regression_gn1.py @@ -292,7 +292,10 @@ class MarkerRegression(object): self.graphHeight = self.GRAPH_DEFAULT_HEIGHT self.dominanceChecked = False - self.LRS_LOD = start_vars['LRSCheck'] + if 'LRSCheck' in start_vars.keys(): + self.LRS_LOD = start_vars['LRSCheck'] + else: + self.LRS_LOD = start_vars['score_type'] self.cutoff = start_vars['cutoff'] self.intervalAnalystChecked = True self.draw2X = False diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py index 091db50f..13ae933f 100644 --- a/wqflask/wqflask/show_trait/show_trait.py +++ b/wqflask/wqflask/show_trait/show_trait.py @@ -167,7 +167,8 @@ class ShowTrait(object): if flat_file_exists("mapping"): MAPPING_PATH = flat_files("mapping")+"/" if (os.path.isfile(MAPPING_PATH+self.dataset.group.name+".bed") and - os.path.isfile(MAPPING_PATH+self.dataset.group.name+".map")): + (os.path.isfile(MAPPING_PATH+self.dataset.group.name+".map") or + os.path.isfile(MAPPING_PATH+self.dataset.group.name+".bim"))): return True return False @@ -729,7 +730,7 @@ class ShowTrait(object): def make_sample_lists(self, this_trait): all_samples_ordered = self.dataset.group.all_samples_ordered() - + primary_sample_names = list(all_samples_ordered) other_sample_names = [] @@ -813,7 +814,7 @@ def get_genofiles(this_trait): return jsondata['genofile'] def get_trait_table_width(sample_groups): - table_width = 35 + table_width = 30 if sample_groups[0].se_exists(): table_width += 10 if (table_width + len(sample_groups[0].attributes)*10) > 100: diff --git a/wqflask/wqflask/static/new/css/main.css b/wqflask/wqflask/static/new/css/main.css index 017bbdb8..880395a7 100644 --- a/wqflask/wqflask/static/new/css/main.css +++ b/wqflask/wqflask/static/new/css/main.css @@ -2,3 +2,10 @@ padding-left: 30px; padding-right: 30px; } + +ol { + font-family: Arial; + font-weight: bold; + font-size: 16px; + color: #000082 +} \ No newline at end of file diff --git a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json index 2f332a4a..06586372 100644 --- a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json +++ b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json @@ -1339,15 +1339,15 @@ "HLC_0311", "GSE9588 Human Liver Normal (Mar11) Both Sexes" ], - [ - "384", - "HLCF_0311", - "GSE9588 Human Liver Normal (Mar11) Females" - ], [ "383", "HLCM_0311", "GSE9588 Human Liver Normal (Mar11) Males" + ], + [ + "384", + "HLCF_0311", + "GSE9588 Human Liver Normal (Mar11) Females" ] ], "Phenotypes": [ @@ -1620,11 +1620,6 @@ }, "B6D2F2": { "Brain mRNA": [ - [ - "77", - "BRF2_M_0805_R", - "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) RMA" - ], [ "76", "BRF2_M_0805_M", @@ -1635,6 +1630,11 @@ "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" + ], [ "33", "BRF2_M_0304_P", @@ -1726,11 +1726,6 @@ ] ], "Striatum mRNA": [ - [ - "85", - "SA_M2_0905_P", - "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) PDNN" - ], [ "84", "SA_M2_0905_R", @@ -1740,21 +1735,26 @@ "83", "SA_M2_0905_M", "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) MAS5" + ], + [ + "85", + "SA_M2_0905_P", + "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) PDNN" ] ] }, "BHF2": { "Adipose mRNA": [ - [ - "197", - "UCLA_BHF2_ADIPOSE_FEMALE", - "UCLA BHF2 Adipose Female mlratio" - ], [ "196", "UCLA_BHF2_ADIPOSE_MALE", "UCLA BHF2 Adipose Male mlratio" ], + [ + "197", + "UCLA_BHF2_ADIPOSE_FEMALE", + "UCLA BHF2 Adipose Female mlratio" + ], [ "165", "UCLA_BHF2_ADIPOSE_0605", @@ -1762,16 +1762,16 @@ ] ], "Brain mRNA": [ - [ - "199", - "UCLA_BHF2_BRAIN_FEMALE", - "UCLA BHF2 Brain Female mlratio" - ], [ "198", "UCLA_BHF2_BRAIN_MALE", "UCLA BHF2 Brain Male mlratio" ], + [ + "199", + "UCLA_BHF2_BRAIN_FEMALE", + "UCLA BHF2 Brain Female mlratio" + ], [ "166", "UCLA_BHF2_BRAIN_0605", @@ -1786,16 +1786,16 @@ ] ], "Liver mRNA": [ - [ - "201", - "UCLA_BHF2_LIVER_FEMALE", - "UCLA BHF2 Liver Female mlratio" - ], [ "200", "UCLA_BHF2_LIVER_MALE", "UCLA BHF2 Liver Male mlratio" ], + [ + "201", + "UCLA_BHF2_LIVER_FEMALE", + "UCLA BHF2 Liver Female mlratio" + ], [ "167", "UCLA_BHF2_LIVER_0605", @@ -1999,11 +1999,6 @@ "BR_U_1105_P", "UTHSC Brain mRNA U74Av2 (Nov05) PDNN" ], - [ - "81", - "BR_U_0805_P", - "UTHSC Brain mRNA U74Av2 (Aug05) PDNN" - ], [ "80", "BR_U_0805_M", @@ -2014,6 +2009,11 @@ "BR_U_0805_R", "UTHSC Brain mRNA U74Av2 (Aug05) RMA" ], + [ + "81", + "BR_U_0805_P", + "UTHSC Brain mRNA U74Av2 (Aug05) PDNN" + ], [ "42", "CB_M_0204_P", @@ -2080,11 +2080,6 @@ "Eye_M2_0908_R_ND", "Eye M430v2 WT Gpnmb (Sep08) RMA" ], - [ - "279", - "Eye_M2_0908_R_WT", - "Eye M430v2 WT Tyrp1 (Sep08) RMA" - ], [ "278", "Eye_M2_0908_R_MT", @@ -2095,6 +2090,11 @@ "Eye_M2_0908_WTWT", "Eye M430v2 WT WT (Sep08) RMA" ], + [ + "279", + "Eye_M2_0908_R_WT", + "Eye M430v2 WT Tyrp1 (Sep08) RMA" + ], [ "400", "DBA2J-ONH-1212", @@ -2331,16 +2331,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", @@ -2545,15 +2545,15 @@ "HQFNeoc_0208_RankInv", "HQF BXD Neocortex ILM6v1.1 (Feb08) RankInv" ], - [ - "275", - "DevNeocortex_ILM6.2P14RInv_1110", - "BIDMC/UTHSC Dev Neocortex P14 ILMv6.2 (Nov10) RankInv" - ], [ "274", "DevNeocortex_ILM6.2P3RInv_1110", "BIDMC/UTHSC Dev Neocortex P3 ILMv6.2 (Nov10) RankInv" + ], + [ + "275", + "DevNeocortex_ILM6.2P14RInv_1110", + "BIDMC/UTHSC Dev Neocortex P14 ILMv6.2 (Nov10) RankInv" ] ], "Nucleus Accumbens mRNA": [ @@ -2760,11 +2760,6 @@ ] ], "Ventral Tegmental Area mRNA": [ - [ - "230", - "VCUEtvsSal_0609_R", - "VCU BXD VTA Et vs Sal M430 2.0 (Jun09) RMA" - ], [ "229", "VCUEtOH_0609_R", @@ -2774,6 +2769,11 @@ "228", "VCUSal_0609_R", "VCU BXD VTA Sal M430 2.0 (Jun09) RMA" + ], + [ + "230", + "VCUEtvsSal_0609_R", + "VCU BXD VTA Et vs Sal M430 2.0 (Jun09) RMA" ] ] }, @@ -2849,6 +2849,36 @@ ] ] }, + "CFW": { + "Hippocampus mRNA": [ + [ + "808", + "UCSD_CFW_HIP_RNA-Seq_0117", + "UCSD CFW Hippocampus (Jan17) RNA-Seq" + ] + ], + "Phenotypes": [ + [ + "None", + "CFWPublish", + "CFW Published Phenotypes" + ] + ], + "Prefrontal Cortex mRNA": [ + [ + "810", + "UCSD_CFW_PFC_RNA-Seq_0117", + "UCSD CFW Prefrontal Cortex (Jan17) RNA-Seq" + ] + ], + "Striatum mRNA": [ + [ + "809", + "UCSD_CFW_SPL_RNA-Seq_0117", + "UCSD CFW Striatum (Jan17) RNA-Seq" + ] + ] + }, "CIE-INIA": { "LCM Brain Regions mRNA": [ [ @@ -3051,11 +3081,6 @@ ] ], "Hippocampus mRNA": [ - [ - "213", - "Illum_LXS_Hipp_NOS_1008", - "Hippocampus Illumina NOS (Oct08) RankInv beta" - ], [ "219", "Illum_LXS_Hipp_NON_1008", @@ -3076,6 +3101,11 @@ "Illum_LXS_Hipp_RSS_1008", "Hippocampus Illumina RSS (Oct08) RankInv beta" ], + [ + "213", + "Illum_LXS_Hipp_NOS_1008", + "Hippocampus Illumina NOS (Oct08) RankInv beta" + ], [ "143", "Illum_LXS_Hipp_loess0807", @@ -3246,6 +3276,17 @@ }, "Scripps-2013": {} }, + "poplar": { + "Poplar": { + "Phenotypes": [ + [ + "649", + "PoplarPublish", + "Poplar Published Phenotypes" + ] + ] + } + }, "rat": { "HSNIH-Palmer": { "Phenotypes": [ @@ -3554,6 +3595,10 @@ "C57BL-6JxC57BL-6NJF2", "Reduced Complexity Cross (B6JxB6N F2)" ], + [ + "CFW", + "CFW Outbred GWAS" + ], [ "CIE-INIA", "Chronic Intermittent Ethanol" @@ -3603,6 +3648,12 @@ "SOTNOT-OHSU" ] ], + "poplar": [ + [ + "Poplar", + "Poplar" + ] + ], "rat": [ [ "HSNIH-Palmer", @@ -3641,15 +3692,15 @@ "species": [ [ "human", - "Human" + "Human (hg19)" ], [ "mouse", - "Mouse" + "Mouse (mm10)" ], [ "rat", - "Rat" + "Rat (rn3)" ], [ "drosophila", @@ -3663,6 +3714,10 @@ "barley", "Barley" ], + [ + "poplar", + "Poplar" + ], [ "soybean", "Soybean" @@ -4682,6 +4737,24 @@ "Genotypes" ] ], + "CFW": [ + [ + "Phenotypes", + "Phenotypes" + ], + [ + "Hippocampus mRNA", + "Hippocampus mRNA" + ], + [ + "Prefrontal Cortex mRNA", + "Prefrontal Cortex mRNA" + ], + [ + "Striatum mRNA", + "Striatum mRNA" + ] + ], "CIE-INIA": [ [ "Phenotypes", @@ -4842,6 +4915,14 @@ ], "Scripps-2013": [] }, + "poplar": { + "Poplar": [ + [ + "Phenotypes", + "Phenotypes" + ] + ] + }, "rat": { "HSNIH-Palmer": [ [ diff --git a/wqflask/wqflask/static/new/javascript/dataset_select_menu.js b/wqflask/wqflask/static/new/javascript/dataset_select_menu.js index 43b0960c..9ad38102 100644 --- a/wqflask/wqflask/static/new/javascript/dataset_select_menu.js +++ b/wqflask/wqflask/static/new/javascript/dataset_select_menu.js @@ -1,10 +1,10 @@ $(function() { - var gndata; // loaded once for all to use - process_json = function(data) { - populate_species(); - return apply_default(); - }; - $.getJSON(gn_server_url+"/int/menu/main.json", + var gndata; // loaded once for all to use + process_json = function(data) { + populate_species(); + return apply_default(); + }; + $.getJSON(gn_server_url+"int/menu/main.json", function(data) { gndata = data; console.log("***** GOT DATA from GN_SERVER ****"); diff --git a/wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js b/wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js index 1fe4cf75..fd96eb78 100644 --- a/wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js +++ b/wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js @@ -4,7 +4,9 @@ $(function() { process_json = function(data) { window.jdata = data; populate_species(); - return apply_default(); + if ($('#type').length > 0) { //This is to determine if it's the index page or the submit_trait page (which only has species and group selection and no make default option) + return apply_default(); + } }; $.ajax('/static/new/javascript/dataset_menu_structure.json', { dataType: 'json', @@ -23,7 +25,9 @@ $(function() { species = $('#species').val(); group_list = this.jdata.groups[species]; redo_dropdown($('#group'), group_list); - return populate_type(); + if ($('#type').length > 0) { //This is to determine if it's the index page or the submit_trait page (which only has species and group selection and no make default option) + return populate_type(); + } }; window.populate_group = populate_group; populate_type = function() { @@ -70,7 +74,12 @@ $(function() { })(this)); $('#group').change((function(_this) { return function() { - return populate_type(); + if ($('#type').length > 0) { //This is to determine if it's the index page or the submit_trait page (which only has species and group selection and no make default option) + return populate_type(); + } + else { + return false + } }; })(this)); $('#type').change((function(_this) { diff --git a/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css b/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css index 6e0e7348..87f602dc 100644 --- a/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css +++ b/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css @@ -81,7 +81,7 @@ table.dataTable tbody tr.selected { table.dataTable tbody th, table.dataTable tbody td { font: 12px Arial, Sans-serif; - padding: 4px 5px; + padding: 4px 5px 4px 0px; } table.dataTable.row-border tbody th, table.dataTable.row-border tbody td, table.dataTable.display tbody th, table.dataTable.display tbody td { border-top: 1px solid #ddd; diff --git a/wqflask/wqflask/static/new/packages/DataTables/extensions/buttons.colVis.min.js b/wqflask/wqflask/static/new/packages/DataTables/extensions/buttons.colVis.min.js new file mode 100644 index 00000000..072d6c9a --- /dev/null +++ b/wqflask/wqflask/static/new/packages/DataTables/extensions/buttons.colVis.min.js @@ -0,0 +1,5 @@ +(function(g){"function"===typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],function(d){return g(d,window,document)}):"object"===typeof exports?module.exports=function(d,e){d||(d=window);if(!e||!e.fn.dataTable)e=require("datatables.net")(d,e).$;e.fn.dataTable.Buttons||require("datatables.net-buttons")(d,e);return g(e,d,d.document)}:g(jQuery,window,document)})(function(g,d,e,h){d=g.fn.dataTable;g.extend(d.ext.buttons,{colvis:function(a,b){return{extend:"collection", +text:function(a){return a.i18n("buttons.colvis","Column visibility")},className:"buttons-colvis",buttons:[{extend:"columnsToggle",columns:b.columns}]}},columnsToggle:function(a,b){return a.columns(b.columns).indexes().map(function(a){return{extend:"columnToggle",columns:a}}).toArray()},columnToggle:function(a,b){return{extend:"columnVisibility",columns:b.columns}},columnsVisibility:function(a,b){return a.columns(b.columns).indexes().map(function(a){return{extend:"columnVisibility",columns:a,visibility:b.visibility}}).toArray()}, +columnVisibility:{columns:h,text:function(a,b,c){return c._columnText(a,c.columns)},className:"buttons-columnVisibility",action:function(a,b,c,f){a=b.columns(f.columns);b=a.visible();a.visible(f.visibility!==h?f.visibility:!(b.length&&b[0]))},init:function(a,b,c){var f=this;a.on("column-visibility.dt"+c.namespace,function(b,d){d.bDestroying||f.active(a.column(c.columns).visible())}).on("column-reorder.dt"+c.namespace,function(b,d,e){1===a.columns(c.columns).count()&&("number"===typeof c.columns&& +(c.columns=e.mapping[c.columns]),b=a.column(c.columns),f.text(c._columnText(a,c.columns)),f.active(b.visible()))});this.active(a.column(c.columns).visible())},destroy:function(a,b,c){a.off("column-visibility.dt"+c.namespace).off("column-reorder.dt"+c.namespace)},_columnText:function(a,b){var c=a.column(b).index();return a.settings()[0].aoColumns[c].sTitle.replace(/\n/g," ").replace(/<.*?>/g,"").replace(/^\s+|\s+$/g,"")}},colvisRestore:{className:"buttons-colvisRestore",text:function(a){return a.i18n("buttons.colvisRestore", +"Restore visibility")},init:function(a,b,c){c._visOriginal=a.columns().indexes().map(function(b){return a.column(b).visible()}).toArray()},action:function(a,b,c,d){b.columns().every(function(a){a=b.colReorder&&b.colReorder.transpose?b.colReorder.transpose(a,"toOriginal"):a;this.visible(d._visOriginal[a])})}},colvisGroup:{className:"buttons-colvisGroup",action:function(a,b,c,d){b.columns(d.show).visible(!0,!1);b.columns(d.hide).visible(!1,!1);b.columns.adjust()},show:[],hide:[]}});return d.Buttons}); \ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/DataTables/extensions/dataTables.buttons.min.js b/wqflask/wqflask/static/new/packages/DataTables/extensions/dataTables.buttons.min.js new file mode 100644 index 00000000..ae3fb9c8 --- /dev/null +++ b/wqflask/wqflask/static/new/packages/DataTables/extensions/dataTables.buttons.min.js @@ -0,0 +1,35 @@ +/*! + Buttons for DataTables 1.2.4 + Š2016 SpryMedia Ltd - datatables.net/license +*/ +(function(d){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(n){return d(n,window,document)}):"object"===typeof exports?module.exports=function(n,o){n||(n=window);if(!o||!o.fn.dataTable)o=require("datatables.net")(n,o).$;return d(o,n,n.document)}:d(jQuery,window,document)})(function(d,n,o,m){var i=d.fn.dataTable,u=0,v=0,j=i.ext.buttons,l=function(a,b){!0===b&&(b={});d.isArray(b)&&(b={buttons:b});this.c=d.extend(!0,{},l.defaults,b);b.buttons&&(this.c.buttons=b.buttons); +this.s={dt:new i.Api(a),buttons:[],listenKeys:"",namespace:"dtb"+u++};this.dom={container:d("<"+this.c.dom.container.tag+"/>").addClass(this.c.dom.container.className)};this._constructor()};d.extend(l.prototype,{action:function(a,b){var c=this._nodeToButton(a);if(b===m)return c.conf.action;c.conf.action=b;return this},active:function(a,b){var c=this._nodeToButton(a),e=this.c.dom.button.active,c=d(c.node);if(b===m)return c.hasClass(e);c.toggleClass(e,b===m?!0:b);return this},add:function(a,b){var c= +this.s.buttons;if("string"===typeof b){for(var e=b.split("-"),c=this.s,d=0,h=e.length-1;d").addClass(s.className);p.conf._collection=p.collection;this._expandButton(p.buttons,p.conf.buttons,!0,e)}k.init&&k.init.call(g.button(p.node),g,d(p.node),k);h++}}}},_buildButton:function(a,b){var c=this.c.dom.button,e=this.c.dom.buttonLiner,g=this.c.dom.collection,h=this.s.dt,f=function(b){return"function"===typeof b?b(h,k,a):b};b&&g.button&&(c=g.button);b&&g.buttonLiner&&(e=g.buttonLiner);if(a.available&&!a.available(h,a))return!1;var r=function(a, +b,c,e){e.action.call(b.button(c),a,b,c,e);d(b.table().node()).triggerHandler("buttons-action.dt",[b.button(c),b,c,e])},k=d("<"+c.tag+"/>").addClass(c.className).attr("tabindex",this.s.dt.settings()[0].iTabIndex).attr("aria-controls",this.s.dt.table().node().id).on("click.dtb",function(b){b.preventDefault();!k.hasClass(c.disabled)&&a.action&&r(b,h,k,a);k.blur()}).on("keyup.dtb",function(b){b.keyCode===13&&!k.hasClass(c.disabled)&&a.action&&r(b,h,k,a)});"a"===c.tag.toLowerCase()&&k.attr("href","#"); +e.tag?(g=d("<"+e.tag+"/>").html(f(a.text)).addClass(e.className),"a"===e.tag.toLowerCase()&&g.attr("href","#"),k.append(g)):k.html(f(a.text));!1===a.enabled&&k.addClass(c.disabled);a.className&&k.addClass(a.className);a.titleAttr&&k.attr("title",a.titleAttr);a.namespace||(a.namespace=".dt-button-"+v++);e=(e=this.c.dom.buttonContainer)&&e.tag?d("<"+e.tag+"/>").addClass(e.className).append(k):k;this._addKey(a);return{conf:a,node:k.get(0),inserter:e,buttons:[],inCollection:b,collection:null}},_nodeToButton:function(a, +b){b||(b=this.s.buttons);for(var c=0,e=b.length;c").addClass(b).css("display","none").appendTo("body").fadeIn(c):d("body > div."+b).fadeOut(c,function(){d(this).removeClass(b).remove()})};l.instanceSelector=function(a,b){if(!a)return d.map(b,function(a){return a.inst});var c= +[],e=d.map(b,function(a){return a.name}),g=function(a){if(d.isArray(a))for(var f=0,r=a.length;fg&&e._collection.css("left",a.left-(c-g))):(a=e._collection.height()/2,a>d(n).height()/2&&(a=d(n).height()/2),e._collection.css("marginTop",-1*a));e.background&&l.background(!0,e.backgroundClassName,e.fade);setTimeout(function(){d("div.dt-button-background").on("click.dtb-collection", +function(){});d("body").on("click.dtb-collection",function(a){var c=d.fn.addBack?"addBack":"andSelf";if(!d(a.target).parents()[c]().filter(e._collection).length){e._collection.fadeOut(e.fade,function(){e._collection.detach()});d("div.dt-button-background").off("click.dtb-collection");l.background(false,e.backgroundClassName,e.fade);d("body").off("click.dtb-collection");b.off("buttons-action.b-internal")}})},10);if(e.autoClose)b.on("buttons-action.b-internal",function(){d("div.dt-button-background").click()})}, +background:!0,collectionLayout:"",backgroundClassName:"dt-button-background",autoClose:!1,fade:400},copy:function(a,b){if(j.copyHtml5)return"copyHtml5";if(j.copyFlash&&j.copyFlash.available(a,b))return"copyFlash"},csv:function(a,b){if(j.csvHtml5&&j.csvHtml5.available(a,b))return"csvHtml5";if(j.csvFlash&&j.csvFlash.available(a,b))return"csvFlash"},excel:function(a,b){if(j.excelHtml5&&j.excelHtml5.available(a,b))return"excelHtml5";if(j.excelFlash&&j.excelFlash.available(a,b))return"excelFlash"},pdf:function(a, +b){if(j.pdfHtml5&&j.pdfHtml5.available(a,b))return"pdfHtml5";if(j.pdfFlash&&j.pdfFlash.available(a,b))return"pdfFlash"},pageLength:function(a){var a=a.settings()[0].aLengthMenu,b=d.isArray(a[0])?a[0]:a,c=d.isArray(a[0])?a[1]:a,e=function(a){return a.i18n("buttons.pageLength",{"-1":"Show all rows",_:"Show %d rows"},a.page.len())};return{extend:"collection",text:e,className:"buttons-page-length",autoClose:!0,buttons:d.map(b,function(a,b){return{text:c[b],className:"button-page-length",action:function(b, +c){c.page.len(a).draw()},init:function(b,c,e){var d=this,c=function(){d.active(b.page.len()===a)};b.on("length.dt"+e.namespace,c);c()},destroy:function(a,b,c){a.off("length.dt"+c.namespace)}}}),init:function(a,b,c){var d=this;a.on("length.dt"+c.namespace,function(){d.text(e(a))})},destroy:function(a,b,c){a.off("length.dt"+c.namespace)}}}});i.Api.register("buttons()",function(a,b){b===m&&(b=a,a=m);this.selector.buttonGroup=a;var c=this.iterator(!0,"table",function(c){if(c._buttons)return l.buttonSelector(l.instanceSelector(a, +c._buttons),b)},!0);c._groupSelector=a;return c});i.Api.register("button()",function(a,b){var c=this.buttons(a,b);1').html(a?"

"+a+"

":"").append(d("
")["string"===typeof b?"html":"append"](b)).css("display","none").appendTo("body").fadeIn();c!==m&&0!==c&&(q=setTimeout(function(){e.buttons.info(!1)},c));return this});i.Api.register("buttons.exportData()",function(a){if(this.context.length){for(var b=new i.Api(this.context[0]), +c=d.extend(!0,{},{rows:null,columns:"",modifier:{search:"applied",order:"applied"},orthogonal:"display",stripHtml:!0,stripNewlines:!0,decodeEntities:!0,trim:!0,format:{header:function(a){return e(a)},footer:function(a){return e(a)},body:function(a){return e(a)}}},a),e=function(a){if("string"!==typeof a)return a;c.stripHtml&&(a=a.replace(/<[^>]*>/g,""));c.trim&&(a=a.replace(/^\s+|\s+$/g,""));c.stripNewlines&&(a=a.replace(/\n/g," "));c.decodeEntities&&(t.innerHTML=a,a=t.value);return a},a=b.columns(c.columns).indexes().map(function(a){var d= +b.column(a).header();return c.format.header(d.innerHTML,a,d)}).toArray(),g=b.table().footer()?b.columns(c.columns).indexes().map(function(a){var d=b.column(a).footer();return c.format.footer(d?d.innerHTML:"",a,d)}).toArray():null,h=b.rows(c.rows,c.modifier).indexes().toArray(),f=b.cells(h,c.columns),h=f.render(c.orthogonal).toArray(),f=f.nodes().toArray(),j=a.length,k=0")[0];d.fn.dataTable.Buttons=l;d.fn.DataTable.Buttons=l;d(o).on("init.dt plugin-init.dt",function(a,b){if("dt"===a.namespace){var c=b.oInit.buttons||i.defaults.buttons;c&&!b._buttons&&(new l(b,c)).container()}});i.ext.feature.push({fnInit:function(a){var a=new i.Api(a),b=a.init().buttons||i.defaults.buttons;return(new l(a,b)).container()},cFeature:"B"});return l}); \ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/DataTables/extensions/scroller.dataTables.min.css b/wqflask/wqflask/static/new/packages/DataTables/extensions/scroller.dataTables.min.css new file mode 100644 index 00000000..284cb376 --- /dev/null +++ b/wqflask/wqflask/static/new/packages/DataTables/extensions/scroller.dataTables.min.css @@ -0,0 +1 @@ +div.DTS{display:block !important}div.DTS tbody th,div.DTS tbody td{white-space:nowrap}div.DTS div.DTS_Loading{z-index:1}div.DTS div.dataTables_scrollBody{background:repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, #fff 10px, #fff 20px)}div.DTS div.dataTables_scrollBody table{z-index:2}div.DTS div.dataTables_paginate,div.DTS div.dataTables_length{display:none} \ No newline at end of file diff --git a/wqflask/wqflask/submit_trait.py b/wqflask/wqflask/submit_trait.py new file mode 100644 index 00000000..4ab9a4be --- /dev/null +++ b/wqflask/wqflask/submit_trait.py @@ -0,0 +1,24 @@ +from __future__ import print_function, division + +from flask import Flask, g + +from pprint import pformat as pf + +def get_species_groups(): + + species_query = "SELECT SpeciesId, MenuName FROM Species" + + species_ids_and_names = g.db.execute(species_query).fetchall() + + + species_and_groups = [] + for species_id, species_name in species_ids_and_names: + this_species_groups = {} + this_species_groups['species'] = species_name + groups_query = "SELECT InbredSetName FROM InbredSet WHERE SpeciesId = %s" % (species_id) + groups = [group[0] for group in g.db.execute(groups_query).fetchall()] + + this_species_groups['groups'] = groups + species_and_groups.append(this_species_groups) + + return species_and_groups \ No newline at end of file diff --git a/wqflask/wqflask/templates/gsearch_gene.html b/wqflask/wqflask/templates/gsearch_gene.html index 097d0d2c..205d5801 100644 --- a/wqflask/wqflask/templates/gsearch_gene.html +++ b/wqflask/wqflask/templates/gsearch_gene.html @@ -9,7 +9,7 @@

You searched for {{ terms }}.

-

To study a record, click on its ID below.
Check records below and click Add button to add to selection.

+

To study a record, click on its Record ID below.
Check records below and click Add button to add to selection.


@@ -27,36 +27,36 @@
-
- +
+
- - - - - - - - - - - - - - + + + + + + + + + + + + + + {% for this_trait in trait_list %} - + + - @@ -69,20 +69,20 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + +
IndexSpeciesGroupTissueDatasetRecordSymbolDescriptionLocationMeanMax LRS ?Max LRS LocationAdditive Effect ?IndexRecord IDSpeciesGroupTissueDatasetSymbolDescriptionLocationMeanMax LRS ?Max LRS LocationAdditive Effect ?
{{ loop.index }}{{ this_trait.name }} {{ this_trait.dataset.group.species }} {{ this_trait.dataset.group.name }} {{ this_trait.dataset.tissue }} {{ this_trait.dataset.name }}{{ this_trait.name }} {{ this_trait.symbol }} {{ this_trait.description_display }} {{ this_trait.location_repr }}
IndexSpeciesGroupTissueDatasetRecordSymbolDescriptionLocationMeanMax  
LRS ?
Max LRS LocationAdditive
Effect ?
IndexRecord IDSpeciesGroupTissueDatasetSymbolDescriptionLocationMeanMax LRS ?Max LRS LocationAdditive Effect ?
@@ -123,26 +123,34 @@ console.time("Creating table"); $('#trait_table').DataTable( { + "createdRow": function ( row, data, index ) { + $('td', row).eq(8).attr('title', $('td', row).eq(8).text()); + if ($('td', row).eq(8).text().length > 50) { + $('td', row).eq(8).text($('td', row).eq(8).text().substring(0, 50)); + $('td', row).eq(8).text($('td', row).eq(8).text() + '...') + } + }, "paging": false, "columns": [ { "orderDataType": "dom-checkbox" }, - { "type": "natural" }, - { "type": "natural" }, - { "type": "natural", "width": "8%" }, - { "type": "natural" }, + { "type": "natural", "width": "3%" }, + { "type": "natural", "width": "6%" }, + { "type": "natural", "width": "8%" }, { "type": "natural" }, { "type": "natural" }, { "type": "natural" }, { "type": "natural" }, - { "type": "natural", "width": "8%" }, { "type": "natural" }, - { "type": "natural" }, - { "type": "natural", "width": "8%" }, - { "type": "natural" } + { "type": "natural", "width": "7%" }, + { "type": "natural", "width": "4%" }, + { "type": "natural", "width": "5%" }, + { "type": "natural", "width": "7%" }, + { "type": "natural", "width": "7%" } ], "columnDefs": [ { "targets": 0, + "orderable": false, "orderDataType": "dom-checkbox" } ], diff --git a/wqflask/wqflask/templates/loading.html b/wqflask/wqflask/templates/loading.html new file mode 100644 index 00000000..bc2627a0 --- /dev/null +++ b/wqflask/wqflask/templates/loading.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} +{% block title %}Loading Mapping Results{% endblock %} +{% block content %} +
+
+
+
+
+{% endblock %} +{% block js %} + +{% endblock %} \ No newline at end of file diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html index f7b450c1..cafa8b93 100644 --- a/wqflask/wqflask/templates/search_result_page.html +++ b/wqflask/wqflask/templates/search_result_page.html @@ -3,6 +3,7 @@ {% block css %} + {% endblock %} {% block content %} @@ -125,9 +126,8 @@ - - - + + + +{% endblock %} diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 4f6725b3..4f46a904 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -50,6 +50,7 @@ from wqflask.correlation_matrix import show_corr_matrix from wqflask.correlation import corr_scatter_plot from wqflask.wgcna import wgcna_analysis from wqflask.ctl import ctl_analysis +from wqflask.submit_trait import get_species_groups from utility import temp_data from utility.tools import SQL_URI,TEMPDIR,USE_REDIS,USE_GN_SERVER,GN_SERVER_URL,GN_VERSION @@ -294,6 +295,11 @@ def environments(): doc = docs.Docs("environments") return render_template("docs.html", **doc.__dict__) +@app.route("/submit_trait") +def submit_trait(): + species_and_groups = get_species_groups() + return render_template("submit_trait.html", **{'species_and_groups' : species_and_groups, 'gn_server_url' : GN_SERVER_URL, 'version' : GN_VERSION}) + @app.route('/export_trait_excel', methods=('POST',)) def export_trait_excel(): """Excel file consisting of the sample data from the trait data and analysis page""" @@ -440,6 +446,57 @@ def heatmap_page(): def mapping_results_container_page(): return render_template("mapping_results_container.html") +@app.route("/loading", methods=('POST',)) +def loading_page(): + initial_start_vars = request.form + logger.debug("Marker regression called with initial_start_vars:", initial_start_vars.items()) + temp_uuid = initial_start_vars['temp_uuid'] + wanted = ( + 'trait_id', + 'dataset', + 'method', + 'trimmed_markers', + 'selected_chr', + 'chromosomes', + 'mapping_scale', + 'score_type', + 'suggestive', + 'significant', + 'num_perm', + 'permCheck', + 'perm_output', + 'num_bootstrap', + 'bootCheck', + 'bootstrap_results', + 'LRSCheck', + 'maf', + 'manhattan_plot', + 'control_marker', + 'control_marker_db', + 'do_control', + 'genofile', + 'pair_scan', + 'startMb', + 'endMb', + 'graphWidth', + 'lrsMax', + 'additiveCheck', + 'showSNP', + 'showGenes', + 'viewLegend', + 'haplotypeAnalystCheck', + 'mapmethod_rqtl_geno', + 'mapmodel_rqtl_geno' + ) + start_vars = {} + for key, value in initial_start_vars.iteritems(): + if key in wanted or key.startswith(('value:')): + start_vars[key] = value + + rendered_template = render_template("loading.html", **start_vars) + + return rendered_template + @app.route("/marker_regression", methods=('POST',)) def marker_regression_page(): initial_start_vars = request.form -- cgit v1.2.3