aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kabui2021-05-12 19:49:55 +0300
committerAlexander Kabui2021-05-12 19:49:55 +0300
commitf88a2c3161c71d58c91c3030bd303a86846c5a73 (patch)
treefeeb4baeb516877a75358368c53fe8ad5624b286
parentbeccacde5c9c7317bfe795e5c8c4ebe033f39f89 (diff)
downloadgenenetwork3-f88a2c3161c71d58c91c3030bd303a86846c5a73.tar.gz
rename tissue_correlation_for_trait_list with tissue_correlation_for_trait
-rw-r--r--gn3/computations/correlations.py8
-rw-r--r--tests/unit/computations/test_correlation.py8
2 files changed, 8 insertions, 8 deletions
diff --git a/gn3/computations/correlations.py b/gn3/computations/correlations.py
index 3cea69d..21bc82e 100644
--- a/gn3/computations/correlations.py
+++ b/gn3/computations/correlations.py
@@ -222,7 +222,7 @@ probet
return corr_results
-def tissue_correlation_for_trait_list(
+def tissue_correlation_for_trait(
primary_tissue_vals: List,
target_tissues_values: List,
corr_method: str,
@@ -378,7 +378,7 @@ def compute_all_lit_correlation(conn, trait_lists: List,
def compute_all_tissue_correlation(primary_tissue_dict: dict,
target_tissues_data: dict,
corr_method: str):
- """Function acts as an abstraction for tissue_correlation_for_trait_list\
+ """Function acts as an abstraction for tissue_correlation_for_trait\
required input are target tissue object and primary tissue trait\
target tissues data contains the trait_symbol_dict and symbol_tissue_vals
@@ -398,7 +398,7 @@ def compute_all_tissue_correlation(primary_tissue_dict: dict,
target_tissue_vals = target_tissue_obj.get("tissue_values")
- tissue_result = tissue_correlation_for_trait_list(
+ tissue_result = tissue_correlation_for_trait(
primary_tissue_vals=primary_tissue_vals,
target_tissues_values=target_tissue_vals,
trait_id=trait_id,
@@ -459,7 +459,7 @@ def compute_tissue_correlation(primary_tissue_dict: dict,
with multiprocessing.Pool(4) as pool:
results = pool.starmap(
- tissue_correlation_for_trait_list, processed_values)
+ tissue_correlation_for_trait, processed_values)
for result in results:
tissues_results.append(result)
diff --git a/tests/unit/computations/test_correlation.py b/tests/unit/computations/test_correlation.py
index 42ab796..e6bc280 100644
--- a/tests/unit/computations/test_correlation.py
+++ b/tests/unit/computations/test_correlation.py
@@ -11,7 +11,7 @@ from gn3.computations.correlations import compute_sample_r_correlation
from gn3.computations.correlations import compute_all_sample_correlation
from gn3.computations.correlations import filter_shared_sample_keys
from gn3.computations.correlations import tissue_lit_corr_for_probe_type
-from gn3.computations.correlations import tissue_correlation_for_trait_list
+from gn3.computations.correlations import tissue_correlation_for_trait
from gn3.computations.correlations import lit_correlation_for_trait_list
from gn3.computations.correlations import fetch_lit_correlation_data
from gn3.computations.correlations import query_formatter
@@ -227,7 +227,7 @@ class TestCorrelation(TestCase):
self.assertEqual(results, (None, None))
@mock.patch("gn3.computations.correlations.compute_corr_coeff_p_value")
- def test_tissue_correlation_for_trait_list(self, mock_compute_corr_coeff):
+ def test_tissue_correlation_for_trait(self, mock_compute_corr_coeff):
"""Test given a primary tissue values for a trait and and a list of\
target tissues for traits do the tissue correlation for them
"""
@@ -237,7 +237,7 @@ class TestCorrelation(TestCase):
mock_compute_corr_coeff.side_effect = [(0.4, 0.9), (-0.2, 0.91)]
expected_tissue_results = {"1456_at": {"tissue_corr": 0.4,
"tissue_p_val": 0.9, "tissue_number": 3}}
- tissue_results = tissue_correlation_for_trait_list(
+ tissue_results = tissue_correlation_for_trait(
primary_tissue_values, target_tissues_values,
corr_method="pearson", trait_id="1456_at",
compute_corr_p_value=mock_compute_corr_coeff)
@@ -395,7 +395,7 @@ class TestCorrelation(TestCase):
self.assertEqual(lit_correlation_results, expected_mocked_lit_results)
- @mock.patch("gn3.computations.correlations.tissue_correlation_for_trait_list")
+ @mock.patch("gn3.computations.correlations.tissue_correlation_for_trait")
@mock.patch("gn3.computations.correlations.process_trait_symbol_dict")
def test_compute_all_tissue_correlation(self, process_trait_symbol, mock_tissue_corr):
"""Test for compute all tissue corelation which abstracts