aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-02-03 05:30:55 +0300
committerBonfaceKilz2022-02-08 10:12:27 +0300
commit97ae2273a12c89d6042611aa7885240370fae545 (patch)
treed1299fd5482bd151091d780043c5203fe08ad1e9
parentd037b551b7877b7611fcc161006d82e1e148d6aa (diff)
downloadgenenetwork3-97ae2273a12c89d6042611aa7885240370fae545.tar.gz
Give sorting functions more descriptive names
-rw-r--r--gn3/computations/partial_correlations.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/gn3/computations/partial_correlations.py b/gn3/computations/partial_correlations.py
index 52c833f..f6804eb 100644
--- a/gn3/computations/partial_correlations.py
+++ b/gn3/computations/partial_correlations.py
@@ -731,19 +731,16 @@ def partial_correlations_entry(# pylint: disable=[R0913, R0914, R0911]
def __make_sorter__(method):
- def __sort_6__(row):
- return row[6]
+ def __by_lit_or_tiss_corr_then_p_val__(row):
+ return (row[6], row[3])
- def __sort_3__(row):
+ def __by_partial_corr_p_value__(row):
return row[3]
- if "literature" in method.lower():
- return __sort_6__
+ if (("literature" in method.lower()) or ("tissue" in method.lower())):
+ return __by_lit_or_tiss_corr_then_p_val__
- if "tissue" in method.lower():
- return __sort_6__
-
- return __sort_3__
+ return __by_partial_corr_p_value__
add_lit_corr_and_tiss_corr = compose(
partial(literature_correlation_by_list, conn, species),