From 51faf9a4c018e45e738c6a1fe3e4ea7f05702f56 Mon Sep 17 00:00:00 2001 From: DannyArends Date: Fri, 11 Sep 2015 20:04:30 +0200 Subject: 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 --- wqflask/wqflask/templates/wgcna_results.html | 1 + wqflask/wqflask/views.py | 6 ++++-- 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 %}

WGCNA Results

+ {{result}}
{% 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(): -- cgit v1.2.3