-
-
{% 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 @@
+
\ 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 a840ad18e1fe3db98a359a159e9b9b72367a2839 Mon Sep 17 00:00:00 2001
From: zsloan
Date: Thu, 26 Mar 2015 21:24:24 +0000
Subject: Removed several unused files from the base folder and their
references in other files
---
wqflask/base/GeneralObject.py | 68 -----
wqflask/base/JinjaPage.py | 28 --
wqflask/base/admin.py | 86 ------
wqflask/base/cgiData.py | 66 -----
wqflask/base/cookieData.py | 49 ----
wqflask/base/footer.py | 6 -
wqflask/base/generate_probesetfreeze_file.py | 31 ---
wqflask/base/header.py | 6 -
wqflask/base/indexBody.py | 290 ---------------------
wqflask/base/myCookie.py | 51 ----
wqflask/base/sessionData.py | 50 ----
wqflask/base/templatePage.py | 222 ----------------
wqflask/base/webqtlFormData.py | 6 -
wqflask/wqflask/search_results.py | 2 -
.../static/new/javascript/css/bar_chart.css | 15 --
.../wqflask/static/new/javascript/css/box_plot.css | 20 --
.../wqflask/static/new/javascript/css/charts.css | 28 --
.../static/new/javascript/css/corr_matrix.css | 12 -
.../new/javascript/css/corr_scatter_plot.css | 13 -
.../static/new/javascript/css/d3-tip.min.css | 1 -
.../static/new/javascript/css/interval_mapping.css | 32 ---
wqflask/wqflask/static/new/javascript/css/main.css | 4 -
.../new/javascript/css/marker_regression.css | 38 ---
.../static/new/javascript/css/panelutil.css | 91 -------
.../wqflask/static/new/javascript/css/parsley.css | 20 --
.../static/new/javascript/css/scatter-matrix.css | 40 ---
.../static/new/javascript/css/show_trait.css | 7 -
.../wqflask/static/new/javascript/css/table.css | 36 ---
28 files changed, 1318 deletions(-)
delete mode 100755 wqflask/base/GeneralObject.py
delete mode 100755 wqflask/base/JinjaPage.py
delete mode 100755 wqflask/base/admin.py
delete mode 100755 wqflask/base/cgiData.py
delete mode 100755 wqflask/base/cookieData.py
delete mode 100755 wqflask/base/footer.py
delete mode 100755 wqflask/base/generate_probesetfreeze_file.py
delete mode 100755 wqflask/base/header.py
delete mode 100755 wqflask/base/indexBody.py
delete mode 100755 wqflask/base/myCookie.py
delete mode 100755 wqflask/base/sessionData.py
delete mode 100755 wqflask/base/templatePage.py
delete mode 100755 wqflask/wqflask/static/new/javascript/css/bar_chart.css
delete mode 100755 wqflask/wqflask/static/new/javascript/css/box_plot.css
delete mode 100644 wqflask/wqflask/static/new/javascript/css/charts.css
delete mode 100755 wqflask/wqflask/static/new/javascript/css/corr_matrix.css
delete mode 100755 wqflask/wqflask/static/new/javascript/css/corr_scatter_plot.css
delete mode 100644 wqflask/wqflask/static/new/javascript/css/d3-tip.min.css
delete mode 100755 wqflask/wqflask/static/new/javascript/css/interval_mapping.css
delete mode 100755 wqflask/wqflask/static/new/javascript/css/main.css
delete mode 100755 wqflask/wqflask/static/new/javascript/css/marker_regression.css
delete mode 100644 wqflask/wqflask/static/new/javascript/css/panelutil.css
delete mode 100755 wqflask/wqflask/static/new/javascript/css/parsley.css
delete mode 100644 wqflask/wqflask/static/new/javascript/css/scatter-matrix.css
delete mode 100644 wqflask/wqflask/static/new/javascript/css/show_trait.css
delete mode 100755 wqflask/wqflask/static/new/javascript/css/table.css
(limited to 'wqflask/base')
diff --git a/wqflask/base/GeneralObject.py b/wqflask/base/GeneralObject.py
deleted file mode 100755
index 53d1357b..00000000
--- a/wqflask/base/GeneralObject.py
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright (C) University of Tennessee Health Science Center, Memphis, TN.
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Affero General Public License
-# as published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the GNU Affero General Public License for more details.
-#
-# This program is available from Source Forge: at GeneNetwork Project
-# (sourceforge.net/projects/genenetwork/).
-#
-# Contact Drs. Robert W. Williams and Xiaodong Zhou (2010)
-# at rwilliams@uthsc.edu and xzhou15@uthsc.edu
-#
-#
-#
-# This module is used by GeneNetwork project (www.genenetwork.org)
-#
-# Created by GeneNetwork Core Team 2010/08/10
-#
-# Last updated by GeneNetwork Core Team 2010/10/20
-
-class GeneralObject:
- """
- Base class to define an Object.
- a = [Spam(1, 4), Spam(9, 3), Spam(4,6)]
- a.sort(lambda x, y: cmp(x.eggs, y.eggs))
- """
-
- def __init__(self, *args, **kw):
- self.contents = list(args)
- for name, value in kw.items():
- setattr(self, name, value)
-
- def __setitem__(self, key, value):
- setattr(self, key, value)
-
- def __getitem__(self, key):
- return getattr(self, key)
-
- def __getattr__(self, key):
- if key in self.__dict__.keys():
- return self.__dict__[key]
- else:
- return eval("self.__dict__.%s" % key)
-
- def __len__(self):
- return len(self.__dict__) - 1
-
- def __str__(self):
- s = ''
- for key in self.__dict__.keys():
- if key != 'contents':
- s += '%s = %s\n' % (key,self.__dict__[key])
- return s
-
- def __repr__(self):
- s = ''
- for key in self.__dict__.keys():
- s += '%s = %s\n' % (key,self.__dict__[key])
- return s
-
- def __cmp__(self,other):
- return len(self.__dict__.keys()).__cmp__(len(other.__dict__.keys()))
diff --git a/wqflask/base/JinjaPage.py b/wqflask/base/JinjaPage.py
deleted file mode 100755
index 07e485b1..00000000
--- a/wqflask/base/JinjaPage.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import logging
-logging.basicConfig(filename="/tmp/gn_log", level=logging.INFO)
-_log = logging.getLogger("search")
-
-from pprint import pformat as pf
-
-import templatePage
-
-from utility import formatting
-
-import jinja2
-JinjaEnv = jinja2.Environment(loader=jinja2.FileSystemLoader('/gnshare/gn/web/webqtl/templates'))
-JinjaEnv.globals['numify'] = formatting.numify
-
-
-class JinjaPage(templatePage.templatePage):
- """Class derived from our regular templatePage, but uses Jinja2 instead.
-
- When converting pages from Python generated templates, change the base class from templatePage
- to JinjaPage
-
- """
-
-
- def write(self):
- """We override the base template write so we can use Jinja2."""
- _log.info(pf(self.__dict__))
- return self.jtemplate.render(**self.__dict__)
diff --git a/wqflask/base/admin.py b/wqflask/base/admin.py
deleted file mode 100755
index 1ba75117..00000000
--- a/wqflask/base/admin.py
+++ /dev/null
@@ -1,86 +0,0 @@
-# Copyright (C) University of Tennessee Health Science Center, Memphis, TN.
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Affero General Public License
-# as published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the GNU Affero General Public License for more details.
-#
-# This program is available from Source Forge: at GeneNetwork Project
-# (sourceforge.net/projects/genenetwork/).
-#
-# Contact Drs. Robert W. Williams and Xiaodong Zhou (2010)
-# at rwilliams@uthsc.edu and xzhou15@uthsc.edu
-#
-#
-#
-# This module is used by GeneNetwork project (www.genenetwork.org)
-#
-# Created by GeneNetwork Core Team 2010/08/10
-#
-# Last updated by GeneNetwork Core Team 2010/10/20
-
-
-
-
-
-#XZ, 04/02/2009: we should put this into database.
-
-
-###LIST of databases used into gene name query
-
-
-ADMIN_search_dbs = {
- 'rat': {'PERITONEAL FAT': ['FT_2A_0605_Rz'],
- 'KIDNEY': ['KI_2A_0405_Rz'],
- 'ADRENAL GLAND': ['HXB_Adrenal_1208'],
- 'HEART': ['HXB_Heart_1208']
- },
- 'mouse': {'CEREBELLUM': ['CB_M_0305_R'],
- 'STRIATUM': ['SA_M2_0905_R', 'SA_M2_0405_RC', 'UTHSC_1107_RankInv', 'Striatum_Exon_0209'],
- 'HIPPOCAMPUS': ['HC_M2_0606_R', 'UMUTAffyExon_0209_RMA'],
- 'WHOLE BRAIN': ['BR_M2_1106_R', 'IBR_M_0106_R', 'BRF2_M_0805_R', 'UCLA_BHF2_BRAIN_0605'],
- 'LIVER': ['LV_G_0106_B', 'UCLA_BHF2_LIVER_0605'],
- 'EYE': ['Eye_M2_0908_R'],
- 'HEMATOPOIETIC STEM CELLS': ['HC_U_0304_R'],
- 'KIDNEY': ['MA_M2_0806_R'],
- 'MAMMARY TUMORS': ['MA_M_0704_R', 'NCI_Agil_Mam_Tum_RMA_0409'],
- 'PREFRONTAL CORTEX': ['VCUSal_1206_R'],
- 'SPLEEN': ['IoP_SPL_RMA_0509'],
- 'NUCLEUS ACCUMBENS': ['VCUSalo_1007_R'],
- 'NEOCORTEX': ['HQFNeoc_0208_RankInv'],
- 'ADIPOSE': ['UCLA_BHF2_ADIPOSE_0605'],
- 'RETINA': ['Illum_Retina_BXD_RankInv0410']
- },
- 'human': {
- 'LYMPHOBLAST B CELL': ['Human_1008', 'UT_CEPH_RankInv0909'],
- 'WHOLE BRAIN': ['GSE5281_F_RMA0709', 'GSE15222_F_RI_0409']
- }
- }
-
-
-###LIST of tissue alias
-
-ADMIN_tissue_alias = {'CEREBELLUM': ['Cb'],
- 'STRIATUM': ['Str'],
- 'HIPPOCAMPUS': ['Hip'],
- 'WHOLE BRAIN': ['Brn'],
- 'LIVER': ['Liv'],
- 'EYE': ['Eye'],
- 'PERITONEAL FAT': ['Fat'],
- 'HEMATOPOIETIC STEM CELLS': ['Hsc'],
- 'KIDNEY': ['Kid'],
- 'ADRENAL GLAND': ['Adr'],
- 'HEART': ['Hea'],
- 'MAMMARY TUMORS': ['Mam'],
- 'PREFRONTAL CORTEX': ['Pfc'],
- 'SPLEEN': ['Spl'],
- 'NUCLEUS ACCUMBENS': ['Nac'],
- 'NEOCORTEX': ['Ctx'],
- 'ADIPOSE': ['Wfat'],
- 'RETINA': ['Ret']
- }
diff --git a/wqflask/base/cgiData.py b/wqflask/base/cgiData.py
deleted file mode 100755
index 155b3ec3..00000000
--- a/wqflask/base/cgiData.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright (C) University of Tennessee Health Science Center, Memphis, TN.
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Affero General Public License
-# as published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the GNU Affero General Public License for more details.
-#
-# This program is available from Source Forge: at GeneNetwork Project
-# (sourceforge.net/projects/genenetwork/).
-#
-# Contact Drs. Robert W. Williams and Xiaodong Zhou (2010)
-# at rwilliams@uthsc.edu and xzhou15@uthsc.edu
-#
-#
-#
-# This module is used by GeneNetwork project (www.genenetwork.org)
-#
-# Created by GeneNetwork Core Team 2010/08/10
-#
-# Last updated by GeneNetwork Core Team 2010/10/20
-
-#########################################
-#convert Field storage object to Dict object
-#in order to be able to saved into a session file
-#########################################
-
-class cgiData(dict):
- '''convert Field storage object to Dict object
- Filed storage object cannot be properly dumped
- '''
-
- def __init__(self, field_storage=None):
-
- if not field_storage:
- field_storage={}
-
- for key in field_storage.keys():
- temp = field_storage.getlist(key)
- if len(temp) > 1:
- temp = map(self.toValue, temp)
- elif len(temp) == 1:
- temp = self.toValue(temp[0])
- else:
- temp = None
- self[key]= temp
-
- def toValue(self, obj):
- '''fieldstorge returns different type of objects, \
- need to convert to string or None'''
- try:
- return obj.value
- except:
- return ""
-
- def getvalue(self, k, default= None):
- try:
- return self[k]
- except:
- return default
-
- getfirst = getvalue
diff --git a/wqflask/base/cookieData.py b/wqflask/base/cookieData.py
deleted file mode 100755
index eeb7c0cf..00000000
--- a/wqflask/base/cookieData.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright (C) University of Tennessee Health Science Center, Memphis, TN.
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Affero General Public License
-# as published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the GNU Affero General Public License for more details.
-#
-# This program is available from Source Forge: at GeneNetwork Project
-# (sourceforge.net/projects/genenetwork/).
-#
-# Contact Drs. Robert W. Williams and Xiaodong Zhou (2010)
-# at rwilliams@uthsc.edu and xzhou15@uthsc.edu
-#
-#
-#
-# This module is used by GeneNetwork project (www.genenetwork.org)
-#
-# Created by GeneNetwork Core Team 2010/08/10
-#
-# Last updated by GeneNetwork Core Team 2010/10/20
-
-#########################################
-#convert mod_python object to Dict object
-#in order to be able to be pickled
-#########################################
-
-class cookieData(dict):
- 'convert mod python Cookie object to Dict object'
-
- def __init__(self, cookies=None):
-
- if not cookies:
- cookies={}
-
- for key in cookies.keys():
- self[key.lower()]= cookies[key].value
-
- def getvalue(self, k, default= None):
- try:
- return self[k.lower()]
- except:
- return default
-
- getfirst = getvalue
diff --git a/wqflask/base/footer.py b/wqflask/base/footer.py
deleted file mode 100755
index 6f92fdf8..00000000
--- a/wqflask/base/footer.py
+++ /dev/null
@@ -1,6 +0,0 @@
-import webqtlConfig
-
-footer_html = open(webqtlConfig.HTMLPATH + 'footer.html', 'r').read()
-footer = footer_html.replace('%"','%%"')
-
-footer_string = footer.replace('', '%s')
diff --git a/wqflask/base/generate_probesetfreeze_file.py b/wqflask/base/generate_probesetfreeze_file.py
deleted file mode 100755
index a0ff804b..00000000
--- a/wqflask/base/generate_probesetfreeze_file.py
+++ /dev/null
@@ -1,31 +0,0 @@
-from __future__ import absolute_import, print_function, division
-import os
-import math
-
-import json
-import itertools
-
-from flask import Flask, g
-
-from base import webqtlConfig
-from dbFunction import webqtlDatabaseFunction
-from utility import webqtlUtil
-
-from MySQLdb import escape_string as escape
-from pprint import pformat as pf
-
-
-query = """ select ProbeSet.Name
- from ProbeSetXRef,
- ProbeSetFreeze,
- ProbeSet
- where ProbeSetXRef.ProbeSetFreezeId = ProbeSetFreeze.Id and
- ProbeSetFreeze.Name = "EPFLMouseMuscleCDRMA1211" and
- ProbeSetXRef.ProbeSetId = ProbeSet.Id;
- """
-
-markers = g.db.execute(query).fetchall()
-print("markers: ", pf(markers))
-
-if __name__ == '__main__':
- main()
\ No newline at end of file
diff --git a/wqflask/base/header.py b/wqflask/base/header.py
deleted file mode 100755
index ec15e174..00000000
--- a/wqflask/base/header.py
+++ /dev/null
@@ -1,6 +0,0 @@
-import webqtlConfig
-
-header_string = open(webqtlConfig.HTMLPATH + 'header.html', 'r').read()
-header_string = header_string.replace("\\'", "'")
-header_string = header_string.replace('%"','%%"')
-header_string = header_string.replace('', '%s')
diff --git a/wqflask/base/indexBody.py b/wqflask/base/indexBody.py
deleted file mode 100755
index a5bc4c17..00000000
--- a/wqflask/base/indexBody.py
+++ /dev/null
@@ -1,290 +0,0 @@
-index_body_string = """
-
-
-
- You can also use advanced commands. Copy these simple examples
- into the Get Any or Combined search fields:
-
-
-
POSITION=(chr1 25 30) finds genes, markers, or transcripts on chromosome 1 between 25 and 30 Mb.
-
-
MEAN=(15 16) LRS=(23 46) in the Combined field finds highly expressed genes (15 to 16 log2 units) AND with peak LRS linkage between 23 and 46.
-
-
-
RIF=mitochondrial searches RNA databases for GeneRIF links.
-
-
WIKI=nicotine searches GeneWiki for genes that you or other users have annotated with the word nicotine.
-
-
GO:0045202 searches for synapse-associated genes listed in the Gene Ontology.
-
-
-
GO:0045202 LRS=(9 99 Chr4 122 155) cisLRS=(9 999 10) in Combined finds synapse-associated genes with cis eQTL on Chr 4 from 122 and 155 Mb with LRS scores between 9 and 999.
-
-
RIF=diabetes LRS=(9 999 Chr2 100 105) transLRS=(9 999 10) in Combined finds diabetes-associated transcripts with peak trans eQTLs on Chr 2 between 100 and 105 Mb with LRS scores between 9 and 999.
-
-
-