aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/base')
-rw-r--r--wqflask/base/mrna_assay_tissue_data.py26
-rw-r--r--wqflask/base/trait.py8
2 files changed, 13 insertions, 21 deletions
diff --git a/wqflask/base/mrna_assay_tissue_data.py b/wqflask/base/mrna_assay_tissue_data.py
index 5511af06..e99ef7b5 100644
--- a/wqflask/base/mrna_assay_tissue_data.py
+++ b/wqflask/base/mrna_assay_tissue_data.py
@@ -92,24 +92,22 @@ class MrnaAssayTissueData(object):
def get_symbol_values_pairs(self):
id_list = [self.data[symbol].data_id for symbol in self.data]
- print("id_list:", id_list)
-
symbol_values_dict = {}
- query = """SELECT TissueProbeSetXRef.Symbol, TissueProbeSetData.value
- FROM TissueProbeSetXRef, TissueProbeSetData
- WHERE TissueProbeSetData.Id IN {} and
- TissueProbeSetXRef.DataId = TissueProbeSetData.Id""".format(db_tools.create_in_clause(id_list))
+ if len(id_list) > 0:
+ query = """SELECT TissueProbeSetXRef.Symbol, TissueProbeSetData.value
+ FROM TissueProbeSetXRef, TissueProbeSetData
+ WHERE TissueProbeSetData.Id IN {} and
+ TissueProbeSetXRef.DataId = TissueProbeSetData.Id""".format(db_tools.create_in_clause(id_list))
- print("TISSUE QUERY:", query)
- logger.sql(query)
+ logger.sql('tissue query',query)
- results = g.db.execute(query).fetchall()
- for result in results:
- if result.Symbol.lower() not in symbol_values_dict:
- symbol_values_dict[result.Symbol.lower()] = [result.value]
- else:
- symbol_values_dict[result.Symbol.lower()].append(result.value)
+ results = g.db.execute(query).fetchall()
+ for result in results:
+ if result.Symbol.lower() not in symbol_values_dict:
+ symbol_values_dict[result.Symbol.lower()] = [result.value]
+ else:
+ symbol_values_dict[result.Symbol.lower()].append(result.value)
#for symbol in self.data:
# data_id = self.data[symbol].data_id
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index afde3dbe..9566c192 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -82,13 +82,7 @@ class GeneralTrait(object):
dataset=self.dataset.name,
description=self.description_display,
mean=self.mean)
-
-
- def get_info(self):
- """For lots of traits just use get_trait_info in dataset instead...that will be way
- more efficient"""
- self.dataset.get_trait_info([self],
- webqtlDatabaseFunction.retrieve_species(self.dataset.group.name))
+
def get_name(self):
stringy = ""