aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base
diff options
context:
space:
mode:
authorzsloan2016-06-21 16:45:27 +0000
committerzsloan2016-06-21 16:45:27 +0000
commit8ae986b527ce8df34ffbe875116e453d3803e958 (patch)
tree9331d5571b356b6cfe450b7a248340ce258659fc /wqflask/base
parent38d066f14ec51cdbcd220d8c45edf5b241865691 (diff)
downloadgenenetwork2-8ae986b527ce8df34ffbe875116e453d3803e958.tar.gz
No longer runs query to get symbol_values_dict when no id_list to fix occasional error with correlation page
Diffstat (limited to 'wqflask/base')
-rwxr-xr-xwqflask/base/mrna_assay_tissue_data.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/wqflask/base/mrna_assay_tissue_data.py b/wqflask/base/mrna_assay_tissue_data.py
index 039f5d1f..fe117a56 100755
--- a/wqflask/base/mrna_assay_tissue_data.py
+++ b/wqflask/base/mrna_assay_tissue_data.py
@@ -93,19 +93,20 @@ class MrnaAssayTissueData(object):
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))
-
- print("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)
+ 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)
+
+ 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