diff options
author | zsloan | 2021-07-26 01:08:19 -0500 |
---|---|---|
committer | GitHub | 2021-07-26 09:08:19 +0300 |
commit | cbb8029746400a299b9c65c5cd7be9a38cade189 (patch) | |
tree | 0e1b15bb54098eb022a01d20a8cc6c7fc6f61d9f /gn3/computations/correlations.py | |
parent | 13c4e1bbe6f30454c06235698efad146d99116dd (diff) | |
download | genenetwork3-cbb8029746400a299b9c65c5cd7be9a38cade189.tar.gz |
Check if corr_coefficient is NaN, since apparently it's stored as NaN instead of None when it can't be calculcated (which was messing up sorting); it may also be okay to remove the None check, but leaving it for now (#28)
Diffstat (limited to 'gn3/computations/correlations.py')
-rw-r--r-- | gn3/computations/correlations.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gn3/computations/correlations.py b/gn3/computations/correlations.py index bc738a7..56f483c 100644 --- a/gn3/computations/correlations.py +++ b/gn3/computations/correlations.py @@ -1,4 +1,5 @@ """module contains code for correlations""" +import math import multiprocessing from typing import List @@ -90,7 +91,7 @@ def compute_sample_r_correlation(trait_name, corr_method, trait_vals, target_values=sanitized_target_vals, corr_method=corr_method) - if corr_coefficient is not None: + if corr_coefficient is not None and not math.isnan(corr_coefficient): return (trait_name, corr_coefficient, p_value, num_overlap) return None |