aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kabui2021-05-30 13:26:15 +0300
committerGitHub2021-05-30 13:26:15 +0300
commit0500d974565320bcb6cf92139ed25c3196800032 (patch)
tree9c2b802b78b4540a341bd090502d8a7711adb8a1
parentcd08b40a4c646ec4acc242f9ea93037e7df9966b (diff)
downloadgenenetwork3-0500d974565320bcb6cf92139ed25c3196800032.tar.gz
fix index error (#16)
-rw-r--r--gn3/computations/correlations.py2
-rw-r--r--tests/unit/computations/test_correlation.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/gn3/computations/correlations.py b/gn3/computations/correlations.py
index 25dd26d..f0ce502 100644
--- a/gn3/computations/correlations.py
+++ b/gn3/computations/correlations.py
@@ -247,7 +247,7 @@ def fetch_lit_correlation_data(
cursor.execute(query_formatter(query,
*tuple(reversed(query_values))))
lit_corr_results = cursor.fetchone()
- lit_results = (gene_id, lit_corr_results[1])\
+ lit_results = (gene_id, lit_corr_results[0])\
if lit_corr_results else (gene_id, 0)
return lit_results
return (gene_id, 0)
diff --git a/tests/unit/computations/test_correlation.py b/tests/unit/computations/test_correlation.py
index d264738..5746adf 100644
--- a/tests/unit/computations/test_correlation.py
+++ b/tests/unit/computations/test_correlation.py
@@ -276,7 +276,7 @@ class TestCorrelation(TestCase):
input trait mouse gene id and mouse gene id
"""
- expected_db_results = [("val", x*0.1)
+ expected_db_results = [[x*0.1]
for x in range(1, 4)]
conn = DataBase(expected_results=expected_db_results)
expected_results = ("1", 0.1)