diff options
author | zsloan | 2016-06-21 16:45:27 +0000 |
---|---|---|
committer | zsloan | 2016-06-21 16:45:27 +0000 |
commit | 8ae986b527ce8df34ffbe875116e453d3803e958 (patch) | |
tree | 9331d5571b356b6cfe450b7a248340ce258659fc | |
parent | 38d066f14ec51cdbcd220d8c45edf5b241865691 (diff) | |
download | genenetwork2-8ae986b527ce8df34ffbe875116e453d3803e958.tar.gz |
No longer runs query to get symbol_values_dict when no id_list to fix occasional error with correlation page
-rwxr-xr-x | wqflask/base/mrna_assay_tissue_data.py | 27 |
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 |