diff options
author | Frederick Muriuki Muriithi | 2021-12-14 05:01:30 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2021-12-14 05:01:30 +0300 |
commit | f5183895e3a6e6914af98a979e437439fdbfecc4 (patch) | |
tree | 0e58e7d34253cf5f1d7fdfc023ad72580beb0fa0 /gn3/computations | |
parent | 1a46021a37ca23fe9893fd4ac9ac9c1d4066884b (diff) | |
download | genenetwork3-f5183895e3a6e6914af98a979e437439fdbfecc4.tar.gz |
TO REVERT: Add logging to see data frame
Diffstat (limited to 'gn3/computations')
-rw-r--r-- | gn3/computations/partial_correlations.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gn3/computations/partial_correlations.py b/gn3/computations/partial_correlations.py index fbff4df..95eb5e9 100644 --- a/gn3/computations/partial_correlations.py +++ b/gn3/computations/partial_correlations.py @@ -11,6 +11,7 @@ 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 @@ -320,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")] + col for col in datafrm.columns if col not in ("x", "y")]; current_app.logger.info("DATAFRAME: {}".format(datafrm)) ppc = pingouin.partial_corr( data=datafrm, x="x", y="y", covar=covariates, method=( "pearson" if "pearson" in method.lower() else "spearman")) |