From 44ca6954fbd42af50f1bc5ed7c02a85bdb98f6f1 Mon Sep 17 00:00:00 2001 From: "Abolfazl (Abe)" Date: Fri, 22 Dec 2023 10:56:42 -0800 Subject: [PATCH] fill na pvalues with 1 related to #12 --- screenpro/phenoScore.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/screenpro/phenoScore.py b/screenpro/phenoScore.py index e95936f..3508ee9 100644 --- a/screenpro/phenoScore.py +++ b/screenpro/phenoScore.py @@ -56,11 +56,12 @@ def runPhenoScore(adata, cond1, cond2, math, test, score_level, math=math, ave_reps=True, test=test, growth_rate=growth_rate ) - + # fill na with 1 + p_values[np.isnan(p_values)] = 1 # Calculate the adjusted p-values using the Benjamini-Hochberg method if p_values is None: raise ValueError('p_values is None') - _, adj_pvalues, _, _ = multipletests(p_values.fillna(1), alpha=0.05, method='fdr_bh') + _, adj_pvalues, _, _ = multipletests(p_values, alpha=0.05, method='fdr_bh') # get targets targets = adata.var.index.str.split('_[-,+]_').str[0].to_list() # combine results into a dataframe