From 4adc62420d2bd171470f3a8aed8ca0c565181dc1 Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Tue, 26 Nov 2024 10:18:31 +0000 Subject: [PATCH] :bug: newer versions of numpy need explicit type - NA can lead to float columns instead of 0. to investigate --- acore/enrichment_analysis.py | 3 ++- docs/api_examples/enrichment_analysis.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/acore/enrichment_analysis.py b/acore/enrichment_analysis.py index 259fe73..f8ac681 100644 --- a/acore/enrichment_analysis.py +++ b/acore/enrichment_analysis.py @@ -308,7 +308,8 @@ def run_regulation_enrichment( method='fisher', ) """ - mask_rejected = regulation_data[reject_col] + # ? can we remove NA features in that column? + mask_rejected = regulation_data[reject_col].astype(bool) foreground_list = regulation_data.loc[mask_rejected, identifier].unique() background_list = regulation_data.loc[~mask_rejected, identifier].unique() foreground_pop = len(foreground_list) diff --git a/docs/api_examples/enrichment_analysis.py b/docs/api_examples/enrichment_analysis.py index d7dada2..598a12a 100644 --- a/docs/api_examples/enrichment_analysis.py +++ b/docs/api_examples/enrichment_analysis.py @@ -94,6 +94,7 @@ diff_reg.describe(exclude=["float"]) # %% +diff_reg["rejected"] = diff_reg["rejected"].astype(bool) # ! needs to be fixed in anova diff_reg.query("rejected == True") # %% [markdown]