aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kabui2021-05-12 19:52:21 +0300
committerAlexander Kabui2021-05-12 19:52:21 +0300
commit9215c0d412bd885db3c3bbcb5635c22ac932b6f4 (patch)
tree9fa10dec7551169ebea7059caadfa372f53e3cba
parentf88a2c3161c71d58c91c3030bd303a86846c5a73 (diff)
downloadgenenetwork3-9215c0d412bd885db3c3bbcb5635c22ac932b6f4.tar.gz
rename lit_correlation_for_trait_list to lit_correlation_for_trait
-rw-r--r--gn3/computations/correlations.py6
-rw-r--r--tests/unit/computations/test_correlation.py10
2 files changed, 8 insertions, 8 deletions
diff --git a/gn3/computations/correlations.py b/gn3/computations/correlations.py
index 21bc82e..2a4854b 100644
--- a/gn3/computations/correlations.py
+++ b/gn3/computations/correlations.py
@@ -287,7 +287,7 @@ def fetch_lit_correlation_data(
return (gene_id, 0)
-def lit_correlation_for_trait_list(
+def lit_correlation_for_trait(
conn,
target_trait_lists: List,
species: Optional[str] = None,
@@ -361,9 +361,9 @@ def map_to_mouse_gene_id(conn, species: Optional[str],
def compute_all_lit_correlation(conn, trait_lists: List,
species: str, gene_id):
"""Function that acts as an abstraction for
- lit_correlation_for_trait_list"""
+ lit_correlation_for_trait"""
- lit_results = lit_correlation_for_trait_list(
+ lit_results = lit_correlation_for_trait(
conn=conn,
target_trait_lists=trait_lists,
species=species,
diff --git a/tests/unit/computations/test_correlation.py b/tests/unit/computations/test_correlation.py
index e6bc280..8bf5b37 100644
--- a/tests/unit/computations/test_correlation.py
+++ b/tests/unit/computations/test_correlation.py
@@ -12,7 +12,7 @@ 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
-from gn3.computations.correlations import lit_correlation_for_trait_list
+from gn3.computations.correlations import lit_correlation_for_trait
from gn3.computations.correlations import fetch_lit_correlation_data
from gn3.computations.correlations import query_formatter
from gn3.computations.correlations import map_to_mouse_gene_id
@@ -246,7 +246,7 @@ class TestCorrelation(TestCase):
@mock.patch("gn3.computations.correlations.fetch_lit_correlation_data")
@mock.patch("gn3.computations.correlations.map_to_mouse_gene_id")
- def test_lit_correlation_for_trait_list(self, mock_mouse_gene_id, fetch_lit_data):
+ def test_lit_correlation_for_trait(self, mock_mouse_gene_id, fetch_lit_data):
"""Fetch results from db call for lit correlation given a trait list\
after doing correlation
"""
@@ -260,7 +260,7 @@ class TestCorrelation(TestCase):
fetch_lit_data.side_effect = [(15, 9), (17, 8), (11, 12)]
- lit_results = lit_correlation_for_trait_list(
+ lit_results = lit_correlation_for_trait(
conn=conn, target_trait_lists=target_trait_lists,
species="rat", trait_gene_id="12")
@@ -375,10 +375,10 @@ class TestCorrelation(TestCase):
self.assertEqual(results, expected_results)
- @mock.patch("gn3.computations.correlations.lit_correlation_for_trait_list")
+ @mock.patch("gn3.computations.correlations.lit_correlation_for_trait")
def test_compute_all_lit_correlation(self, mock_lit_corr):
"""Test for compute all lit correlation which acts\
- as an abstraction for lit_correlation_for_trait_list
+ as an abstraction for lit_correlation_for_trait
and is used in the api/correlation/lit
"""