From 85405fe6875358d3bb98b03621271d5909dd393f Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 11 Nov 2021 16:15:28 +0530 Subject: 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. --- gn3/heatmaps.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'gn3') 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( -- cgit v1.2.3