aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristian2016-08-09 16:54:29 +0200
committerchristian2016-08-09 16:54:29 +0200
commit90b0a1b48cce713cba7ec734b8e3bd92a76484cd (patch)
tree9ef071921b00ac25815f67d6ee0e03e6b0df3a38
parent3543256d97f7e3caa04c002818db7b2ad6fec4af (diff)
downloadgenenetwork2-90b0a1b48cce713cba7ec734b8e3bd92a76484cd.tar.gz
Serve marker_regressions data as JSON file
-rw-r--r--wqflask/wqflask/views.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 55efd7e4..fa64a7b7 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -44,11 +44,12 @@ from wqflask.correlation import corr_scatter_plot
from wqflask.wgcna import wgcna_analysis
from wqflask.ctl import ctl_analysis
+from utility import webqtlUtil
from utility import temp_data
from utility.tools import SQL_URI,TEMPDIR,USE_REDIS,USE_GN_SERVER,GN_SERVER_URL
from base import webqtlFormData
-from base.webqtlConfig import GENERATED_IMAGE_DIR
+from base.webqtlConfig import GENERATED_IMAGE_DIR, GENERATED_TEXT_DIR
from utility.benchmark import Bench
from pprint import pformat as pf
@@ -196,6 +197,10 @@ def docedit():
def generated_file(filename):
return send_from_directory(GENERATED_IMAGE_DIR,filename)
+@app.route('/generated_text/<filename>')
+def generated_text(filename):
+ return send_from_directory(GENERATED_TEXT_DIR, filename)
+
@app.route("/help")
def help():
doc = docs.Docs("help")
@@ -462,6 +467,13 @@ def marker_regression_page():
default=json_default_handler,
indent=" ")
+ json_filename = webqtlUtil.genRandStr("") + ".json"
+
+ json_file = open(GENERATED_TEXT_DIR + "/" + json_filename, "w")
+ json_file.write(template_vars.js_data)
+ json_file.close()
+
+
result = template_vars.__dict__
if result['pair_scan']:
@@ -481,6 +493,7 @@ def marker_regression_page():
# logger.info(" ---**--- {}: {}".format(type(template_vars.__dict__[item]), item))
gn1_template_vars = marker_regression_gn1.MarkerRegression(result).__dict__
+ gn1_template_vars['json_filename'] = json_filename;
pickled_result = pickle.dumps(result, pickle.HIGHEST_PROTOCOL)
logger.info("pickled result length:", len(pickled_result))