From e17ad8ac7b41ae79da2d4081d52686cef0e287b3 Mon Sep 17 00:00:00 2001 From: DannyArends Date: Wed, 8 Feb 2017 09:47:47 +0100 Subject: Renamed the analysis code files to include the word analysis to not conflict with the routes in views.py --- wqflask/wqflask/auwerx/__init__.py | 0 wqflask/wqflask/auwerx/ephewas.py | 40 ---------------------------- wqflask/wqflask/auwerx/ephewas_analysis.py | 40 ++++++++++++++++++++++++++++ wqflask/wqflask/auwerx/mediation.py | 40 ---------------------------- wqflask/wqflask/auwerx/mediation_analysis.py | 40 ++++++++++++++++++++++++++++ wqflask/wqflask/auwerx/phewas.py | 40 ---------------------------- wqflask/wqflask/auwerx/phewas_analysis.py | 40 ++++++++++++++++++++++++++++ wqflask/wqflask/views.py | 6 ++++- 8 files changed, 125 insertions(+), 121 deletions(-) create mode 100644 wqflask/wqflask/auwerx/__init__.py delete mode 100644 wqflask/wqflask/auwerx/ephewas.py create mode 100644 wqflask/wqflask/auwerx/ephewas_analysis.py delete mode 100644 wqflask/wqflask/auwerx/mediation.py create mode 100644 wqflask/wqflask/auwerx/mediation_analysis.py delete mode 100644 wqflask/wqflask/auwerx/phewas.py create mode 100644 wqflask/wqflask/auwerx/phewas_analysis.py diff --git a/wqflask/wqflask/auwerx/__init__.py b/wqflask/wqflask/auwerx/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/wqflask/wqflask/auwerx/ephewas.py b/wqflask/wqflask/auwerx/ephewas.py deleted file mode 100644 index edfb2801..00000000 --- a/wqflask/wqflask/auwerx/ephewas.py +++ /dev/null @@ -1,40 +0,0 @@ -# PheWAS analysis for GN2 -# Author / Maintainer: Li Hao & Danny Arends -import sys -from numpy import * -import scipy as sp # SciPy -import rpy2.robjects as ro # R Objects -import rpy2.rinterface as ri - -from base.webqtlConfig import GENERATED_IMAGE_DIR -from utility import webqtlUtil # Random number for the image -from utility import genofile_parser # genofile_parser - -import base64 -import array -import csv -import itertools - -from base import data_set -from base import trait as TRAIT - -from utility import helper_functions -from utility.tools import locate - -from rpy2.robjects.packages import importr -utils = importr("utils") - -class EPheWAS(object): - def __init__(self): - print("Initialization of ePheWAS") - print("Initialization of ePheWAS done !") - - def run_analysis(self, requestform): - print("Starting ePheWAS analysis on dataset") - print("Initialization of ePheWAS done !") - - def process_results(self, results): - print("Processing ePheWAS output") - template_vars = {} - return(dict(template_vars)) - diff --git a/wqflask/wqflask/auwerx/ephewas_analysis.py b/wqflask/wqflask/auwerx/ephewas_analysis.py new file mode 100644 index 00000000..edfb2801 --- /dev/null +++ b/wqflask/wqflask/auwerx/ephewas_analysis.py @@ -0,0 +1,40 @@ +# PheWAS analysis for GN2 +# Author / Maintainer: Li Hao & Danny Arends +import sys +from numpy import * +import scipy as sp # SciPy +import rpy2.robjects as ro # R Objects +import rpy2.rinterface as ri + +from base.webqtlConfig import GENERATED_IMAGE_DIR +from utility import webqtlUtil # Random number for the image +from utility import genofile_parser # genofile_parser + +import base64 +import array +import csv +import itertools + +from base import data_set +from base import trait as TRAIT + +from utility import helper_functions +from utility.tools import locate + +from rpy2.robjects.packages import importr +utils = importr("utils") + +class EPheWAS(object): + def __init__(self): + print("Initialization of ePheWAS") + print("Initialization of ePheWAS done !") + + def run_analysis(self, requestform): + print("Starting ePheWAS analysis on dataset") + print("Initialization of ePheWAS done !") + + def process_results(self, results): + print("Processing ePheWAS output") + template_vars = {} + return(dict(template_vars)) + diff --git a/wqflask/wqflask/auwerx/mediation.py b/wqflask/wqflask/auwerx/mediation.py deleted file mode 100644 index 48d02dc2..00000000 --- a/wqflask/wqflask/auwerx/mediation.py +++ /dev/null @@ -1,40 +0,0 @@ -# PheWAS analysis for GN2 -# Author / Maintainer: Li Hao & Danny Arends -import sys -from numpy import * -import scipy as sp # SciPy -import rpy2.robjects as ro # R Objects -import rpy2.rinterface as ri - -from base.webqtlConfig import GENERATED_IMAGE_DIR -from utility import webqtlUtil # Random number for the image -from utility import genofile_parser # genofile_parser - -import base64 -import array -import csv -import itertools - -from base import data_set -from base import trait as TRAIT - -from utility import helper_functions -from utility.tools import locate - -from rpy2.robjects.packages import importr -utils = importr("utils") - -class Mediation(object): - def __init__(self): - print("Initialization of Mediation") - print("Initialization of Mediation done !") - - def run_analysis(self, requestform): - print("Starting Mediation analysis on dataset") - print("Initialization of Mediation done !") - - def process_results(self, results): - print("Processing Mediation output") - template_vars = {} - return(dict(template_vars)) - diff --git a/wqflask/wqflask/auwerx/mediation_analysis.py b/wqflask/wqflask/auwerx/mediation_analysis.py new file mode 100644 index 00000000..48d02dc2 --- /dev/null +++ b/wqflask/wqflask/auwerx/mediation_analysis.py @@ -0,0 +1,40 @@ +# PheWAS analysis for GN2 +# Author / Maintainer: Li Hao & Danny Arends +import sys +from numpy import * +import scipy as sp # SciPy +import rpy2.robjects as ro # R Objects +import rpy2.rinterface as ri + +from base.webqtlConfig import GENERATED_IMAGE_DIR +from utility import webqtlUtil # Random number for the image +from utility import genofile_parser # genofile_parser + +import base64 +import array +import csv +import itertools + +from base import data_set +from base import trait as TRAIT + +from utility import helper_functions +from utility.tools import locate + +from rpy2.robjects.packages import importr +utils = importr("utils") + +class Mediation(object): + def __init__(self): + print("Initialization of Mediation") + print("Initialization of Mediation done !") + + def run_analysis(self, requestform): + print("Starting Mediation analysis on dataset") + print("Initialization of Mediation done !") + + def process_results(self, results): + print("Processing Mediation output") + template_vars = {} + return(dict(template_vars)) + diff --git a/wqflask/wqflask/auwerx/phewas.py b/wqflask/wqflask/auwerx/phewas.py deleted file mode 100644 index 399e056c..00000000 --- a/wqflask/wqflask/auwerx/phewas.py +++ /dev/null @@ -1,40 +0,0 @@ -# PheWAS analysis for GN2 -# Author / Maintainer: Li Hao & Danny Arends -import sys -from numpy import * -import scipy as sp # SciPy -import rpy2.robjects as ro # R Objects -import rpy2.rinterface as ri - -from base.webqtlConfig import GENERATED_IMAGE_DIR -from utility import webqtlUtil # Random number for the image -from utility import genofile_parser # genofile_parser - -import base64 -import array -import csv -import itertools - -from base import data_set -from base import trait as TRAIT - -from utility import helper_functions -from utility.tools import locate - -from rpy2.robjects.packages import importr -utils = importr("utils") - -class PheWAS(object): - def __init__(self): - print("Initialization of PheWAS") - print("Initialization of PheWAS done !") - - def run_analysis(self, requestform): - print("Starting PheWAS analysis on dataset") - print("Initialization of PheWAS done !") - - def process_results(self, results): - print("Processing PheWAS output") - template_vars = {} - return(dict(template_vars)) - diff --git a/wqflask/wqflask/auwerx/phewas_analysis.py b/wqflask/wqflask/auwerx/phewas_analysis.py new file mode 100644 index 00000000..399e056c --- /dev/null +++ b/wqflask/wqflask/auwerx/phewas_analysis.py @@ -0,0 +1,40 @@ +# PheWAS analysis for GN2 +# Author / Maintainer: Li Hao & Danny Arends +import sys +from numpy import * +import scipy as sp # SciPy +import rpy2.robjects as ro # R Objects +import rpy2.rinterface as ri + +from base.webqtlConfig import GENERATED_IMAGE_DIR +from utility import webqtlUtil # Random number for the image +from utility import genofile_parser # genofile_parser + +import base64 +import array +import csv +import itertools + +from base import data_set +from base import trait as TRAIT + +from utility import helper_functions +from utility.tools import locate + +from rpy2.robjects.packages import importr +utils = importr("utils") + +class PheWAS(object): + def __init__(self): + print("Initialization of PheWAS") + print("Initialization of PheWAS done !") + + def run_analysis(self, requestform): + print("Starting PheWAS analysis on dataset") + print("Initialization of PheWAS done !") + + def process_results(self, results): + print("Processing PheWAS output") + template_vars = {} + return(dict(template_vars)) + diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 91e2ffb2..047982bf 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -49,6 +49,7 @@ from wqflask.correlation_matrix import show_corr_matrix from wqflask.correlation import corr_scatter_plot from wqflask.wgcna import wgcna_analysis from wqflask.ctl import ctl_analysis +from wqflask.auwerx import phewas_analysis from utility import temp_data from utility.tools import SQL_URI,TEMPDIR,USE_REDIS,USE_GN_SERVER,GN_SERVER_URL @@ -249,7 +250,10 @@ def wcgna_results(): @app.route("/phewas", methods=('POST',)) def phewas(): logger.info("In phewas, request.form is:", request.form) # We are going to get additional user input for the analysis - return render_template("phewas_analysis.html", **request.form) # Display them using the template + phewasO = phewas_analysis.PheWAS() # Start R, load the package and pointers and create the analysis + phewasA = phewasO.run_analysis(request.form) + result = phewasO.process_results(phewasA) # After the analysis is finished store the result + return render_template("phewas_analysis.html", **result) # Display them using the template @app.route("/ephewas", methods=('POST',)) def ephewas(): -- cgit v1.2.3