aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base
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/base
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/base')
-rwxr-xr-xwqflask/base/data_set.py35
1 files changed, 33 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,