diff options
author | pjotrp | 2016-02-08 10:04:12 +0100 |
---|---|---|
committer | pjotrp | 2016-02-08 10:04:12 +0100 |
commit | 10ae56e0dcc7ac76c671789a67b754d0e1dd03ec (patch) | |
tree | af103b937f9003db84b1dd425554b1d20ae15abd /wqflask/maintenance/gen_select_dataset.py | |
parent | cb0f10fc4850b6b06f2237b532317a5c6668584a (diff) | |
parent | fdc0cdeda64213c82512da20b10264238bd210ea (diff) | |
download | genenetwork2-10ae56e0dcc7ac76c671789a67b754d0e1dd03ec.tar.gz |
Merge branch 'master' of github.com:genenetwork/genenetwork2 into gn-master
Diffstat (limited to 'wqflask/maintenance/gen_select_dataset.py')
-rwxr-xr-x | wqflask/maintenance/gen_select_dataset.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/wqflask/maintenance/gen_select_dataset.py b/wqflask/maintenance/gen_select_dataset.py index a2ad8c91..fda46792 100755 --- a/wqflask/maintenance/gen_select_dataset.py +++ b/wqflask/maintenance/gen_select_dataset.py @@ -123,12 +123,12 @@ def get_types(groups): def phenotypes_exist(group_name): - print("group_name:", group_name) + #print("group_name:", group_name) Cursor.execute("""select Name from PublishFreeze where PublishFreeze.Name = %s""", (group_name+"Publish")) results = Cursor.fetchone() - print("RESULTS:", results) + #print("RESULTS:", results) if results != None: return True @@ -136,12 +136,12 @@ def phenotypes_exist(group_name): return False def genotypes_exist(group_name): - print("group_name:", group_name) + #print("group_name:", group_name) Cursor.execute("""select Name from GenoFreeze where GenoFreeze.Name = %s""", (group_name+"Geno")) results = Cursor.fetchone() - print("RESULTS:", results) + #print("RESULTS:", results) if results != None: return True @@ -220,7 +220,7 @@ def build_datasets(species, group, type_name): # and ProbeFreeze.TissueId = Tissue.Id and ProbeFreeze.InbredSetId = # InbredSet.Id and ProbeSetFreeze.public > 0 order by # ProbeSetFreeze.CreateTime desc""".format(species, group, type_name)) - Cursor.execute("""select ProbeSetFreeze.Name, ProbeSetFreeze.FullName from + Cursor.execute("""select ProbeSetFreeze.Id, ProbeSetFreeze.Name, ProbeSetFreeze.FullName from ProbeSetFreeze, ProbeFreeze, InbredSet, Tissue, Species where Species.Name = %s and Species.Id = InbredSet.SpeciesId and InbredSet.Name = %s and @@ -228,7 +228,16 @@ def build_datasets(species, group, type_name): and ProbeFreeze.TissueId = Tissue.Id and ProbeFreeze.InbredSetId = InbredSet.Id and ProbeSetFreeze.public > 0 order by ProbeSetFreeze.CreateTime desc""", (species, group, type_name)) - return Cursor.fetchall() + + dataset_results = Cursor.fetchall() + datasets = [] + for dataset_info in dataset_results: + this_dataset_info = [] + for info in dataset_info: + this_dataset_info.append(str(info)) + datasets.append(this_dataset_info) + + return datasets def main(): |