aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2019-03-01 15:37:36 -0600
committerzsloan2019-03-01 15:37:36 -0600
commit7fe9c2f3cb0405fda115f5ba66eb06da65189652 (patch)
treea661a4a451dbdd298758228e301fc3ce83f51bf6 /wqflask
parente14f913da79111c3db8d6faced45d92281865cb1 (diff)
downloadgenenetwork2-7fe9c2f3cb0405fda115f5ba66eb06da65189652.tar.gz
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
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/static/new/javascript/search_results.js30
-rw-r--r--wqflask/wqflask/static/new/javascript/show_trait.js13
-rw-r--r--wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js26
-rw-r--r--wqflask/wqflask/templates/collections/view.html2
-rw-r--r--wqflask/wqflask/templates/correlation_page.html2
-rw-r--r--wqflask/wqflask/templates/heatmap.html4
-rw-r--r--wqflask/wqflask/templates/loading.html8
-rw-r--r--wqflask/wqflask/templates/loading_correlation.html24
-rw-r--r--wqflask/wqflask/templates/search_result_page.html2
-rw-r--r--wqflask/wqflask/templates/show_trait.html3
-rw-r--r--wqflask/wqflask/views.py95
11 files changed, 64 insertions, 145 deletions
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 @@
<input type="hidden" name="uc_id" id="uc_id" value="{{ uc.id }}" />
{% endif %}
<input type="hidden" name="collection_name" id="collection_name" value="{{ collection_name }}" />
+ <input type="hidden" name="tool_used" value="" />
+ <input type="hidden" name="form_url" value="" />
<input type="hidden" name="trait_list" id="trait_list" value= "
{% for this_trait in trait_obs %}
{{ this_trait.name }}:{{ this_trait.dataset.name }},
diff --git a/wqflask/wqflask/templates/correlation_page.html b/wqflask/wqflask/templates/correlation_page.html
index 2b5a7f33..427dacc9 100644
--- a/wqflask/wqflask/templates/correlation_page.html
+++ b/wqflask/wqflask/templates/correlation_page.html
@@ -21,6 +21,8 @@
<div>
<form id="correlation_form" target="_blank" action="/corr_matrix" method="post">
+ <input type="hidden" name="tool_used" value="" />
+ <input type="hidden" name="form_url" value="" />
<input type="hidden" name="trait_list" id="trait_list" value= "
{% for this_trait in trait_list %}
{{ this_trait.name }}:{{ this_trait.dataset }},
diff --git a/wqflask/wqflask/templates/heatmap.html b/wqflask/wqflask/templates/heatmap.html
index 68880829..3abac194 100644
--- a/wqflask/wqflask/templates/heatmap.html
+++ b/wqflask/wqflask/templates/heatmap.html
@@ -12,8 +12,8 @@
<div>
<h3>
The following heatmap is a work in progress. The heatmap for each trait runs horizontally (as opposed to vertically in GeneNetwork 1),
- and hovering over a given trait's heatmap track will display its corresponding QTL chart below. Black on the heatmap corresponds with a
- low positive or negative z-score (darker when closer to 0), while light blue and yellow correspond to high negative and positive z-scores respectively.
+ and hovering over a given trait's heatmap track will display its corresponding QTL chart below. White on the heatmap corresponds with a
+ low positive or negative z-score (darker when closer to 0), while light blue and red correspond to high negative and positive z-scores respectively.
</h3>
</div>
<div id="chart_container">
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 @@
-<title>Loading Mapping Results</title>
+<title>Loading {{ start_vars.tool_used }} Results</title>
<link REL="stylesheet" TYPE="text/css" href="/static/packages/bootstrap/css/bootstrap.css" />
-<form method="post" action="/run_mapping" name="loading_form" id="loading_form" class="form-horizontal">
+<form method="post" action="" name="loading_form" id="loading_form" class="form-horizontal">
{% for key, value in start_vars.iteritems() %}
<input type="hidden" name="{{ key }}" value="{{ value }}">
{% endfor %}
@@ -8,7 +8,7 @@
<div>
<div style="min-height: 80vh; display: flex; align-items: center;">
<div style="margin-bottom: 10px; left: 50%; margin-right: -50%; transform: translate(-50%, -50%); position: absolute;">
- <h1>Loading&nbsp;Mapping&nbsp;Results...</h1>
+ <h1>Loading&nbsp;{{ start_vars.tool_used }}&nbsp;Results...</h1>
</div>
<div class="progress center-block" style="margin-top: 5px; margin-left: 25%; margin-right: 25%; position: absolute; height:50px; width:50%; top:50%;">
<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width:100%;"></div>
@@ -20,5 +20,7 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="/static/packages/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript">
+
+$("#loading_form").attr("action", "{{ start_vars.form_url }}");
$("#loading_form").submit();
</script> \ No newline at end of file
diff --git a/wqflask/wqflask/templates/loading_correlation.html b/wqflask/wqflask/templates/loading_correlation.html
deleted file mode 100644
index 2017c3de..00000000
--- a/wqflask/wqflask/templates/loading_correlation.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<title>Loading Correlation Results</title>
-<link REL="stylesheet" TYPE="text/css" href="/static/packages/bootstrap/css/bootstrap.css" />
-<form method="post" action="/corr_compute" name="loading_form" id="loading_form" class="form-horizontal">
- {% for key, value in start_vars.iteritems() %}
- <input type="hidden" name="{{ key }}" value="{{ value }}">
- {% endfor %}
- <div class="container">
- <div>
- <div style="min-height: 80vh; display: flex; align-items: center;">
- <div style="margin-bottom: 10px; left: 50%; margin-right: -50%; transform: translate(-50%, -50%); position: absolute;">
- <h1>Loading&nbsp;Correlation&nbsp;Results...</h1>
- </div>
- <div class="progress center-block" style="margin-top: 5px; margin-left: 25%; margin-right: 25%; position: absolute; height:50px; width:50%; top:50%;">
- <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width:100%;"></div>
- </div>
- </div>
- </div>
- </div>
-</form>
-<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
-<script src="/static/packages/bootstrap/js/bootstrap.min.js"></script>
-<script type="text/javascript">
-$("#loading_form").submit();
-</script> \ 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 5f529edb..a0ef4ab4 100644
--- a/wqflask/wqflask/templates/search_result_page.html
+++ b/wqflask/wqflask/templates/search_result_page.html
@@ -51,6 +51,8 @@
<div>
<form id="trait_submission_form" target="_blank" action="/corr_matrix" method="post">
+ <input type="hidden" name="tool_used" value="" />
+ <input type="hidden" name="form_url" value="" />
<input type="hidden" name="trait_list" id="trait_list" value= "
{% for this_trait in trait_list %}
{{ this_trait.name }}:{{ this_trait.dataset }},
diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html
index d7d85741..3bd57f89 100644
--- a/wqflask/wqflask/templates/show_trait.html
+++ b/wqflask/wqflask/templates/show_trait.html
@@ -32,6 +32,9 @@
</div>
<input type="hidden" name="temp_uuid" id="temp_uuid" value="{{ temp_uuid }}">
+ <input type="hidden" name="tool_used" value="">
+ <input type="hidden" name="form_url" value="">
+ <input type="hidden" name="wanted_inputs" value="">
<input type="hidden" name="genofile" value="">
<input type="hidden" name="covariates" value="">
<input type="hidden" name="transform" value="">
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 3aea2541..67e83366 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -550,58 +550,17 @@ def mapping_results_container_page():
def loading_page():
logger.info(request.url)
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 = (
- 'temp_uuid',
- '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',
- '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'
- )
start_vars_container = {}
- start_vars = {}
- for key, value in initial_start_vars.iteritems():
- if key in wanted or key.startswith(('value:')):
- start_vars[key] = value
-
- start_vars_container['start_vars'] = start_vars
+ if 'wanted_inputs' in initial_start_vars:
+ wanted = initial_start_vars['wanted_inputs'].split(",")
+ start_vars = {}
+ for key, value in initial_start_vars.iteritems():
+ if key in wanted or key.startswith(('value:')):
+ start_vars[key] = value
+
+ start_vars_container['start_vars'] = start_vars
+ else:
+ start_vars_container['start_vars'] = initial_start_vars
rendered_template = render_template("loading.html", **start_vars_container)
return rendered_template
@@ -773,40 +732,6 @@ def network_graph_page():
else:
return render_template("empty_collection.html", **{'tool':'Network Graph'})
-@app.route("/corr_loading", methods=('POST',))
-def corr_loading_page():
- logger.info(request.url)
- 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 = (
- 'corr_type',
- 'trait_id',
- 'dataset',
- 'group',
- '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'
- )
- start_vars_container = {}
- start_vars = {}
- for key, value in initial_start_vars.iteritems():
- if key in wanted or key.startswith(('value:')):
- start_vars[key] = value
-
- start_vars_container['start_vars'] = start_vars
- rendered_template = render_template("loading_correlation.html", **start_vars_container)
-
- return rendered_template
-
-
@app.route("/corr_compute", methods=('POST',))
def corr_compute_page():
logger.info("In corr_compute, request.form is:", pf(request.form))