diff options
author | Pjotr Prins | 2016-06-26 06:24:58 +0000 |
---|---|---|
committer | Pjotr Prins | 2016-06-26 06:24:58 +0000 |
commit | 063188f5420600bb147a5d4d759614c6718cc605 (patch) | |
tree | 52e5af1603fa1159490faebbc8e07e152ff7a879 /wqflask/base | |
parent | ddcf21ca8264730c9d368ef899760d007c0fb948 (diff) | |
parent | 9b25ba56288d8a3b405392854836608ac3741985 (diff) | |
download | genenetwork2-063188f5420600bb147a5d4d759614c6718cc605.tar.gz |
Resolve conflicts
Diffstat (limited to 'wqflask/base')
-rw-r--r-- | wqflask/base/mrna_assay_tissue_data.py | 26 | ||||
-rw-r--r-- | wqflask/base/trait.py | 8 |
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 = "" |