aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kabui2021-04-17 04:20:08 +0300
committerAlexander Kabui2021-04-17 04:20:08 +0300
commitba1ea53443b8085700df2941e68421bcc8206c8b (patch)
treec5d9f2e82f37767930e315b804b6d853b7a2284e
parente8dddf89e0736b024aa28d4170a5865f6869f7da (diff)
downloadgenenetwork3-ba1ea53443b8085700df2941e68421bcc8206c8b.tar.gz
ad pep8 formatting
-rw-r--r--gn3/computations/correlations.py4
-rw-r--r--tests/unit/computations/test_correlation.py6
2 files changed, 5 insertions, 5 deletions
diff --git a/gn3/computations/correlations.py b/gn3/computations/correlations.py
index 804716c..1e95800 100644
--- a/gn3/computations/correlations.py
+++ b/gn3/computations/correlations.py
@@ -150,10 +150,9 @@ def compute_all_sample_correlation(this_trait,
corr_results.append({"trait_name_key": corr_result})
- sorted_corr_results = sorted(
+ return sorted(
corr_results,
key=lambda trait_name: -abs(list(trait_name.values())[0]["corr_coeffient"]))
- return sorted_corr_results
def benchmark_compute_all_sample(this_trait,
@@ -295,7 +294,6 @@ def lit_correlation_for_trait_list(
species=species,
gene_id=trait_gene_id)
-
for (trait_name, target_trait_gene_id) in target_trait_lists:
corr_results = {}
if target_trait_gene_id:
diff --git a/tests/unit/computations/test_correlation.py b/tests/unit/computations/test_correlation.py
index a8d199d..9f3feab 100644
--- a/tests/unit/computations/test_correlation.py
+++ b/tests/unit/computations/test_correlation.py
@@ -417,8 +417,10 @@ class TestCorrelation(TestCase):
mock_tissue_corr.side_effect = [{"tissue_corr": -0.5, "p_value": 0.9, "tissue_number": 3},
{"tissue_corr": 1.11, "p_value": 0.2, "tissue_number": 3}]
- expected_results = [{"1412_at": {"tissue_corr": 1.11, "p_value": 0.2, "tissue_number": 3}},
- {"1418702_a_at": {"tissue_corr": -0.5, "p_value": 0.9, "tissue_number": 3}}]
+ expected_results = [{"1412_at":
+ {"tissue_corr": 1.11, "p_value": 0.2, "tissue_number": 3}},
+ {"1418702_a_at":
+ {"tissue_corr": -0.5, "p_value": 0.9, "tissue_number": 3}}]
results = compute_all_tissue_correlation(
primary_tissue_dict=primary_tissue_dict,