aboutsummaryrefslogtreecommitdiff
path: root/gn3/computations/correlations.py
diff options
context:
space:
mode:
authorAlexander Kabui2021-11-28 19:01:16 +0300
committerBonfaceKilz2021-12-10 09:58:29 +0300
commit31c6412b19a10cfb78a3f3294e6acec9811a7ee8 (patch)
tree160e0dedc985d00ea9cc5e62885ae365f3b4974f /gn3/computations/correlations.py
parent2db855b5c1d924dcdcfa47a2b4238cacf5f45fff (diff)
downloadgenenetwork3-31c6412b19a10cfb78a3f3294e6acec9811a7ee8.tar.gz
fix bug:unpacking error when generator returns empty list
Diffstat (limited to 'gn3/computations/correlations.py')
-rw-r--r--gn3/computations/correlations.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/gn3/computations/correlations.py b/gn3/computations/correlations.py
index c5c56db..2f79c4a 100644
--- a/gn3/computations/correlations.py
+++ b/gn3/computations/correlations.py
@@ -79,9 +79,12 @@ def compute_sample_r_correlation(trait_name, corr_method, trait_vals,
"""
- sanitized_traits_vals, sanitized_target_vals = list(
- zip(*list(normalize_values(trait_vals, target_samples_vals))))
- num_overlap = len(sanitized_traits_vals)
+ try:
+ sanitized_traits_vals, sanitized_target_vals = list(
+ zip(*list(normalize_values(trait_vals, target_samples_vals))))
+ num_overlap = len(sanitized_traits_vals)
+ except ValueError:
+ return
if num_overlap > 5: