diff options
author | Frederick Muriuki Muriithi | 2021-12-14 13:53:30 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2021-12-14 13:53:30 +0300 |
commit | ed87184929eec6614c2cca0105c335ad24bf2720 (patch) | |
tree | b6a25a528c4c849cdc062043f47034a096ba78cc /gn3 | |
parent | 6848b3f6d69ba2e032a7edfea513d0a225225827 (diff) | |
download | genenetwork3-ed87184929eec6614c2cca0105c335ad24bf2720.tar.gz |
linting: Fix obvious linting issues
Diffstat (limited to 'gn3')
-rw-r--r-- | gn3/computations/partial_correlations.py | 7 | ||||
-rw-r--r-- | gn3/db/traits.py | 1 |
2 files changed, 3 insertions, 5 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 |