aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kabui2021-04-16 02:09:28 +0300
committerAlexander Kabui2021-04-16 02:09:28 +0300
commit5a9a7a645510d1385def017adf2f956d61fa2329 (patch)
treef93fd1be6f170535315e622ad39651e95c055ac5
parent328b176628ed9db6c1c60590cb10f4cca212738a (diff)
downloadgenenetwork2-5a9a7a645510d1385def017adf2f956d61fa2329.tar.gz
add demo template
-rw-r--r--wqflask/wqflask/correlation/correlation_gn3_api.py3
-rw-r--r--wqflask/wqflask/templates/demo_correlation_page.html78
-rw-r--r--wqflask/wqflask/views.py2
3 files changed, 77 insertions, 6 deletions
diff --git a/wqflask/wqflask/correlation/correlation_gn3_api.py b/wqflask/wqflask/correlation/correlation_gn3_api.py
index 8ee4a9b7..b4480076 100644
--- a/wqflask/wqflask/correlation/correlation_gn3_api.py
+++ b/wqflask/wqflask/correlation/correlation_gn3_api.py
@@ -47,11 +47,14 @@ def create_target_this_trait(start_vars):
# target_dataset.get_trait_data(list(self.sample_data.keys()))
this_trait = retrieve_sample_data(this_trait, this_dataset)
+ print(f"Starting to creat the target dataset ")
+ dataset_start_time = time.time()
target_dataset.get_trait_data(list(sample_data.keys()))
time_taken = time.time() - initial_time
+ print(f"the time taken to create dataset is",time.time()-dataset_start_time)
print(f"the time taken to create dataset abnd trait is",time_taken)
diff --git a/wqflask/wqflask/templates/demo_correlation_page.html b/wqflask/wqflask/templates/demo_correlation_page.html
index a8651067..1900a0bd 100644
--- a/wqflask/wqflask/templates/demo_correlation_page.html
+++ b/wqflask/wqflask/templates/demo_correlation_page.html
@@ -10,11 +10,79 @@
{% endblock %}
{% block content %}
<div class="container">
- {{correlation_results}}
-<!--
- {% for corr in correlation_results %}
- <div>{{corr}}</div>
- {% endfor %} -->
+ <div class="container-title">CORRELATION RESULTS</div>
+ <div class="header_content">
+ <h3>Trait_Name<h3>
+ <h3>Rho value</h3>
+ <h3>Num overlap </h3>
+ <h3>P value</h3>
+ </div>
+ <div class="container-body">
+ {% for corr_result in correlation_results %}
+ {% for key,value in corr_result.items()%}
+ <div class="container-content">
+ <div><p>trait_name_here</p></div>
+ {%for o_key,o_value in value.items()%}
+ <div><p>{{o_value}}</p></div>
+ {%endfor%}
+ {% endfor %}
+</div>
+ {% endfor %}
+</div>
</div>
+
+<style type="text/css">
+ body{
+ width: 100vw;
+ height: 100vh;
+
+ }
+ .container {
+ width: 80vw;
+ margin: 0 auto;
+ height: 100vh;
+ }
+
+ .container-title {
+ font-weight:bold;
+ width: 100%;
+ padding:5px 3px;
+ border-bottom: 2px solid #000;
+ text-align: center;
+
+ }
+
+ .header_content {
+ width: 100%;
+ display: flex;
+ justify-content: space-between;
+
+ }
+
+ .header_content h3 {
+ width: 100%;
+ }
+
+
+ .container-body {
+ max-height: 40vh;
+ width: 100%;
+ }
+
+ .container-content {
+ display: flex;
+ justify-content: space-between;
+ padding:3px 2px;
+ /*align-items: center;*/
+
+ }
+
+ .container-content div{
+ }
+
+
+
+</style>
{% endblock %}
+
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 6ca9b23f..072db466 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -882,7 +882,7 @@ def corr_compute_page():
logger.info("In corr_compute, request.form is:", pf(request.form))
logger.info(request.url)
correlation_results = compute_correlation(request.form)
- return render_template("demo_correlation_page.html",correlation_results=correlation_results)
+ return render_template("demo_correlation_page.html",correlation_results=correlation_results[1:20])
@app.route("/corr_matrix", methods=('POST',))
def corr_matrix_page():