diff options
-rw-r--r-- | gn3/computations/partial_correlations.py | 7 | ||||
-rw-r--r-- | gn3/db/traits.py | 1 | ||||
-rw-r--r-- | tests/unit/computations/test_correlation.py | 1 |
3 files changed, 3 insertions, 6 deletions
diff --git a/gn3/computations/partial_correlations.py b/gn3/computations/partial_correlations.py index 91e953a..3a229ea 100644 --- a/gn3/computations/partial_correlations.py +++ b/gn3/computations/partial_correlations.py @@ -11,7 +11,6 @@ from typing import Any, Tuple, Union, Sequence import pandas import pingouin -from flask import current_app from scipy.stats import pearsonr, spearmanr from gn3.settings import TEXTDIR @@ -312,7 +311,7 @@ def compute_partial( return None def __remove_controls_for_target_nones(cont_targ): - return tuple(cont for cont,targ in cont_targ if targ is not None) + return tuple(cont for cont, targ in cont_targ if targ is not None) conts_targs = tuple(tuple( zip(control, targ_vals)) for control in control_vals) @@ -322,7 +321,7 @@ def compute_partial( [__remove_controls_for_target_nones(cont_targ) for cont_targ in conts_targs]) covariates = "z" if datafrm.shape[1] == 3 else [ - col for col in datafrm.columns if col not in ("x", "y")]; current_app.logger.info("DATAFRAME: {}".format(datafrm)) + col for col in datafrm.columns if col not in ("x", "y")] ppc = pingouin.partial_corr( data=datafrm, x="x", y="y", covar=covariates, method=( "pearson" if "pearson" in method.lower() else "spearman")) @@ -345,7 +344,7 @@ def compute_partial( return tuple( result for result in ( __compute_trait_info__(target) - for target in zip(target_vals, target_names)) + for target in zip(target_vals, target_names)) if result is not None) def partial_correlations_normal(# pylint: disable=R0913 diff --git a/gn3/db/traits.py b/gn3/db/traits.py index 7994aef..68b6059 100644 --- a/gn3/db/traits.py +++ b/gn3/db/traits.py @@ -1,6 +1,5 @@ """This class contains functions relating to trait data manipulation""" import os -import MySQLdb from functools import reduce from typing import Any, Dict, Union, Sequence diff --git a/tests/unit/computations/test_correlation.py b/tests/unit/computations/test_correlation.py index 0de347d..7523d99 100644 --- a/tests/unit/computations/test_correlation.py +++ b/tests/unit/computations/test_correlation.py @@ -1,7 +1,6 @@ """Module contains the tests for correlation""" from unittest import TestCase from unittest import mock -import unittest from collections import namedtuple import math |