diff options
author | zsloan | 2020-10-19 13:43:32 -0500 |
---|---|---|
committer | GitHub | 2020-10-19 13:43:32 -0500 |
commit | 8eaae7296e2d66726975ddba0de8aecae256e63b (patch) | |
tree | 5505b932195a454c1ada10677f0e76faba6b588f /wqflask/base/data_set.py | |
parent | 5fdb3b83566516782542d04b92a5be97f41c2330 (diff) | |
parent | 3f242af74af814d9344e1e80c5f94914c6d9b621 (diff) | |
download | genenetwork2-8eaae7296e2d66726975ddba0de8aecae256e63b.tar.gz |
Merge branch 'testing' into scroller_testing
Diffstat (limited to 'wqflask/base/data_set.py')
-rw-r--r-- | wqflask/base/data_set.py | 40 |
1 files changed, 4 insertions, 36 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index afffe780..2f1549ae 100644 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -150,10 +150,12 @@ Publish or ProbeSet. E.g. "geno": "Geno", } + group_name = name if t in ['pheno', 'other_pheno']: - name = name.replace("Publish", "") + group_name = name.replace("Publish", "") - if bool(len(g.db.execute(sql_query_mapping[t].format(name)).fetchone())): + results = g.db.execute(sql_query_mapping[t].format(group_name)).fetchone() + if results: self.datasets[name] = dataset_name_mapping[t] self.redis_instance.set("dataset_structure", json.dumps(self.datasets)) return True @@ -1173,40 +1175,6 @@ class TempDataSet(DataSet): self.fullname = 'Temporary Storage' self.shortname = 'Temp' - @staticmethod - def handle_pca(desc): - if 'PCA' in desc: - # Todo: Modernize below lines - desc = desc[desc.rindex(':')+1:].strip() - else: - desc = desc[:desc.index('entered')].strip() - return desc - - def get_desc(self): - query = 'SELECT description FROM Temp WHERE Name=%s' % self.name - logger.sql(query) - g.db.execute(query) - desc = g.db.fetchone()[0] - desc = self.handle_pca(desc) - return desc - - def retrieve_sample_data(self, trait): - query = """ - SELECT - Strain.Name, TempData.value, TempData.SE, TempData.NStrain, TempData.Id - FROM - TempData, Temp, Strain - WHERE - TempData.StrainId = Strain.Id AND - TempData.Id = Temp.DataId AND - Temp.name = '%s' - Order BY - Strain.Name - """ % escape(trait.name) - - logger.sql(query) - results = g.db.execute(query).fetchall() - def geno_mrna_confidentiality(ob): dataset_table = ob.type + "Freeze" |