diff options
author | BonfaceKilz | 2020-10-07 15:58:14 +0300 |
---|---|---|
committer | BonfaceKilz | 2020-10-09 00:01:55 +0300 |
commit | ef11f5e40ec0b8ef90a00b9d98d81cca2ff5d8d9 (patch) | |
tree | dc1703d5354535968631e342d03ffb5b9583dda8 | |
parent | 4aa138360fd41f9d496e00aa744700cd4d8a53a6 (diff) | |
download | genenetwork2-ef11f5e40ec0b8ef90a00b9d98d81cca2ff5d8d9.tar.gz |
Convert cmp function into a key function
* wqflask/wqflask/correlation_matrix/show_corr_matrix.py
(sortEigenVectors): Convert the comparison function into a key
function. See:
https://docs.python.org/3/howto/sorting.html#the-old-way-using-the-cmp-parameter
-rw-r--r-- | wqflask/wqflask/correlation_matrix/show_corr_matrix.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py index c0d84aa2..f24b9f7f 100644 --- a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py +++ b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py @@ -28,6 +28,7 @@ import utility.logger from base import data_set from functools import reduce +from functools import cmp_to_key from rpy2.robjects.packages import importr from utility import webqtlUtil @@ -268,7 +269,7 @@ def sortEigenVectors(vector): for item in eigenValues: combines.append([eigenValues[i], eigenVectors[i]]) i += 1 - combines.sort(webqtlUtil.cmpEigenValue) + sorted(combines, key=cmp_to_key(webqtlUtil.cmpEigenValue)) A = [] B = [] for item in combines: |