diff options
author | zsloan | 2016-06-22 17:32:01 +0000 |
---|---|---|
committer | zsloan | 2016-06-22 17:32:01 +0000 |
commit | ff300e422ab9c3bd2288d08a3de4a9f4c3beb1ba (patch) | |
tree | 24809e40815f76d0150d9c713818115c14a8ab6b | |
parent | 8ae986b527ce8df34ffbe875116e453d3803e958 (diff) | |
download | genenetwork2-ff300e422ab9c3bd2288d08a3de4a9f4c3beb1ba.tar.gz |
Fixed a couple more errors with the correlation page that occurred when you selected Tissue correlation with traits from data sets without 'data_ids'
-rw-r--r--[-rwxr-xr-x] | wqflask/base/mrna_assay_tissue_data.py | 2 | ||||
-rw-r--r-- | wqflask/wqflask/correlation/show_corr_results.py | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/wqflask/base/mrna_assay_tissue_data.py b/wqflask/base/mrna_assay_tissue_data.py index fe117a56..1f1be1e5 100755..100644 --- a/wqflask/base/mrna_assay_tissue_data.py +++ b/wqflask/base/mrna_assay_tissue_data.py @@ -89,8 +89,6 @@ 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 = {} if len(id_list) > 0: diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py index f2bba985..b852a99c 100644 --- a/wqflask/wqflask/correlation/show_corr_results.py +++ b/wqflask/wqflask/correlation/show_corr_results.py @@ -167,9 +167,13 @@ class CorrelationResults(object): self.trait_symbol_dict = self.dataset.retrieve_genes("Symbol") tissue_corr_data = self.do_tissue_correlation_for_all_traits() - for trait in tissue_corr_data.keys()[:self.return_number]: - self.get_sample_r_and_p_values(trait, self.target_dataset.trait_data[trait]) - + if tissue_corr_data != None: + for trait in tissue_corr_data.keys()[:self.return_number]: + self.get_sample_r_and_p_values(trait, self.target_dataset.trait_data[trait]) + else: + for trait, values in self.target_dataset.trait_data.iteritems(): + self.get_sample_r_and_p_values(trait, values) + elif self.corr_type == "lit": self.trait_geneid_dict = self.dataset.retrieve_genes("GeneId") lit_corr_data = self.do_lit_correlation_for_all_traits() @@ -244,7 +248,7 @@ class CorrelationResults(object): trait_object.tissue_corr = 0 trait_object.tissue_pvalue = 0 trait_object.lit_corr = 0 - if self.corr_type == "tissue": + if self.corr_type == "tissue" and tissue_corr_data != None: trait_object.tissue_corr = tissue_corr_data[trait][1] trait_object.tissue_pvalue = tissue_corr_data[trait][2] elif self.corr_type == "lit": |