From 0c4fb79532f2307e182dbf171b4369b3e0aa74a2 Mon Sep 17 00:00:00 2001 From: Jan Patrick Pett Date: Sun, 10 Mar 2024 16:21:11 +0000 Subject: [PATCH] fix test --- snp2cell/snp2cell_class.py | 2 +- snp2cell/util.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/snp2cell/snp2cell_class.py b/snp2cell/snp2cell_class.py index c7e78d0..7d6edd0 100644 --- a/snp2cell/snp2cell_class.py +++ b/snp2cell/snp2cell_class.py @@ -709,7 +709,7 @@ def adata_add_de_scores( if "method" in kwargs and kwargs["method"] == "logreg": query_str = f"group == '{grp}'" else: - query_str = f"group == '{grp}' and pvals_adj < 0.05 and logfoldchanges > 0" + query_str = f"group == '{grp}' and pvals_adj < 0.05 and scores > 0" scr = de_df.query(query_str).set_index("names")["scores"][:topn].to_dict() scr_key = f"DE_{grp}__score" diff --git a/snp2cell/util.py b/snp2cell/util.py index f3509d4..164f7d4 100644 --- a/snp2cell/util.py +++ b/snp2cell/util.py @@ -457,7 +457,7 @@ def get_snp_score(df): snp_bf = ( np.log(1 - snp_r) / 2 + (snp_beta / snp_se) ** 2 * snp_r / 2 ) # log BF - return np.exp(snp_bf - snp_ld/4) + return np.exp(snp_bf - snp_ld / 4) except Exception as e: raise ValueError(f"could not compute score using {df} \n{e}")