diff options
author | zsloan | 2021-07-09 21:32:38 +0000 |
---|---|---|
committer | zsloan | 2021-07-09 21:32:38 +0000 |
commit | 9080fa91f072956fb0137e36b9ef1b45e7e03e34 (patch) | |
tree | 0f6dbe88808a3f0546dc2273706be2d86c323cda | |
parent | 4a6536e7a9b5830a91e17e9171ef699b68a8ddb5 (diff) | |
download | genenetwork2-9080fa91f072956fb0137e36b9ef1b45e7e03e34.tar.gz |
Changed compute_corr_for_top_results to also do sample correlation when literature or tissue correlation are selected
-rw-r--r-- | wqflask/wqflask/correlation/correlation_gn3_api.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/wqflask/wqflask/correlation/correlation_gn3_api.py b/wqflask/wqflask/correlation/correlation_gn3_api.py index 86531fa2..aea91220 100644 --- a/wqflask/wqflask/correlation/correlation_gn3_api.py +++ b/wqflask/wqflask/correlation/correlation_gn3_api.py @@ -227,8 +227,8 @@ def compute_correlation(start_vars, method="pearson", compute_all=False): correlation_results = correlation_results[0:corr_return_results] if (compute_all): - - correlation_results = compute_corr_for_top_results(correlation_results, + correlation_results = compute_corr_for_top_results(start_vars, + correlation_results, this_trait, this_dataset, target_dataset, @@ -242,7 +242,8 @@ def compute_correlation(start_vars, method="pearson", compute_all=False): return correlation_data -def compute_corr_for_top_results(correlation_results, +def compute_corr_for_top_results(start_vars, + correlation_results, this_trait, this_dataset, target_dataset, @@ -265,8 +266,12 @@ def compute_corr_for_top_results(correlation_results, correlation_results = merge_correlation_results( correlation_results, lit_result) - if corr_type != "sample": - pass + if corr_type != "sample" and this_dataset.type == "ProbeSet" and target_dataset.type == "ProbeSet": + sample_result = sample_for_trait_lists( + correlation_results, target_dataset, this_trait, this_dataset, start_vars) + if sample_result: + correlation_results = merge_correlation_results( + correlation_results, sample_result) return correlation_results |