aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/mrna_assay_tissue_data.py
diff options
context:
space:
mode:
authorPjotr Prins2016-06-26 06:24:58 +0000
committerPjotr Prins2016-06-26 06:24:58 +0000
commit063188f5420600bb147a5d4d759614c6718cc605 (patch)
tree52e5af1603fa1159490faebbc8e07e152ff7a879 /wqflask/base/mrna_assay_tissue_data.py
parentddcf21ca8264730c9d368ef899760d007c0fb948 (diff)
parent9b25ba56288d8a3b405392854836608ac3741985 (diff)
downloadgenenetwork2-063188f5420600bb147a5d4d759614c6718cc605.tar.gz
Resolve conflicts
Diffstat (limited to 'wqflask/base/mrna_assay_tissue_data.py')
-rw-r--r--wqflask/base/mrna_assay_tissue_data.py26
1 files changed, 12 insertions, 14 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