aboutsummaryrefslogtreecommitdiff
path: root/wqflask/wqflask
diff options
context:
space:
mode:
authorzsloan2018-04-09 23:07:33 +0000
committerzsloan2018-04-09 23:07:33 +0000
commit23ef6a91c1dce4c9258dfb2bc24ee7e0004f509d (patch)
tree15c04aaa974e8b6eea087c0fab5947763d774795 /wqflask/wqflask
parentbd6d36ddb366a3ee427a0c237ebf8f672606ff19 (diff)
downloadgenenetwork2-23ef6a91c1dce4c9258dfb2bc24ee7e0004f509d.tar.gz
Removed svg.py, which I know isn't used, and webqtlFormData, which I'm pretty sure also isn't used any more.
Also removed some other unused code from the files listed
Diffstat (limited to 'wqflask/wqflask')
-rw-r--r--wqflask/wqflask/correlation/show_corr_results.py52
-rw-r--r--wqflask/wqflask/marker_regression/marker_regression_gn1.py16
-rw-r--r--wqflask/wqflask/views.py80
3 files changed, 22 insertions, 126 deletions
diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py
index 73072423..abf9fc89 100644
--- a/wqflask/wqflask/correlation/show_corr_results.py
+++ b/wqflask/wqflask/correlation/show_corr_results.py
@@ -296,60 +296,8 @@ class CorrelationResults(object):
if self.corr_type != "tissue" and self.dataset.type == "ProbeSet" and self.target_dataset.type == "ProbeSet":
self.do_tissue_correlation_for_trait_list()
- #print("self.correlation_results: ", pf(self.correlation_results))
-
self.json_results = generate_corr_json(self.correlation_results, self.this_trait, self.dataset, self.target_dataset)
- #XZ, 09/18/2008: get all information about the user selected database.
- #target_db_name = fd.corr_dataset
- #self.target_db_name = start_vars['corr_dataset']
-
- # Zach said this is ok
- # Auth if needed
- #try:
- # auth_user_for_db(self.db, self.cursor, self.target_db_name, self.privilege, self.userName)
- #except AuthException as e:
- # detail = [e.message]
- # return self.error(detail)
-
- #XZ, 09/18/2008: filter out the strains that have no value.
- #self.sample_names, vals, vars, N = fd.informativeStrains(sample_list)
-
- #print("samplenames is:", pf(self.sample_names))
- #CF - If less than a minimum number of strains/cases in common, don't calculate anything
- #if len(self.sample_names) < self.corr_min_informative:
- # detail = ['Fewer than %d strain data were entered for %s data set. No calculation of correlation has been attempted.' % (self.corr_min_informative, fd.RISet)]
- # self.error(heading=None, detail=detail)
-
- #correlation_method = self.CORRELATION_METHODS[self.method]
- #rankOrder = self.RANK_ORDERS[self.method]
-
- # CF - Number of results returned
- # Todo: Get rid of self.returnNumber
-
- #self.record_count = 0
-
- #myTrait = get_custom_trait(fd, self.cursor)
-
-
- # We will not get Literature Correlations if there is no GeneId because there is nothing
- # to look against
- #self.geneid = self.this_trait.geneid
-
- # We will not get Tissue Correlations if there is no gene symbol because there is nothing to look against
- #self.trait_symbol = myTrait.symbol
-
-
- #XZ, 12/12/2008: if the species is rat or human, translate the geneid to mouse geneid
- #self.input_trait_mouse_gene_id = self.translateToMouseGeneID(self.dataset.group.species, self.geneid)
-
- #XZ: As of Nov/13/2010, this dataset is 'UTHSC Illumina V6.2 RankInv B6 D2 average CNS GI average (May 08)'
- #self.tissue_probeset_freeze_id = 1
-
- #traitList = self.correlate()
-
- #print("Done doing correlation calculation")
-
############################################################################################################################################
def get_formatted_corr_type(self):
diff --git a/wqflask/wqflask/marker_regression/marker_regression_gn1.py b/wqflask/wqflask/marker_regression/marker_regression_gn1.py
index 632c2f8f..81da8976 100644
--- a/wqflask/wqflask/marker_regression/marker_regression_gn1.py
+++ b/wqflask/wqflask/marker_regression/marker_regression_gn1.py
@@ -190,21 +190,6 @@ class MarkerRegression(object):
self.js_data = start_vars['js_data']
self.trimmed_markers = start_vars['trimmed_markers'] #Top markers to display in table
- #ZS: Think I can just get all this from dataset object now
- #RISet and Species
- #if not fd.genotype:
- # fd.readGenotype()
- #
- #fd.parentsf14regression = fd.formdata.getvalue('parentsf14regression')
- #
- #if ((fd.parentsf14regression == 'on') and fd.genotype_2):
- # fd.genotype = fd.genotype_2
- #else:
- # fd.genotype = fd.genotype_1
- #fd.strainlist = list(fd.genotype.prgy)
- #
- #self.species = webqtlDatabaseFunction.retrieveSpecies(cursor=self.cursor, RISet=fd.RISet)
-
if self.dataset.group.species == "rat":
self._ucscDb = "rn3"
elif self.dataset.group.species == "mouse":
@@ -212,7 +197,6 @@ class MarkerRegression(object):
else:
self._ucscDb = ""
-
#####################################
# Options
#####################################
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 3c2cca94..8ff359a7 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -57,7 +57,6 @@ from utility import temp_data
from utility.tools import SQL_URI,TEMPDIR,USE_REDIS,USE_GN_SERVER,GN_SERVER_URL,GN_VERSION,JS_TWITTER_POST_FETCHER_PATH,JS_GUIX_PATH, CSS_PATH
from utility.helper_functions import get_species_groups
-from base import webqtlFormData
from base.webqtlConfig import GENERATED_IMAGE_DIR
from utility.benchmark import Bench
@@ -163,62 +162,37 @@ def css(filename):
def twitter(filename):
return send_from_directory(JS_TWITTER_POST_FETCHER_PATH, filename)
-#@app.route("/data_sharing")
-#def data_sharing_page():
-# logger.info("In data_sharing")
-# fd = webqtlFormData.webqtlFormData(request.args)
-# logger.info("1Have fd")
-# sharingInfoObject = SharingInfo.SharingInfo(request.args['GN_AccessionId'], None)
-# info, htmlfilelist = sharingInfoObject.getBody(infoupdate="")
-# logger.info("type(htmlfilelist):", type(htmlfilelist))
-# htmlfilelist = htmlfilelist.encode("utf-8")
-# #template_vars = SharingInfo.SharingInfo(request.args['GN_AccessionId'], None)
-# logger.info("1 Made it to rendering")
-# return render_template("data_sharing.html",
-# info=info,
-# htmlfilelist=htmlfilelist)
-
-
@app.route("/search", methods=('GET',))
def search_page():
logger.info("in search_page")
logger.info(request.url)
- if 'info_database' in request.args:
- logger.info("Going to sharing_info_page")
- template_vars = sharing_info_page()
- if template_vars.redirect_url:
- logger.info("Going to redirect")
- return flask.redirect(template_vars.redirect_url)
- else:
- return render_template("data_sharing.html", **template_vars.__dict__)
+ result = None
+ if USE_REDIS:
+ with Bench("Trying Redis cache"):
+ key = "search_results:v1:" + json.dumps(request.args, sort_keys=True)
+ logger.debug("key is:", pf(key))
+ result = Redis.get(key)
+ if result:
+ logger.info("Redis cache hit on search results!")
+ result = pickle.loads(result)
else:
- result = None
- if USE_REDIS:
- with Bench("Trying Redis cache"):
- key = "search_results:v1:" + json.dumps(request.args, sort_keys=True)
- logger.debug("key is:", pf(key))
- result = Redis.get(key)
- if result:
- logger.info("Redis cache hit on search results!")
- result = pickle.loads(result)
- else:
- logger.info("Skipping Redis cache (USE_REDIS=False)")
+ logger.info("Skipping Redis cache (USE_REDIS=False)")
- logger.info("request.args is", request.args)
- the_search = search_results.SearchResultPage(request.args)
- result = the_search.__dict__
- valid_search = result['search_term_exists']
+ logger.info("request.args is", request.args)
+ the_search = search_results.SearchResultPage(request.args)
+ result = the_search.__dict__
+ valid_search = result['search_term_exists']
- logger.debugf("result", result)
+ logger.debugf("result", result)
- if USE_REDIS and valid_search:
- Redis.set(key, pickle.dumps(result, pickle.HIGHEST_PROTOCOL))
- Redis.expire(key, 60*60)
+ if USE_REDIS and valid_search:
+ Redis.set(key, pickle.dumps(result, pickle.HIGHEST_PROTOCOL))
+ Redis.expire(key, 60*60)
- if valid_search:
- return render_template("search_result_page.html", **result)
- else:
- return render_template("search_error.html")
+ if valid_search:
+ return render_template("search_result_page.html", **result)
+ else:
+ return render_template("search_error.html")
@app.route("/gsearch", methods=('GET',))
def gsearchact():
@@ -741,7 +715,6 @@ def network_graph_page():
def corr_compute_page():
logger.info("In corr_compute, request.form is:", pf(request.form))
logger.info(request.url)
- #fd = webqtlFormData.webqtlFormData(request.form)
template_vars = show_corr_results.CorrelationResults(request.form)
return render_template("correlation_page.html", **template_vars.__dict__)
@@ -777,15 +750,6 @@ def submit_bnw():
template_vars = get_bnw_input(request.form)
return render_template("empty_collection.html", **{'tool':'Correlation Matrix'})
-# Todo: Can we simplify this? -Sam
-def sharing_info_page():
- """Info page displayed when the user clicks the "Info" button next to the dataset selection"""
- logger.info("In sharing_info_page")
- logger.info(request.url)
- fd = webqtlFormData.webqtlFormData(request.args)
- template_vars = SharingInfoPage.SharingInfoPage(fd)
- return template_vars
-
# Take this out or secure it before putting into production
@app.route("/get_temp_data")
def get_temp_data():