From 3c341b425dad8adf532c848f81e2c867bc647b5c Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Thu, 24 Mar 2022 19:09:58 +0300 Subject: rename template to gn3_wgcna_results --- wqflask/wqflask/templates/gn3_wgcna_results.html | 165 ++++++++++++++++++++++ wqflask/wqflask/templates/test_wgcna_results.html | 165 ---------------------- wqflask/wqflask/views.py | 2 +- 3 files changed, 166 insertions(+), 166 deletions(-) create mode 100644 wqflask/wqflask/templates/gn3_wgcna_results.html delete mode 100644 wqflask/wqflask/templates/test_wgcna_results.html diff --git a/wqflask/wqflask/templates/gn3_wgcna_results.html b/wqflask/wqflask/templates/gn3_wgcna_results.html new file mode 100644 index 00000000..952f479e --- /dev/null +++ b/wqflask/wqflask/templates/gn3_wgcna_results.html @@ -0,0 +1,165 @@ +{% extends "base.html" %} +{% block title %}WCGNA results{% endblock %} +{% block content %} + + + + + + + + +
+ {% if error!='null' %} +

{{error}}

+ + {% else %} +
+
+

Soft Thresholds

+
+ + {% for key, value in results["data"]["output"]["soft_threshold"].items()%} +
+

{{key}}

+ {% for val in value %} +

{{val|round(3)}}

+ {% endfor %} +
+ {% endfor %} +
+
+ +
+ + {% if image["image_generated"] %} +
+ +
+ + {% endif %} + +
+ +
+

Module eigen genes

+
+
+ +
+

Phenotype modules

+ +
+
+
+ +{% endif %} + +
+ +{% endblock %} + +{% block js %} + + + + + + + + + +{% endblock %} \ No newline at end of file diff --git a/wqflask/wqflask/templates/test_wgcna_results.html b/wqflask/wqflask/templates/test_wgcna_results.html deleted file mode 100644 index 952f479e..00000000 --- a/wqflask/wqflask/templates/test_wgcna_results.html +++ /dev/null @@ -1,165 +0,0 @@ -{% extends "base.html" %} -{% block title %}WCGNA results{% endblock %} -{% block content %} - - - - - - - - -
- {% if error!='null' %} -

{{error}}

- - {% else %} -
-
-

Soft Thresholds

-
- - {% for key, value in results["data"]["output"]["soft_threshold"].items()%} -
-

{{key}}

- {% for val in value %} -

{{val|round(3)}}

- {% endfor %} -
- {% endfor %} -
-
- -
- - {% if image["image_generated"] %} -
- -
- - {% endif %} - -
- -
-

Module eigen genes

-
-
- -
-

Phenotype modules

- -
-
-
- -{% endif %} - -
- -{% endblock %} - -{% block js %} - - - - - - - - - -{% endblock %} \ No newline at end of file diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index b2cf95fb..31e31875 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -345,7 +345,7 @@ def wcgna_setup(): def wcgna_results(): """call the gn3 api to get wgcna response data""" results = run_wgcna(dict(request.form)) - return render_template("test_wgcna_results.html", **results) + return render_template("gn3_wgcna_results.html", **results) @app.route("/ctl_setup", methods=('POST',)) def ctl_setup(): -- cgit v1.2.3 From 12598c7a6be757efcc040e8e160190cae0af4596 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Thu, 24 Mar 2022 20:32:49 +0300 Subject: display parametric values used --- wqflask/wqflask/templates/gn3_wgcna_results.html | 44 +++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/wqflask/wqflask/templates/gn3_wgcna_results.html b/wqflask/wqflask/templates/gn3_wgcna_results.html index 952f479e..3a517954 100644 --- a/wqflask/wqflask/templates/gn3_wgcna_results.html +++ b/wqflask/wqflask/templates/gn3_wgcna_results.html @@ -75,6 +75,12 @@ {% else %}
+
+

Parameters used

+ +
+ +

Soft Thresholds

@@ -135,11 +141,47 @@ let results = {{results|safe}} +let parameters = {{parameters|safe}} + let phenoModules = results["data"]["output"]["net_colors"] let phenotypes = Object.keys(phenoModules) let phenoMods = Object.values(phenoModules) let {col_names,mod_dataset} = {{data|safe}} + +let {MinModuleSize,TOMtype,corType,mergeCutHeight} = parameters + +const summary = { + + strain_numbers:6, + + nphe:12, + + modules_found:phenoMods.length, + MinModuleSize, + TOMtype, + corType, + mergeCutHeight + +} + + $("#summary").DataTable( { + + data: Object.keys(summary).map((key)=>{ + return [key,summary[key]] + }), + columns: [ { + title: "parameter", + + }, + + { + title:" param_values" + } + ] + }) + + $('#eigens').DataTable( { data: mod_dataset, columns: col_names.map((name)=>{ @@ -162,4 +204,4 @@ let {col_names,mod_dataset} = {{data|safe}} -{% endblock %} \ No newline at end of file +{% endblock %} -- cgit v1.2.3 From 0ee7de23de1a29c909fb0a461d980f8474ecadb9 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Thu, 24 Mar 2022 22:04:53 +0300 Subject: code refactoring --- wqflask/wqflask/templates/gn3_wgcna_results.html | 21 +++------------------ wqflask/wqflask/wgcna/gn3_wgcna.py | 13 ++++++++++--- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/wqflask/wqflask/templates/gn3_wgcna_results.html b/wqflask/wqflask/templates/gn3_wgcna_results.html index 3a517954..8a31bf28 100644 --- a/wqflask/wqflask/templates/gn3_wgcna_results.html +++ b/wqflask/wqflask/templates/gn3_wgcna_results.html @@ -139,30 +139,15 @@