diff options
author | Alexander Kabui | 2021-07-16 22:47:21 +0300 |
---|---|---|
committer | BonfaceKilz | 2021-07-23 09:02:30 +0300 |
commit | 2fbfdc0e57ad9d2b27b99b32f3d48af4fae96dd9 (patch) | |
tree | 24369811a0442c068ac760fb25fedbb46a6e9a4a /wqflask | |
parent | 427071fc797d6208f9833401833f17d929f11343 (diff) | |
download | genenetwork2-2fbfdc0e57ad9d2b27b99b32f3d48af4fae96dd9.tar.gz |
handle missing tissue input data
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/correlation/correlation_gn3_api.py | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/wqflask/wqflask/correlation/correlation_gn3_api.py b/wqflask/wqflask/correlation/correlation_gn3_api.py index aea91220..c96da8ee 100644 --- a/wqflask/wqflask/correlation/correlation_gn3_api.py +++ b/wqflask/wqflask/correlation/correlation_gn3_api.py @@ -149,7 +149,6 @@ def fetch_sample_data(start_vars, this_trait, this_dataset, target_dataset): sample_data = test_process_data(this_trait, this_dataset, start_vars) - if target_dataset.type == "ProbeSet": target_dataset.get_probeset_data(list(sample_data.keys())) else: @@ -202,17 +201,22 @@ def compute_correlation(start_vars, method="pearson", compute_all=False): if tissue_input is not None: (primary_tissue_data, target_tissue_data) = tissue_input - corr_input_data = { - "primary_tissue": primary_tissue_data, - "target_tissues_dict": target_tissue_data - } - correlation_results = compute_tissue_correlation( - primary_tissue_dict=corr_input_data["primary_tissue"], - target_tissues_data=corr_input_data[ - "target_tissues_dict"], - corr_method=method - - ) + corr_input_data = { + "primary_tissue": primary_tissue_data, + "target_tissues_dict": target_tissue_data + } + correlation_results = compute_tissue_correlation( + primary_tissue_dict=corr_input_data["primary_tissue"], + target_tissues_data=corr_input_data[ + "target_tissues_dict"], + corr_method=method + + ) + else: + return {"correlation_results": [], + "this_trait": this_trait.name, + "target_dataset": start_vars['corr_dataset'], + "return_results": corr_return_results} elif corr_type == "lit": (this_trait_geneid, geneid_dict, species) = do_lit_correlation( @@ -302,5 +306,4 @@ def get_tissue_correlation_input(this_trait, trait_symbol_dict): "trait_symbol_dict": trait_symbol_dict, "symbol_tissue_vals_dict": corr_result_tissue_vals_dict } - return (primary_tissue_data, target_tissue_data) - return None + return (primary_tissue_data, target_tissue_data)
\ No newline at end of file |