diff options
author | Alexander Kabui | 2021-05-11 00:29:33 +0300 |
---|---|---|
committer | Alexander Kabui | 2021-05-11 00:29:33 +0300 |
commit | 56fc1a2a53496a8b3720515f61e54a74cc95821e (patch) | |
tree | 460854eb139b7b65ce0831f89661105c171fd708 /wqflask | |
parent | 848fc236461384e5352798e19d710480ead379c4 (diff) | |
download | genenetwork2-56fc1a2a53496a8b3720515f61e54a74cc95821e.tar.gz |
modify js & add button for test correlation
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/static/new/javascript/show_trait.js | 10 | ||||
-rw-r--r-- | wqflask/wqflask/templates/show_trait_calculate_correlations.html | 3 | ||||
-rw-r--r-- | wqflask/wqflask/views.py | 15 |
3 files changed, 23 insertions, 5 deletions
diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js index 6e9d68c4..569046d3 100644 --- a/wqflask/wqflask/static/new/javascript/show_trait.js +++ b/wqflask/wqflask/static/new/javascript/show_trait.js @@ -585,6 +585,16 @@ get_table_contents_for_form_submit = function(form_id) { var corr_input_list = ['sample_vals', 'corr_type', 'primary_samples', 'trait_id', 'dataset', 'group', 'tool_used', 'form_url', 'corr_sample_method', 'corr_samples_group', 'corr_dataset', 'min_expr', 'corr_return_results', 'location_type', 'loc_chr', 'min_loc_mb', 'max_loc_mb', 'p_range_lower', 'p_range_upper'] +$(".test_corr_compute").on("click", (function(_this) { + return function() { + $('input[name=tool_used]').val("Correlation"); + $('input[name=form_url]').val("/test_corr_compute"); + $('input[name=wanted_inputs]').val(corr_input_list.join(",")); + url = "/loading"; + return submit_special(url); + }; +})(this)); + $(".corr_compute").on("click", (function(_this) { return function() { $('input[name=tool_used]').val("Correlation"); diff --git a/wqflask/wqflask/templates/show_trait_calculate_correlations.html b/wqflask/wqflask/templates/show_trait_calculate_correlations.html index 50803978..ef784c84 100644 --- a/wqflask/wqflask/templates/show_trait_calculate_correlations.html +++ b/wqflask/wqflask/templates/show_trait_calculate_correlations.html @@ -117,6 +117,9 @@ <div class="col-xs-3 controls"> <input type="button" class="btn corr_compute submit_special btn-success" data-url="/corr_compute" title="Compute Correlation" value="Compute"> </div> + <div class="col-xs-3 controls"> + <input type="button" class="btn test_corr_compute submit_special btn-success" data-url="/test_corr_compute" title="Compute Correlation" value="Test Compute"> + </div> </div> </div> </div> diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index c2e403a0..f3b0257c 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -705,7 +705,7 @@ def mapping_results_container_page(): @app.route("/loading", methods=('POST',)) def loading_page(): - logger.info(request.url) + # logger.info(request.url) initial_start_vars = request.form start_vars_container = {} n_samples = 0 # ZS: So it can be displayed on loading page @@ -948,15 +948,20 @@ def network_graph_page(): def corr_compute_page(): logger.info("In corr_compute, request.form is:", pf(request.form)) logger.info(request.url) - # template_vars = show_corr_results.CorrelationResults(request.form) - # return render_template("correlation_page.html", **template_vars.__dict__) + template_vars = show_corr_results.CorrelationResults(request.form) + return render_template("correlation_page.html", **template_vars.__dict__) # to test/disable the new correlation api uncomment these lines - correlation_results = compute_correlation(request.form) - return render_template("test_correlation_page.html",correlation_results=correlation_results) + # correlation_results = compute_correlation(request.form) + # return render_template("test_correlation_page.html", correlation_results=correlation_results) +@app.route("/test_corr_compute", methods=["POST"]) +def test_corr_compute_page(): + correlation_results = compute_correlation(request.form) + return render_template("test_correlation_page.html", correlation_results=correlation_results) + @app.route("/corr_matrix", methods=('POST',)) def corr_matrix_page(): logger.info("In corr_matrix, request.form is:", pf(request.form)) |