aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDannyArends2015-09-11 20:04:30 +0200
committerDannyArends2015-09-11 20:04:30 +0200
commit51faf9a4c018e45e738c6a1fe3e4ea7f05702f56 (patch)
treee7d062fb97857c862278ede26914dfdc418f069b
parent376d7b935a6496386bc7a906f1ed67215aeb1428 (diff)
downloadgenenetwork2-51faf9a4c018e45e738c6a1fe3e4ea7f05702f56.tar.gz
Figured out how those flask templates work, analysis broken down into 3 parts, WGCNA R package installs and loads succesfully in the gn2-docker image
-rw-r--r--wqflask/wqflask/templates/wgcna_results.html1
-rwxr-xr-xwqflask/wqflask/views.py6
2 files changed, 5 insertions, 2 deletions
diff --git a/wqflask/wqflask/templates/wgcna_results.html b/wqflask/wqflask/templates/wgcna_results.html
index 2226f90c..5d654e94 100644
--- a/wqflask/wqflask/templates/wgcna_results.html
+++ b/wqflask/wqflask/templates/wgcna_results.html
@@ -4,6 +4,7 @@
{% block content %} <!-- Start of body -->
<div>
<h1>WGCNA Results</h1>
+ {{result}}
</div>
{% endblock %}
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index cd186078..cb7caf51 100755
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -180,8 +180,10 @@ def help():
@app.route("/wgcna", methods=('POST',))
def wcgna():
print("In wgcna, request.form is:", request.form)
- template_vars = wgcna_analysis.WGCNA(request.form)
- return render_template("wgcna_results.html")
+ wgcna = wgcna_analysis.WGCNA() # Start R, load the package and pointers and create the analysis
+ wgcnaA = wgcna.run_analysis(request.form) # Start the analysis, a wgcnaA object should be a separate long running thread
+ result = wgcna.process_results(wgcnaA) # After the analysis is finished store the result
+ return render_template("wgcna_results.html", **result) # Display them using the template
@app.route("/news")
def news_route():