aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorZachary Sloan2013-06-25 23:09:09 +0000
committerZachary Sloan2013-06-25 23:09:09 +0000
commitd703c6e456334187a279c04e9b4cf6a8e5099785 (patch)
tree87c25538430cb5358e62ae093bf357791f389600 /wqflask
parenta0a1d8b70e02871328fb044c7ae190f805b0a04e (diff)
downloadgenenetwork2-d703c6e456334187a279c04e9b4cf6a8e5099785.tar.gz
Added DataSets class to dataset.py that will be used to create list of
confidential datasets
Diffstat (limited to 'wqflask')
-rwxr-xr-xwqflask/base/data_set.py35
-rw-r--r--wqflask/wqflask/correlation/show_corr_results.py7
-rw-r--r--wqflask/wqflask/views.py3
3 files changed, 43 insertions, 2 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index 1668940c..f301cc05 100755
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -167,8 +167,8 @@ class DatasetGroup(object):
self.incparentsf1 = False
self.allsamples = None
-
-
+
+
def get_markers(self):
#print("self.species is:", self.species)
if self.species == "human":
@@ -222,6 +222,37 @@ class DatasetGroup(object):
self.samplelist = list(genotype.prgy)
+class DataSets(object):
+ """Builds a list of DataSets"""
+
+ def __init__(self):
+ self.datasets = list()
+
+ type_dict = {'phenotype': 'PublishFreeze',
+ 'mrna_assay': 'ProbeSetFreeze',
+ 'genotype': 'GenoFreeze'}
+
+ for dataset_type in type_dict:
+ query = "SELECT Name FROM {}".format(type_dict[dataset_type])
+ for result in g.db.execute(query).fetchall():
+ #The query at the beginning of this function isn't necessary here, but still would
+ #rather just reuse it
+ create_dataset(result.Name)
+
+
+ #query = """SELECT Name FROM ProbeSetFreeze
+ # UNION
+ # SELECT Name From PublishFreeze
+ # UNION
+ # SELECT Name From GenoFreeze"""
+ #
+ #for result in g.db.execute(query).fetchall():
+ # dataset = DataSet(result.Name)
+ # self.datasets.append(dataset)
+
+#ds = DataSets()
+#print("[orange] ds:", ds.datasets)
+
class DataSet(object):
"""
DataSet class defines a dataset in webqtl, can be either Microarray,
diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py
index 1410ae0c..3b47e970 100644
--- a/wqflask/wqflask/correlation/show_corr_results.py
+++ b/wqflask/wqflask/correlation/show_corr_results.py
@@ -203,6 +203,13 @@ class CorrelationResults(object):
# mb = trait_object.mb
# )
+
+
+ trait_list = self.getTissueCorrelationByList( primary_trait_symbol = self.this_trait.symbol,
+ corr_results = self.correlation_results,
+ TissueProbeSetFreezeId = 1,
+ method=1)
+
#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']
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index b9aa3acf..fcb34d31 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -27,6 +27,7 @@ from flask import render_template, request, make_response, Response, Flask, g, c
from wqflask import search_results
from base.data_set import DataSet # Used by YAML in marker_regression
+from base.data_set import DataSets
from wqflask.show_trait import show_trait
from wqflask.show_trait import export_trait_data
from wqflask.marker_regression import marker_regression
@@ -53,6 +54,8 @@ def connect_db():
@app.route("/")
def index_page():
print("Sending index_page")
+ ds = DataSets()
+ print("[orange] ds:", ds.datasets)
return render_template("index_page.html")
@app.route("/data_sharing")