From 7fe9c2f3cb0405fda115f5ba66eb06da65189652 Mon Sep 17 00:00:00 2001 From: zsloan Date: Fri, 1 Mar 2019 15:37:36 -0600 Subject: Changed loading page to work for any feature, instead of having to make a separate one like I did for correlation previously Fixed some wrong text on heatmap page --- .../static/new/javascript/search_results.js | 30 ++++--- .../wqflask/static/new/javascript/show_trait.js | 13 ++- .../new/javascript/show_trait_mapping_tools.js | 26 +++--- wqflask/wqflask/templates/collections/view.html | 2 + wqflask/wqflask/templates/correlation_page.html | 2 + wqflask/wqflask/templates/heatmap.html | 4 +- wqflask/wqflask/templates/loading.html | 8 +- wqflask/wqflask/templates/loading_correlation.html | 24 ------ wqflask/wqflask/templates/search_result_page.html | 2 + wqflask/wqflask/templates/show_trait.html | 3 + wqflask/wqflask/views.py | 95 +++------------------- 11 files changed, 64 insertions(+), 145 deletions(-) delete mode 100644 wqflask/wqflask/templates/loading_correlation.html (limited to 'wqflask') diff --git a/wqflask/wqflask/static/new/javascript/search_results.js b/wqflask/wqflask/static/new/javascript/search_results.js index ebb1651d..86e7d63e 100644 --- a/wqflask/wqflask/static/new/javascript/search_results.js +++ b/wqflask/wqflask/static/new/javascript/search_results.js @@ -228,48 +228,54 @@ $(function() { return $(this).val(); }).get(); $("#trait_list").val(traits) - url = $(this).data("url") - return submit_special(url) + $("input[name=tool_used]").val("Correlation Matrix") + $("input[name=form_url]").val($(this).data("url")) + return submit_special("/loading") }); $("#network_graph").on("click", function() { traits = $("#trait_table input:checked").map(function() { return $(this).val(); }).get(); $("#trait_list").val(traits) - url = $(this).data("url") - return submit_special(url) + $("input[name=tool_used]").val("Network Graph") + $("input[name=form_url]").val($(this).data("url")) + return submit_special("/loading") }); $("#wgcna_setup").on("click", function() { traits = $("#trait_table input:checked").map(function() { return $(this).val(); }).get(); $("#trait_list").val(traits) - url = $(this).data("url") - return submit_special(url) + $("input[name=tool_used]").val("WGCNA Setup") + $("input[name=form_url]").val($(this).data("url")) + return submit_special("/loading") }); $("#ctl_setup").on("click", function() { traits = $("#trait_table input:checked").map(function() { return $(this).val(); }).get(); $("#trait_list").val(traits) - url = $(this).data("url") - return submit_special(url) + $("input[name=tool_used]").val("CTL Setup") + $("input[name=form_url]").val($(this).data("url")) + return submit_special("/loading") }); $("#heatmap").on("click", function() { traits = $("#trait_table input:checked").map(function() { return $(this).val(); }).get(); $("#trait_list").val(traits) - url = $(this).data("url") - return submit_special(url) + $("input[name=tool_used]").val("Heatmap") + $("input[name=form_url]").val($(this).data("url")) + return submit_special("/loading") }); $("#comp_bar_chart").on("click", function() { traits = $("#trait_table input:checked").map(function() { return $(this).val(); }).get(); $("#trait_list").val(traits) - url = $(this).data("url") - return submit_special(url) + $("input[name=tool_used]").val("Comparison Bar Chart") + $("input[name=form_url]").val($(this).data("url")) + return submit_special("/loading") }); $("#send_to_webgestalt, #send_to_bnw, #send_to_geneweaver").on("click", function() { diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js index f278b840..e985078b 100644 --- a/wqflask/wqflask/static/new/javascript/show_trait.js +++ b/wqflask/wqflask/static/new/javascript/show_trait.js @@ -445,16 +445,15 @@ submit_special = function(url) { return $("#trait_data_form").submit(); }; -submit_corr = function(){ - var url; - url = "/corr_loading"; - return submit_special(url); -}; +var corr_input_list = ['corr_type', 'trait_id', 'dataset', 'group', 'tool_used', 'form_url', 'corr_sample_method', 'corr_samples_group', 'corr_dataset', 'min_expr', + 'corr_return_results', 'loc_chr', 'min_loc_mb', 'max_loc_mb', 'p_range_lower', 'p_range_upper'] $(".corr_compute").on("click", (function(_this) { return function() { - var url; - url = "/corr_loading"; + $('input[name=tool_used]').val("Correlation"); + $('input[name=form_url]').val("/corr_compute"); + $('input[name=wanted_inputs]').val(corr_input_list.join(",")); + url = "/loading"; return submit_special(url); }; })(this)); diff --git a/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js b/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js index 4e82fff2..d9cf50e2 100644 --- a/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js +++ b/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js @@ -4,9 +4,6 @@ submit_special = function(url) { console.log("In submit_special"); - console.log("this is:", this); - console.log("$(this) is:", $(this)); - console.log("url is:", url); $("#trait_data_form").attr("action", url); return $("#trait_data_form").submit(); }; @@ -154,6 +151,13 @@ }; })(this)); + //ZS: This is a list of inputs to be passed to the loading page, since not all inputs on the trait page are relevant to mapping + var mapping_input_list = ['temp_uuid', 'trait_id', 'dataset', 'tool_used', 'form_url', 'method', 'trimmed_markers', 'selected_chr', 'chromosomes', 'mapping_scale', + 'score_type', 'suggestive', 'significant', 'num_perm', 'permCheck', 'perm_output', 'num_bootstrap', 'bootCheck', 'bootstrap_results', + 'LRSCheck', 'covariates', 'maf', 'use_loco', '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', 'temp_trait', 'group', 'species'] + $("#rqtl_geno_compute").on("click", (function(_this) { return function() { var form_data, url; @@ -165,10 +169,10 @@ $('input[name=manhattan_plot]').val($('input[name=manhattan_plot_rqtl]:checked').val()); $('input[name=control_marker]').val($('input[name=control_rqtl_geno]').val()); $('input[name=do_control]').val($('input[name=do_control_rqtl]:checked').val()); - form_data = $('#trait_data_form').serialize(); - console.log("form_data is:", form_data); + $('input[name=tool_used]').val("Mapping"); + $('input[name=form_url]').val("/run_mapping"); + $('input[name=wanted_inputs]').val(mapping_input_list.join(",")); if ($('input[name=pair_scan]:checked').val() == "true") { - console.log("PAIR SCAN:", $('input[name=pair_scan]:checked').val()) run_pair_scan = confirm(runtime_warning_text) if (run_pair_scan == true) { submit_special(url); @@ -193,8 +197,8 @@ $('input[name=num_perm]').val(0); $('input[name=genofile]').val($('#genofile_gemma').val()); $('input[name=maf]').val($('input[name=maf_gemma]').val()); - form_data = $('#trait_data_form').serialize(); - console.log("form_data is:", form_data); + $('input[name=tool_used]').val("Mapping"); + $('input[name=wanted_inputs]').val(mapping_input_list.join(",")); return submit_special(url); }; })(this)); @@ -203,7 +207,6 @@ return function() { var form_data, url; console.log("In interval mapping"); - //$("#progress_bar_container").modal(); url = "/loading"; $('input[name=method]').val("reaper"); $('input[name=selected_chr]').val($('#chr_reaper').val()); @@ -214,10 +217,9 @@ $('input[name=manhattan_plot]').val($('input[name=manhattan_plot_reaper]:checked').val()); $('input[name=mapping_display_all]').val($('input[name=display_all_reaper]')); $('input[name=suggestive]').val($('input[name=suggestive_reaper]')); - form_data = $('#trait_data_form').serialize(); - console.log("form_data is:", form_data); + $('input[name=tool_used]').val("Mapping"); + $('input[name=wanted_inputs]').val(mapping_input_list.join(",")); return submit_special(url); - //return do_ajax_post(url, form_data); }; })(this)); diff --git a/wqflask/wqflask/templates/collections/view.html b/wqflask/wqflask/templates/collections/view.html index 75b65b5a..a000b07d 100644 --- a/wqflask/wqflask/templates/collections/view.html +++ b/wqflask/wqflask/templates/collections/view.html @@ -24,6 +24,8 @@ {% endif %} + + + + diff --git a/wqflask/wqflask/templates/loading.html b/wqflask/wqflask/templates/loading.html index 99fa4a89..25560249 100644 --- a/wqflask/wqflask/templates/loading.html +++ b/wqflask/wqflask/templates/loading.html @@ -1,6 +1,6 @@ -