From 9a5fe211a846184aea7027aa90fde3fba93697e4 Mon Sep 17 00:00:00 2001 From: DannyArends Date: Mon, 23 Mar 2015 14:59:18 +0000 Subject: Updates to make GN2 work on my version of penguin (ports, and paths) --- wqflask/base/webqtlConfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'wqflask/base/webqtlConfig.py') diff --git a/wqflask/base/webqtlConfig.py b/wqflask/base/webqtlConfig.py index 23d32233..019d592b 100755 --- a/wqflask/base/webqtlConfig.py +++ b/wqflask/base/webqtlConfig.py @@ -49,7 +49,7 @@ GENOMEBROWSER_URL="http://ucscbrowser.genenetwork.org/cgi-bin/hgTracks?clade=mam ENSEMBLETRANSCRIPT_URL="http://useast.ensembl.org/Mus_musculus/Lucene/Details?species=Mus_musculus;idx=Transcript;end=1;q=%s" -GNROOT = "/home/zas1024/gene/" # Will remove this and dependent items later +GNROOT = "/home/danny/GeneNetwork/" # Will remove this and dependent items later SECUREDIR = GNROOT + 'secure/' COMMON_LIB = GNROOT + 'support/admin' HTMLPATH = GNROOT + 'web/' -- cgit v1.2.3 From 5eebf10533e0f03254a89fd886c02fed3a7e188d Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 24 Mar 2015 16:27:58 +0000 Subject: Change back port location and home directory location; this should be in external settings --- wqflask/base/webqtlConfig.py | 4 ++-- wqflask/secure_server.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'wqflask/base/webqtlConfig.py') diff --git a/wqflask/base/webqtlConfig.py b/wqflask/base/webqtlConfig.py index 019d592b..e74b9ce5 100755 --- a/wqflask/base/webqtlConfig.py +++ b/wqflask/base/webqtlConfig.py @@ -49,13 +49,13 @@ GENOMEBROWSER_URL="http://ucscbrowser.genenetwork.org/cgi-bin/hgTracks?clade=mam ENSEMBLETRANSCRIPT_URL="http://useast.ensembl.org/Mus_musculus/Lucene/Details?species=Mus_musculus;idx=Transcript;end=1;q=%s" -GNROOT = "/home/danny/GeneNetwork/" # Will remove this and dependent items later +GNROOT = "/home/zas1024/gene/" # Will remove this and dependent items later SECUREDIR = GNROOT + 'secure/' COMMON_LIB = GNROOT + 'support/admin' HTMLPATH = GNROOT + 'web/' PYLMM_PATH = '/home/zas1024/plink/' SNP_PATH = '/home/zas1024/snps/' -IMGDIR = HTMLPATH +'image/' +IMGDIR = GNROOT + '/wqflask/wqflask/images/' IMAGESPATH = HTMLPATH + 'images/' UPLOADPATH = IMAGESPATH + 'upload/' TMPDIR = '/tmp/' diff --git a/wqflask/secure_server.py b/wqflask/secure_server.py index 248559f3..975c97c0 100755 --- a/wqflask/secure_server.py +++ b/wqflask/secure_server.py @@ -72,7 +72,7 @@ if __name__ == '__main__': app.run(host='0.0.0.0', - port=5003, + port=5002, use_debugger=True, threaded=True, use_reloader=True) -- cgit v1.2.3 From 93dcba89f7e424a759e3177a74b1ce322cdd7c57 Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 25 Mar 2015 16:11:56 +0000 Subject: Pair scan image now loads properly --- wqflask/base/webqtlConfig.py | 2 +- .../wqflask/marker_regression/marker_regression.py | 6 +-- wqflask/wqflask/templates/pair_scan_results.html | 55 ++++------------------ wqflask/wqflask/templates/show_image.html | 5 ++ wqflask/wqflask/views.py | 23 ++++++++- 5 files changed, 38 insertions(+), 53 deletions(-) create mode 100644 wqflask/wqflask/templates/show_image.html (limited to 'wqflask/base/webqtlConfig.py') diff --git a/wqflask/base/webqtlConfig.py b/wqflask/base/webqtlConfig.py index e74b9ce5..49a596aa 100755 --- a/wqflask/base/webqtlConfig.py +++ b/wqflask/base/webqtlConfig.py @@ -58,7 +58,7 @@ SNP_PATH = '/home/zas1024/snps/' IMGDIR = GNROOT + '/wqflask/wqflask/images/' IMAGESPATH = HTMLPATH + 'images/' UPLOADPATH = IMAGESPATH + 'upload/' -TMPDIR = '/tmp/' +TMPDIR = '/home/zas1024/tmp/' # Will remove this and dependent items later GENODIR = HTMLPATH + 'genotypes/' NEWGENODIR = HTMLPATH + 'new_genotypes/' GENO_ARCHIVE_DIR = GENODIR + 'archive/' diff --git a/wqflask/wqflask/marker_regression/marker_regression.py b/wqflask/wqflask/marker_regression/marker_regression.py index af441489..3fb9915b 100755 --- a/wqflask/wqflask/marker_regression/marker_regression.py +++ b/wqflask/wqflask/marker_regression/marker_regression.py @@ -321,9 +321,9 @@ class MarkerRegression(object): print("No covariates"); result_data_frame = scantwo(cross_object, pheno = "the_pheno", model=self.model, method=self.method, n_cluster = 16) print("Pair scan results:", result_data_frame) - - self.pair_scan_filename = webqtlUtil.genRandStr("scantwo_") - png(file=webqtlConfig.IMGDIR+self.pair_scan_filename+".png") + + self.pair_scan_filename = webqtlUtil.genRandStr("scantwo_") + ".png" + png(file=webqtlConfig.TMPDIR+self.pair_scan_filename) plot(result_data_frame) dev_off() diff --git a/wqflask/wqflask/templates/pair_scan_results.html b/wqflask/wqflask/templates/pair_scan_results.html index a0041e11..869dabed 100644 --- a/wqflask/wqflask/templates/pair_scan_results.html +++ b/wqflask/wqflask/templates/pair_scan_results.html @@ -1,13 +1,13 @@ {% extends "base.html" %} -{% block title %}Interval Mapping{% endblock %} +{% block title %}Pair Scan{% endblock %} {% block css %} - {% endblock %} + {% block content %} {{ header("Mapping", @@ -21,7 +21,12 @@
- + + Embedded Image
@@ -31,30 +36,12 @@
- - {% endblock %} {% block js %} - - - - - - - - - @@ -62,30 +49,4 @@ - {% endblock %} \ No newline at end of file diff --git a/wqflask/wqflask/templates/show_image.html b/wqflask/wqflask/templates/show_image.html new file mode 100644 index 00000000..521f5414 --- /dev/null +++ b/wqflask/wqflask/templates/show_image.html @@ -0,0 +1,5 @@ +Embedded Image \ No newline at end of file diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 4b7bd639..7fec0456 100755 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import sys @@ -20,6 +21,8 @@ import redis Redis = redis.StrictRedis() import flask +import base64 +import array import sqlalchemy #import config @@ -83,11 +86,18 @@ def index_page(): return render_template("index_page.html") -@app.route("/tmp") -def tmp_page(): +@app.route("/tmp/") +def tmp_page(img_path): print("In tmp_page") + print("img_path:", img_path) initial_start_vars = request.form print("initial_start_vars:", initial_start_vars) + imgfile = open('/home/zas1024/tmp/' + img_path, 'rb') + imgdata = imgfile.read() + imgB64 = imgdata.encode("base64") + bytesarray = array.array('B', imgB64) + return render_template("show_image.html", + img_base64 = bytesarray ) @app.route("/data_sharing") @@ -344,6 +354,15 @@ def marker_regression_page(): with Bench("Rendering template"): if result['pair_scan'] == True: + img_path = result['pair_scan_filename'] + print("img_path:", img_path) + initial_start_vars = request.form + print("initial_start_vars:", initial_start_vars) + imgfile = open('/home/zas1024/tmp/' + img_path, 'rb') + imgdata = imgfile.read() + imgB64 = imgdata.encode("base64") + bytesarray = array.array('B', imgB64) + result['pair_scan_array'] = bytesarray rendered_template = render_template("pair_scan_results.html", **result) else: rendered_template = render_template("marker_regression.html", **result) -- cgit v1.2.3 From 1dd2981a25cdb33ab575206020490c7cf799e2da Mon Sep 17 00:00:00 2001 From: zsloan Date: Fri, 27 Mar 2015 20:32:47 +0000 Subject: Changed HTMLPATH in webqtlConfig since I forgot to in the last commit (since it used to point to the now-renamed 'web' directory). It obviously also needs to be renamed later, but I'll have to find every place that calls webqtlConfig.HTMLPATH first to do so. --- wqflask/base/webqtlConfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'wqflask/base/webqtlConfig.py') diff --git a/wqflask/base/webqtlConfig.py b/wqflask/base/webqtlConfig.py index 49a596aa..48d8cd0a 100755 --- a/wqflask/base/webqtlConfig.py +++ b/wqflask/base/webqtlConfig.py @@ -52,7 +52,7 @@ ENSEMBLETRANSCRIPT_URL="http://useast.ensembl.org/Mus_musculus/Lucene/Details?sp GNROOT = "/home/zas1024/gene/" # Will remove this and dependent items later SECUREDIR = GNROOT + 'secure/' COMMON_LIB = GNROOT + 'support/admin' -HTMLPATH = GNROOT + 'web/' +HTMLPATH = GNROOT + 'genotype_files/' PYLMM_PATH = '/home/zas1024/plink/' SNP_PATH = '/home/zas1024/snps/' IMGDIR = GNROOT + '/wqflask/wqflask/images/' -- cgit v1.2.3