about summary refs log tree commit diff
path: root/wqflask
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-05-24 14:26:12 +0300
committerFrederick Muriuki Muriithi2022-05-24 14:27:52 +0300
commit2b0fb660d26e11911b7f1888bf09dc5fa55d157f (patch)
tree863beca109a5088704c6653e47e016719a1737d1 /wqflask
parenta6e196e3c1f9af17d4f879a722d1c5f61b4d41ab (diff)
downloadgenenetwork2-2b0fb660d26e11911b7f1888bf09dc5fa55d157f.tar.gz
Handle async results. Reduce poll time.
Handle asynchronous results for partial correlation against a select
number of traits.

Reduce the polling time from 10 seconds to 5 seconds
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/partial_correlations_views.py12
-rw-r--r--wqflask/wqflask/templates/partial_correlations/pcorrs_poll_results.html2
2 files changed, 13 insertions, 1 deletions
diff --git a/wqflask/wqflask/partial_correlations_views.py b/wqflask/wqflask/partial_correlations_views.py
index cee91233..50f295cc 100644
--- a/wqflask/wqflask/partial_correlations_views.py
+++ b/wqflask/wqflask/partial_correlations_views.py
@@ -317,6 +317,18 @@ def partial_correlations():
 def process_pcorrs_command_output(result):
     if result["status"] == "success":
 
+        if result["results"]["dataset_type"] == "NOT SET YET":
+            return render_template(
+                "partial_correlations/pcorrs_results_with_target_traits.html",
+                primary = result["results"]["primary_trait"],
+                controls = result["results"]["control_traits"],
+                pcorrs = sorted(
+                    result["results"]["correlations"],
+                    key = lambda item: item["partial_corr_p_value"]),
+                method = result["results"]["method"],
+                enumerate = enumerate,
+                format_number = __format_number)
+
         return render_template(
             "partial_correlations/pcorrs_results_presentation.html",
             primary=result["results"]["primary_trait"],
diff --git a/wqflask/wqflask/templates/partial_correlations/pcorrs_poll_results.html b/wqflask/wqflask/templates/partial_correlations/pcorrs_poll_results.html
index 05bd4cbd..57a7ce99 100644
--- a/wqflask/wqflask/templates/partial_correlations/pcorrs_poll_results.html
+++ b/wqflask/wqflask/templates/partial_correlations/pcorrs_poll_results.html
@@ -4,7 +4,7 @@
 
 {%block css%}
 <meta http-equiv="refresh"
-      content="10;URL=/partial_correlations/{{command_id}}">
+      content="5;URL=/partial_correlations/{{command_id}}">
 {%endblock%}
 
 {%block content%}