diff options
author | Alexander Kabui | 2021-11-28 19:01:16 +0300 |
---|---|---|
committer | BonfaceKilz | 2021-12-10 09:58:29 +0300 |
commit | 31c6412b19a10cfb78a3f3294e6acec9811a7ee8 (patch) | |
tree | 160e0dedc985d00ea9cc5e62885ae365f3b4974f /gn3/computations/correlations.py | |
parent | 2db855b5c1d924dcdcfa47a2b4238cacf5f45fff (diff) | |
download | genenetwork3-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.py | 9 |
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: |