about summary refs log tree commit diff
path: root/gn3
diff options
context:
space:
mode:
authorArun Isaac2021-11-11 16:15:28 +0530
committerBonfaceKilz2021-11-11 20:49:30 +0300
commit85405fe6875358d3bb98b03621271d5909dd393f (patch)
tree8bd0ee403859f0b44160178fd0a1890a38faa9c5 /gn3
parentec1d2180d99e0cde1dc181ee9ed79e86cf1a5675 (diff)
downloadgenenetwork3-85405fe6875358d3bb98b03621271d5909dd393f.tar.gz
Remove redundant check on the Pearson correlation coefficient.
The Pearson correlation coefficient always has a value between -1 and 1. So,
this check is redundant.

* gn3/heatmaps.py (cluster_traits.__compute_corr): Remove redundant check on
the Pearson correlation coefficient.
Diffstat (limited to 'gn3')
-rw-r--r--gn3/heatmaps.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/gn3/heatmaps.py b/gn3/heatmaps.py
index bf9dfd1..f0af409 100644
--- a/gn3/heatmaps.py
+++ b/gn3/heatmaps.py
@@ -64,11 +64,7 @@ def cluster_traits(traits_data_list: Sequence[Dict]):
     def __compute_corr(tdata_i, tdata_j):
         if tdata_i[0] == tdata_j[0]:
             return 0.0
-        corr_vals = compute_correlation(tdata_i[1], tdata_j[1])
-        corr = corr_vals[0]
-        if (1 - corr) < 0:
-            return 0.0
-        return 1 - corr
+        return 1 - compute_correlation(tdata_i[1], tdata_j[1])[0]
 
     def __cluster(tdata_i):
         return tuple(